From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Christian Barthel <bch@online.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: FK Constraint sort order with pg_dump
Date: Thu, 21 Jul 2022 11:36:19 -0700
Message-ID: <2fc24762-8f8f-9126-cee5-f85aa88cf003@aklaver.com> (raw)
In-Reply-To: <87bkti4a9d.fsf@online.de>
References: <87h73a4bu3.fsf@online.de>
<a180fd02-85fc-5e28-7952-3cc2e7ff5fe0@aklaver.com>
<87bkti4a9d.fsf@online.de>
On 7/21/22 10:59, Christian Barthel wrote:
> On Thursday, July 21, 2022, Adrian Klaver wrote:
>> Why does it matter?
>
> As the comment in pg_dump.c states, logically identical schemas should
> produce identical dumps:
>
> | * We rely on dependency information to help us determine a safe order,
> | so * the initial sort is mostly for cosmetic purposes: we sort by name
> | to * ensure that logically identical schemas will dump identically.
> <https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/pg_dump/pg_dump.c#l883;
>
> This is done for most objects (tables, functions etc). Why not for FK
> constraints?
>
> It makes comparing schemas on different postgres instances simpler
> (i.e. when you’re working with testing, staging, live systems etc).
>
Alright that I can see.
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, bch@online.de
Subject: Re: FK Constraint sort order with pg_dump
In-Reply-To: <2fc24762-8f8f-9126-cee5-f85aa88cf003@aklaver.com>
References: <87h73a4bu3.fsf@online.de> <a180fd02-85fc-5e28-7952-3cc2e7ff5fe0@aklaver.com> <87bkti4a9d.fsf@online.de> <2fc24762-8f8f-9126-cee5-f85aa88cf003@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox