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+2FgCu18aXtY4A@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