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 1uFbSq-006Sk9-8C for pgsql-general@arkaria.postgresql.org; Thu, 15 May 2025 16:29:44 +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 1uFbSp-00Fa7B-9r for pgsql-general@arkaria.postgresql.org; Thu, 15 May 2025 16:29:43 +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 1uFbSo-00Fa6m-Ux for pgsql-general@lists.postgresql.org; Thu, 15 May 2025 16:29:42 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uFbSm-001wlM-17 for pgsql-general@lists.postgresql.org; Thu, 15 May 2025 16:29:42 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-ac3eb3fdd2eso248825866b.0 for ; Thu, 15 May 2025 09:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747326579; x=1747931379; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sbsrNkAStZTVgYA7ryITtu1s/uK3pZx+E3wJO81ZqXA=; b=G+FbZroQAjy30Ww98QUeTeCp38QH7P8XpAT/sWHinOpMcLhpcs2j/bsYFYOe4xmf1n VE9lLPcJLMe+bDFz1/Ux4CLKi7kptbqkBpFouZbZzy1g2SNuY/Dg0RWaW46yw34fM6RQ gAOhmxurSU7VZUPtOACxknNI2aRvtKJzuJ9LCTO6JdVrsdZCe8UvwSZB7FA0zMxulseK 6Qste+0ghbSGFIQlAk1ALlh12JCCNfuJUZ5ZMTbkKFwOnqcquVt6XOACnjGIbTn+rgxe ysXlr34pwP42fARt4ZRqya1d+i5Usaov1nSMt9wQB4X298mgVh/cQNBYCFCKP+wl3Qk5 TK6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747326579; x=1747931379; h=cc: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=sbsrNkAStZTVgYA7ryITtu1s/uK3pZx+E3wJO81ZqXA=; b=Elmumbzc7EAteBxBXBEHdnLJur1lremtfNJJd9phjo1Kq0kR8X6g2iOGL2HTSUncTX KSHuxJqPUbS5DOfcrSeDyWuVMsKvrjBWH54nuYNEeWUBwk4nPZcSlSBmt5ZT/shVE6UQ NP6RVv4Ye0u0qRObY/GoXfITn8AY6Rw6YiRiJqyNSUiiKQWAnfEalFIsESeFJ+6Ol1yL 3PiX0WRcYa1CcOLOhBnCIwbY2Ib35CiBadsjXsk5xpRSA2IWcZ6McbtUE/p3LD71D3TS NM4h08d7bfwTBPTK5jc0eHovYchTViXOhDRo/PWRsqtVrUav6JG9N9mLFVYvTSRCWs+/ X7dw== X-Gm-Message-State: AOJu0YxgBXXRv4uu+bZKdlZ+l3JXBxaBX76OMD6d7E4ExH1PnXpyEUea HkTQRTr8haTg0sTNZqUkI+o3JUDwGTwWEN922IMh4gt7zwyUh/t1xEQuAKvFjJvvUtQGB4O1/ML ePkiWV20O2Q5d7d/2wv16fNRSthJyg7VKM1Jq X-Gm-Gg: ASbGnct7xpRsEW33goGBIS/QcP6q92JJhrEjKzpqiivG2eJjjpL59FU2aXb9P3dg3L5 YTfw+vih1SCqc98BubQm72SrEPRWtxm54VgJqHQxcnJuJRjbZcOqrxnAJ7ozjXDONgADZMhJhxV y5d8wzObMuudzd1fdCaQLxZr2O9rWFu1ejOOR8f6zc52WlJEeZThOXAIOocy6ZaSbVINo= X-Google-Smtp-Source: AGHT+IG9i2o0LZBT8oZ0mQGDsLGQHxcXc7s0LfxrHDsmsrwHxDjd7XSDyeZobqIEDOAo8iCLGxShJFF7YLlpDZwkmDU= X-Received: by 2002:a17:907:608b:b0:ad2:4f80:a799 with SMTP id a640c23a62f3a-ad52d5b9dc8mr38135766b.43.1747326579230; Thu, 15 May 2025 09:29:39 -0700 (PDT) MIME-Version: 1.0 References: <060c8abd-7448-4af9-8265-0ca8b81ccf86@aklaver.com> In-Reply-To: <060c8abd-7448-4af9-8265-0ca8b81ccf86@aklaver.com> From: veem v Date: Thu, 15 May 2025 21:59:26 +0530 X-Gm-Features: AX0GCFviCMeAypFDMkCCkuqZBzUvLtxLfpiEQ537zw68izLasocCg6Pd_QM-RXE Message-ID: Subject: Re: How to have a smooth migration To: Adrian Klaver , "Peter J. Holzer" Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000000fccd306352f2c05" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000fccd306352f2c05 Content-Type: text/plain; charset="UTF-8" > > > > This is what Sqitch(https://sqitch.org/) was designed for. > > The biggest issue is that the data will be incrementing while you do the > structural changes. How you handle that is going to depend on the > question raised by Peter J. Holzer: > Is this being done in place on one Postgres instance or between > separate Postgres instances? > > > Thank you. Yes, these tables are going to be part of the same database. Never use sqitch though , but was wondering if we can do it with the stored simple proc as the number of table is very small <20 and also the max size of table in <50MB. Also , missed to add , this is a cloud RDS database and so not sure we can have this tool there. To answer the questions specifically raised by Peter J. Holzer . *Are V1 and V2 different databases or do plan to do this in-place?*Answer:- Yes both the versions of the table are in the same database. *What is the purpose of doing it in multiple phases? Do you have lengthy acceptance tests during which new data will accumulate?* Answer:- Yes. Actually there will be a test kind of thing happen with the new code pointing to version V2 tables and to get comfortable. But teh delta data will be very small. *By "rollback" do mean a transaction rollback or some other means of restoring the previous state?*Answer:- "rollbak" means pointing the old code back to the version V1 tables. --0000000000000fccd306352f2c05 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


This is what Sqitch(https://sqitch.org/) was designed for.

The biggest issue is that the data will be incrementing while you do the structural changes. How you handle that is going to depend on the
question raised by Peter J. Holzer:
Is this=C2=A0 being done in place on one Postgres instance or between
separate Postgres instances?



Thank you. Yes, these tables are going= to be part of the same database. Never use sqitch though , but was wonderi= ng if we can do it with the stored simple proc as the number of table is ve= ry small <20 and also the max size of table in <50MB. Also , missed t= o add , this is a cloud RDS database and so not sure we can have this tool = there.

To answer the questions specifically raised= by Peter J. Holzer .

Are V1 and V2 different d= atabases or do plan to do this in-place?
Answer:-
Yes both the ve= rsions of the table are in the same database.

What is the purpose= of doing it in multiple phases? Do you have lengthy acceptance tests durin= g which new data will accumulate?
Answer:-
Yes. Actually there wi= ll be a test kind of thing happen with the new code pointing to version V2 = tables and to get comfortable. But teh delta data will =C2=A0be very small.=

By "rollback" do mean a transaction rollback or some o= ther means of restoring the previous state?
Answer:-
"rollba= k" means pointing the old code back to the version V1 tables.
=C2=A0
--0000000000000fccd306352f2c05--