inconsistent backup?

Started by Andreas Kretschmerover 12 years ago3 messagesgeneral
Jump to latest
#1Andreas Kretschmer
andreas@a-kretschmer.de

hello all,

don't ask why, but a customer created tables with foreign key constraints but
with inconsistent data.

Because of this he disabled all triggers (alter table foo disable trigger all).
So far, so bad ...
(he can't clean the data at the moment)

In the dump there are the constraints, but NOT the disable triggers. In other
words: no way to restore.

What can we do now?

Version: 9.2

Regards, akretschmer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

In reply to: Andreas Kretschmer (#1)
Re: inconsistent backup?

Am 19.Dez. 2013 um 09:41 schrieb Andreas Kretschmer <andreas@a-kretschmer.de>:

hello all,

don't ask why, but a customer created tables with foreign key constraints but
with inconsistent data.

Because of this he disabled all triggers (alter table foo disable trigger all).
So far, so bad ...
(he can't clean the data at the moment)

In the dump there are the constraints, but NOT the disable triggers. In other
words: no way to restore.

What can we do now?

pg_restore has a --disable-triggers option, that could be of some help. Or you add the command to the top of the sql dump file.

Ralf

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Ralf Schuchardt (#2)
Re: inconsistent backup?

Ralf Schuchardt wrote:

Am 19.Dez. 2013 um 09:41 schrieb Andreas Kretschmer <andreas@a-kretschmer.de>:

don't ask why, but a customer created tables with foreign key constraints but
with inconsistent data.

Because of this he disabled all triggers (alter table foo disable trigger all).
So far, so bad ...
(he can't clean the data at the moment)

In the dump there are the constraints, but NOT the disable triggers. In other
words: no way to restore.

What can we do now?

pg_restore has a --disable-triggers option, that could be of some help. Or you add the command to the
top of the sql dump file.

... or you can edit the dump and change the necessary DDL statements.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general