pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_restore and drop table problems
2+ messages / 2 participants
[nested] [flat]
* pg_restore and drop table problems
@ 2006-10-25 17:13 Luís Sousa <llsousa@ualg.pt>
2006-10-25 22:54 ` Re: pg_restore and drop table problems Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Luís Sousa @ 2006-10-25 17:13 UTC (permalink / raw)
To: pgsql-admin
Hi again,
Version: 7.4.7-6sarge3
Structure of database: table A (id_a primary key) <-> table B (id_a,id_c
- foreign keys from table A and table C) <-> table C (id_c primary key).
Table A, table B and table C have one record for test purposes
Problem: After error on pg_restore can't drop table that gave error!
Steps to reproduce:
1. pg_dump with -Fc option from database
2. A column name on table C is changed
3. pg_restore using option -S and --disable-triggers with error
identifying that a column on table C was changed
4. drop table B. Can't drop table giving ERROR: relation "B" has
reltriggers = 0
What could be happening here?
Best regards,
Luís Sousa
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: pg_restore and drop table problems
2006-10-25 17:13 pg_restore and drop table problems Luís Sousa <llsousa@ualg.pt>
@ 2006-10-25 22:54 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2006-10-25 22:54 UTC (permalink / raw)
To: Luís Sousa <llsousa@ualg.pt>; +Cc: pgsql-admin
=?ISO-8859-1?Q?Lu=EDs_Sousa?= <llsousa@ualg.pt> writes:
> Steps to reproduce:
> 1. pg_dump with -Fc option from database
> 2. A column name on table C is changed
> 3. pg_restore using option -S and --disable-triggers with error
> identifying that a column on table C was changed
> 4. drop table B. Can't drop table giving ERROR: relation "B" has
> reltriggers = 0
--disable-triggers in 7.x is a crude hack that works by munging the
system catalogs (specifically pg_class.reltriggers). You need to
un-munge the catalog entries in the way that pg_restore evidently
didn't have a chance to do.
UPDATE pg_catalog.pg_class SET reltriggers =
(SELECT pg_catalog.count(*) FROM pg_catalog.pg_trigger
WHERE pg_class.oid = tgrelid)
FROM pg_catalog.pg_namespace
WHERE relnamespace = pg_namespace.oid AND nspname !~ '^pg_';
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-10-25 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-10-25 17:13 pg_restore and drop table problems Luís Sousa <llsousa@ualg.pt>
2006-10-25 22:54 ` Tom Lane <tgl@sss.pgh.pa.us>
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