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 1uFbz9-006ZVy-2D for pgsql-general@arkaria.postgresql.org; Thu, 15 May 2025 17:03:07 +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 1uFbz7-00FiZB-LA for pgsql-general@arkaria.postgresql.org; Thu, 15 May 2025 17:03:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uFbz7-00FiZ2-9h for pgsql-general@lists.postgresql.org; Thu, 15 May 2025 17:03:05 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uFbz4-0023jg-0u for pgsql-general@lists.postgresql.org; Thu, 15 May 2025 17:03:04 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 373B111400B0; Thu, 15 May 2025 13:03:01 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Thu, 15 May 2025 13:03:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1747328581; x=1747414981; bh=yKbEZ75dQkZg5q/nftWZREbasSKlzAfvXMUCHCv0jUU=; b= z43x8K9aY3mMzA8VkW8ywQpg/Q93s5WcJF7UWQ0+H/V1SRVN90oeEbc/xzT4nWkq zyb5G4a/Xkeg0Muuevxe7Mr24m2A9nRjfsiIXZ04NdtlKvCEJ1xr9JOMZgb62UmY 6ufk+7ICBR61p2n3C+me3mcMzmuzRorfH/fY00P07zrF1ykb7bMPIujktZ5o7QgW 1lm3sSkFyZc4LwOMjU1xtRGDQ1UksoECYTvKLL+tNyGytrdifIqmGYWjn5ftZX3d PxPWc+Z16jphGnAcPh6GFWMkY5l1EPf33PJ8h/uqteNb3/LL1aerPDheTHUORMzV p8iqexBKtL1Gx4hpHLtkog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1747328581; x= 1747414981; bh=yKbEZ75dQkZg5q/nftWZREbasSKlzAfvXMUCHCv0jUU=; b=t XQxHMpTSFKdpNOG5DsxhBMwiM5GGZPZJ0/bPrPc+dj3MXD+VGm8m18Hq6o3fislY VagBuWFhRBmXYdU5sJjLHkj3x8utiorQBrBR9IjYzBjdRUTDpTOiHPo4XKoKodA6 8k1+LFVgYlBhXzsbNyzklMX1I4QgxHi1MicoLAIT6CJlxtK9/RKhdTakqWoffqV0 POMhCqekueiRnBUjMAeQPxCNH3JfBWP0GScq8ABLt/Z+4LtVxHIhUMLegE4ppaBg bqx5sQcTI+iyf2lvW89Z96VEBdzveJ4wRK9u/8ZgR7jXaoNwsPGvhTs3e0jhRWF7 d89rt6J9a9cKdZ/6Yc35Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefuddtgeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddt vdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvh gvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhephfdvkefhteeltddu fffhteekffejheehffduleefkefhtdeuheevgefggffgkeehnecuffhomhgrihhnpehsqh hithgthhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprh gtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehvvggvmhgrtddt tddtsehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhjphdqphhgshhqlheshhhjphdrrg htpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhr vghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 May 2025 13:03:00 -0400 (EDT) Message-ID: <6cfe275f-2d7f-426e-b92f-c23a84d53d75@aklaver.com> Date: Thu, 15 May 2025 10:02:59 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How to have a smooth migration To: veem v , "Peter J. Holzer" Cc: pgsql-general References: <060c8abd-7448-4af9-8265-0ca8b81ccf86@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/15/25 09:29, veem v wrote: > > > 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. > 1) For Postgres Sqitch uses psql as the client for making the changes. Therefore you only need access to psql. Also the deployments can be run from a machine that is not in the Cloud, as long as you have remote access to the Postgres instance. 2) With Sqitch you have: a) Deploy/verify/revert actions. The verify helps keep out erroneous deployments and revert can take you back to a known prior state. Caveat the actions are based on SQL/psql scripts you create, they are only useful to the extent you make them so. b) Targets, which are different instances of Postgres you can deploy/verify/revert against independently of each other. Useful to try your changes against a dev instance before deploying to production. 3) I would strongly suggest: a) Breaking the changes down into smaller portions, probably best around tables having relationships. b) Create a dev/test Postgres instance to trial changes and test them. Sqitch is not the only database changes management system out there, it is just the one I found to be useful for my needs. -- Adrian Klaver adrian.klaver@aklaver.com