Re: FK Constraint sort order with pg_dump - Mailing list pgsql-general

From Adrian Klaver
Subject Re: FK Constraint sort order with pg_dump
Date
Msg-id 2fc24762-8f8f-9126-cee5-f85aa88cf003@aklaver.com
Whole thread Raw
In response to Re: FK Constraint sort order with pg_dump  (Christian Barthel <bch@online.de>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Christian Barthel
Date:
Subject: Re: FK Constraint sort order with pg_dump
Next
From: Tom Lane
Date:
Subject: Re: FK Constraint sort order with pg_dump