proposal: fault tolerant DROP XXXX IF name

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема proposal: fault tolerant DROP XXXX IF name
Дата
Msg-id CAFj8pRCw3ADLSrC=fpvDcCcgF2K8GDLw3HkMgkpwm59_9ttPOQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist