Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koVoH-0001GR-Ob for pgsql-general@arkaria.postgresql.org; Sun, 13 Dec 2020 18:09:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1koVoG-0003DN-Nv for pgsql-general@arkaria.postgresql.org; Sun, 13 Dec 2020 18:09:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koVoG-0003DF-GL for pgsql-general@lists.postgresql.org; Sun, 13 Dec 2020 18:09:28 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koVoD-0005kM-Q2 for pgsql-general@postgresql.org; Sun, 13 Dec 2020 18:09:28 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 91A8B7ED; Sun, 13 Dec 2020 13:09:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 13 Dec 2020 13:09:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=q l0yI0GOd3kO1c7cfWzvuOdg73dhUzJRkx2CMos5BbI=; b=NH66nDY66fPV7SAUr auXQk/Rk5A4f5k7dGPjotqQcjGdGvajK0U2pUHM45Dy3Wi0uqcIV76BGEAk/kkyR N5usXrXeRA9nHJGsolY+ndziK9QklRkqCsPeZ1xJjohASeRwD6KVVFnYVSwKQ/iO LHhvcjWwtoKhG/y2hZ6BXtQNQQmcZoX3+fPyAYayRofLqYb9YrOBUaTHf8mlV+Gl /ENR3GX4yAEUksO/G5VgbZJb7dBG6eEPw3qJLA/JYLzp/NRRM/KCgKu/rXRD8pRJ LXgt2CSqFeE7B2yCK31u37jgctRUNgZTte3h97UtTtxLwn3q7tEW+3eJZXBnEf8W 47sTQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=ql0yI0GOd3kO1c7cfWzvuOdg73dhUzJRkx2CMos5B bI=; b=a4HtCRpFeoE97anSAkFA4UypbAQWSCYOh5AieUPQs3rVcQSUSsJWbJiUN TH1zcjDiAuomU29IwL2l7rFiYsBqSpbzDC7bv/z3iQDCbH++Iee8FqW8LIxbWGCJ oMRWU2tFzEfX5ylfkKJtv9aVZ37yhrV1IdnETQJJoMoxD1bik2XYhTs4yavw+UtV WJJ0XN4NFbS+HZQCFgpdxALaaE/PBHXJDvgw4Jogr4RlZRbvx6T/JH4oLgviA/IZ yD93lGL1UrEqmNxBwxeVkjwmv8jLaY9zROV5SM0nDsMMfDZ7YqkeVC+5sPIvtPDx Zq+rM6yb+r+Li8uHTa2JE8jKtQ5ug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudekiedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepleevffehuddtveefudettddtvdegfeehgfefteeg geevveeiieduhffgffdvleelnecuffhomhgrihhnpehsqhhithgthhdrohhrghdpphhosh htghhrvghsqhhlrdhorhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucfkphepjeeh rddujedvrddurdeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (75-172-1-69.tukw.qwest.net [75.172.1.69]) by mail.messagingengine.com (Postfix) with ESMTPA id 22D4A1080069; Sun, 13 Dec 2020 13:09:22 -0500 (EST) Subject: Re: Is there a way to dump schema to files on disk and keep them in sync To: Benedict Holland , Tomas Vondra Cc: Tim Uckun , pgsql-general References: <94d0857d-fbeb-81d6-e285-f088e5efb472@aklaver.com> From: Adrian Klaver Message-ID: Date: Sun, 13 Dec 2020 10:09:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/13/20 10:03 AM, Benedict Holland wrote: > You want Alembic and an afternoon of python writing. You just described > an ORM. In other words out of the frying pan and into the fire. > > On Sun, Dec 13, 2020, 12:53 PM Tomas Vondra > > > wrote: > > On 12/13/20 6:34 PM, Adrian Klaver wrote: > > On 12/12/20 6:58 PM, Tim Uckun wrote: > >> I want to dump my postgres schema to disk in neat directories like > >> pgadmin presents. Then I want to be able to edit the files and sync > >> changes to the database and ideally if changes were made in the > >> database to sync them back to the disk. > >> > >> Is there a tool that does this? Is there a tool that will dump the > >> schema into separate directories and files like pgadmin does? > > > > pgAdmin does not create directories, it just organizes the > contents of > > the system catalogs into GUI elements. > > > > For schema management I would suggest a tool like the one I use > > Sqitch(https://sqitch.org/ ). It will > organize the process of schema > > creation and management. > > > > Yeah, that was my thought too. Or maybe look at the other schema > versioning tools available - we have a list on the wiki: > > https://wiki.postgresql.org/wiki/Change_management_tools_and_techniques > > > I'm sure it's incomplete, but it's helpful nevertheless. > > > regards > > -- > Tomas Vondra > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > -- Adrian Klaver adrian.klaver@aklaver.com