public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: pgsql-general <[email protected]>
Subject: Re: Best Practices for Managing Schema Changes Dynamically with libpq
Date: Tue, 3 Dec 2024 13:10:05 -0500
Message-ID: <CANzqJaCykFdcEqKrdHbR9wZo0wUFuA07zJXuqC68s==aUNhAXQ@mail.gmail.com> (raw)
In-Reply-To: <CAM-5MT2gc+=tm5ErdoEyHDef3NzNL2UbAkrykdca9=1VJZi4fg@mail.gmail.com>
References: <CAM-5MT2gc+=tm5ErdoEyHDef3NzNL2UbAkrykdca9=1VJZi4fg@mail.gmail.com>

On Tue, Dec 3, 2024 at 12:44 PM Sasmit Utkarsh <[email protected]>
wrote:
[snip]

> How can we efficiently handle table additions/updates while keeping the
> application and database in sync dynamically?
>

Enumerate all relevant column names in SELECT and INSERT statements.  That
way, the application still works when you add columns or alter(*) data
types.  Dropping columns will still break your app.

*Altering to from a numeric type to a text type might still kill your app,
if it can't convert the string into your app's int or float type..

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Best Practices for Managing Schema Changes Dynamically with libpq
  In-Reply-To: <CANzqJaCykFdcEqKrdHbR9wZo0wUFuA07zJXuqC68s==aUNhAXQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox