Re: Is there a way to dump schema to files on disk and keep them in sync

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Tim Uckun <timuckun(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a way to dump schema to files on disk and keep them in sync
Date: 2020-12-13 22:13:06
Message-ID: 67162da0-f9b1-eb6c-a19a-b6973b3c2541@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/13/20 1:04 PM, Tim Uckun wrote:
>> pgAdmin does not create directories, it just organizes the contents of
> the system catalogs into GUI elements.
>
>
> I realize that :). I meant organized in the same way but on disk.
>

Nothing that I know of. You could do a pg_dump -d some_db
-s/--schema-only and to get a starting point for schema definitions.
Then create your own directory structure for the schema types(tables,
functions, types, etc), with sub-directories for the individual items. I
did something like that years ago and it worked until it fell over. For
instance should triggers definitions stay with the table or be on their
own, same for trigger functions. What happens if you rename something,
do you rename your directory? And so on. That is why I moved to Sqitch,
someone smarter then I came up with a solution that worked and allows me
to do what you state is your goal in your previous post. Namely, use for
development and experimentation. In addition once you have done the
preceding can then roll out to production.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Benedict Holland 2020-12-13 22:35:26 Re: Is there a way to dump schema to files on disk and keep them in sync
Previous Message Tim Uckun 2020-12-13 21:04:52 Re: Is there a way to dump schema to files on disk and keep them in sync