Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIXLt-00Ewkj-UR for pgsql-general@arkaria.postgresql.org; Tue, 03 Dec 2024 18:10:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tIXLr-00Bmty-2y for pgsql-general@arkaria.postgresql.org; Tue, 03 Dec 2024 18:10:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIXLq-00Bmtq-MU for pgsql-general@lists.postgresql.org; Tue, 03 Dec 2024 18:10:23 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tIXLl-000rib-Hy for pgsql-general@postgresql.org; Tue, 03 Dec 2024 18:10:22 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3ea3cc9a5ddso2924409b6e.3 for ; Tue, 03 Dec 2024 10:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733249416; x=1733854216; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=FH9F3Ajnzt+4hCCzbPgw77RNWOlyReM/KScLoedCvFM=; b=X8s32I2JhMJVqg2Jj0ScxYDrWm/Q+C3UfyBMx2Vp4tGD+ASDD6XRIeekaWUXfNv3Wu vqRbIDOeFrn7047DBRTrlHdrjIXFkKo6JcJVyEoP0TIACavyEJosIFVvtnDkkCn6vAVj uGwBRRL8ruGh/btV0WV4apovclQnHpOF5ywbhrRwGc2R9+Sne0Y4L0R8Cl/6zljFhGjR gGnEqg0I+4xzdcAQO8VecEwVKbdkk0WrAVCCFbLg0LLwXurwIiqAaJwRw2/Pcfsd/LUJ 2Sp319CbEnjlFAe0kqIRgmLPusn0VMjSWD9CQIDvVZGlhne/9MWTns1oqgejtSKBxFym i1yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733249416; x=1733854216; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FH9F3Ajnzt+4hCCzbPgw77RNWOlyReM/KScLoedCvFM=; b=hWMulkLue7F0sq15G1xXH1gBWRbyIxizF4pTCBZpr6+VV/ACG8WRl0KFtT32drcWQu 7DjI/qlAuiVNZySZgX/h63NIjI5eIQLknvsWM4CK3tg0qw5chqWr2awKuQ/UD0XiNYaS gpJ3jHCxwVVlMfJ+xROy7IyQzwJNZlMalHi4F2+X/xCy7qYOzOfVEFjLJwECleUhEsHK pD/ikk215J1O3V4XMAiFSgxP6wfdgCLGehYKjg7d/bLhgizPdg7ilLgg+TvZ2cFdB5Se kuNglwm1/zpCKEIMffMznfwmoitv+CwKTrdLI2Jw/Jq59nlTyGm1g/u7udNqzYnn2dvN Qbrg== X-Gm-Message-State: AOJu0YytnQuB//hS5WyvjPczzhSCaL9B3osCZ/vV079X+5ye7Ovkmfey il/lYNah0Us0qjX3OovJ1bAsiK920xRU3bDAhu1zSKpA/Qq1fdKIx/3gq9raib5Ofzj2tX1Pd4R coHx2fk/rn8SJI8EPWtSc5FHgdzCKXQ== X-Gm-Gg: ASbGnctpXGctFVrPnTGaZc+/ntbvXcWVKuwP2szMYyw4/D3Xi0RKW/SRgsods7ylf5Y fkTHJCiE1vWolrlKWt6uHiffgvsHpIocahaaZcLp+O4AkZAHKqYaKdzQX89lfRg3cxg== X-Google-Smtp-Source: AGHT+IFLlb7jpUak9qbBrCg3w9JezIWxYrQQFl/7iackmSHi6zpw1+YJoGH8+Eu34iFGHk9ZMMoDyCJ0w0TH/ENOG/8= X-Received: by 2002:a05:6808:2f11:b0:3e7:b7f8:f9f5 with SMTP id 5614622812f47-3eae50cf1fbmr3559709b6e.41.1733249416612; Tue, 03 Dec 2024 10:10:16 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Tue, 3 Dec 2024 13:10:05 -0500 Message-ID: Subject: Re: Best Practices for Managing Schema Changes Dynamically with libpq To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000c8d2ab0628619342" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c8d2ab0628619342 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 3, 2024 at 12:44=E2=80=AFPM Sasmit Utkarsh 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.. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000c8d2ab0628619342 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Dec 3, 2024 at 12:44=E2=80=AFPM S= asmit Utkarsh <utkarshsasmit@= gmail.com> wrote:
[snip]=C2=A0<= /div>
How can we efficiently handle table additions/updates while keeping the a= pplication and database in sync dynamically?
=

Enumerate all relevant column names in SE= LECT and INSERT statements.=C2=A0 That way, the application still works whe= n you add columns or alter(*) data types.=C2=A0 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 strin= g into your app's int or float type..

--
Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.
<Redacted> lobs= ter!
--000000000000c8d2ab0628619342--