ToDo: conditional ALTER TABLE

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ToDo: conditional ALTER TABLE
Date: 2011-12-19 09:25:34
Message-ID: CAFj8pRAfQMb1=Mp0vi24YHcgxyJU4AAc-iNwGuNTSS27SisP4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I am working on quiet dumps now. i found a small issue.

pg_dump produces a statements

ALTER TABLE ONLY public.b DROP CONSTRAINT b_fk_fkey;
ALTER TABLE ONLY public.a DROP CONSTRAINT a_pkey;

DROP TABLE IF EXISTS public.b;
DROP TABLE IF EXISTS public.a;

Actually there is no a conditional ALTER. These statements must be
before DROPs, but then it can fails when these tables are missing.

So some form like ALTER TABLE IF EXISTS ... should be usefull

Regards

Pavel Stehule

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2011-12-19 10:16:19 [PATCH] Enable min/max optimization for bool_and/bool_or/every
Previous Message Emanuel Calvo 2011-12-19 09:02:11 Re: REMINDER: FOSDEM 2012 - PostgreSQL Devroom: Call for Speakers