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: Benedict Holland <benedict(dot)m(dot)holland(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Tim Uckun <timuckun(at)gmail(dot)com>, 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 18:09:21
Message-ID: b5a69b01-abc8-dced-2d82-866f476934a9@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
> <tomas(dot)vondra(at)enterprisedb(dot)com <mailto:tomas(dot)vondra(at)enterprisedb(dot)com>>
> 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/ <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
> <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 <http://www.enterprisedb.com>
> The Enterprise PostgreSQL Company
>
>

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Cherio 2020-12-13 19:27:59 Re: pg_restore fails when psql succeeds
Previous Message Benedict Holland 2020-12-13 18:03:34 Re: Is there a way to dump schema to files on disk and keep them in sync