Re: Backup strategy - Mailing list pgsql-admin

From David G. Johnston
Subject Re: Backup strategy
Date
Msg-id CAKFQuwbXWNyT0zyZG7iL1wNLQUPitTJ89z6WAsWbmqJZXiA_6Q@mail.gmail.com
Whole thread Raw
In response to RE: Backup strategy  (David Barron <david.barron@zencos.com>)
List pgsql-admin


On Wed, Feb 28, 2024, 09:45 David Barron <david.barron@zencos.com> wrote:

If, for example, table a has a constraint that references rows in table b, table b has to be restored first, but pg_dump doesn't take that into account.  So the restore tries to restore table a first, but can't because table b contains no data.  That's what I ran into in general terms.

It is illegal to write a check constraint that references another table.  It doesn't matter that hiding your illegal setup inside a back box function prevents the system from stopping you.  You need to fix your design so as not to break the documented rules.  Namely by using a trigger.

David J.

pgsql-admin by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Backup strategy
Next
From: David Barron
Date:
Subject: RE: Backup strategy