Hello

I would to continue on implementation --if-exists option (using
conditional DROP statements) for pg_dump

related discussion

http://www.postgresql.org/message-id/cafj8prdwqtxnc+reuavc4h5hx1f_0hkna-9f+2fgcu18axt...@mail.gmail.com

Actually, we are not able to do simple implementation due double check
(dependency check) in DROP STATEMENTS

small example

create or replace function fg() returns setof omega as $$ select *
from omega $$ language sql;
create or replace function fg(a omega) returns setof omega as $$
select * from omega $$ language sql;

There is dependency fg function on table omega.

Dump cleanup section:

DROP FUNCTION IF EXISTS public.fg(a omega);
DROP TABLE IF EXISTS public.omega;
DROP EXTENSION IF EXISTS plpgsql;
DROP SCHEMA IF EXISTS public;

But DROP FUNCTION fails due missing table omega

SET
ERROR:  type "omega" does not exist

so we are not able to reload dump inside transaction.

so my proposal:

two ways

* do conditional drops fully fault tolerant - it show only notice instead error

or

* decrease level of exceptions in conditional drops to WARNINGS

Ideas, comments??

Regards

Pavel


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

Reply via email to