Skip site navigation (1) Skip section navigation (2)

Re: Tentative patch for making DROP put dependency info in DETAIL

From: "Alex Hunsaker" <badalex(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Tentative patch for making DROP put dependency info in DETAIL
Date: 2008-06-12 17:49:36
Message-ID: 34d269d40806121049w69ba3261rda5dc0be33a274c3@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-patches
On Thu, Jun 12, 2008 at 11:35 AM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> I don't think there's anything wrong with that in principle.  However,
> does your patch actually work?  The changes in expected/ is unexpected,
> I think.

Yeah I thought they looked a bit odd at first to. I thought it would
just get rid of the duplicate NOTICES's.  On closer look they don't
NOITCE anymore because all the tables are listed in the drop.  Here is
an example:

# with all them in in drop table
create table test (a int primary key);
create table test_a (a int references test);
create table test_b (a int references test);
drop table test, test_a, test_b cascade;
DROP TABLE

# now without test_b
create table test (a int primary key);
create table test_a (a int references test);
create table test_b (a int references test);
drop table test, test_a cascade;
NOTICE:  drop cascades to constraint test_b_a_fkey on table test_b
DROP TABLE

In fact you don't even need the cascade anymore if you specify all the
dependent tables.
So that certainly *seems* right to me.

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2008-06-12 17:58:47
Subject: Re: Tentative patch for making DROP put dependency info in DETAIL
Previous:From: Alvaro HerreraDate: 2008-06-12 17:35:02
Subject: Re: Tentative patch for making DROP put dependency infoin DETAIL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group