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

Re: [PATCHES] Cascaded Column Drop

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Tim Knowles <tim(at)ametco(dot)co(dot)uk>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Cascaded Column Drop
Date: 2002-09-29 02:41:50
Message-ID: 7168.1033267310@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Rod Taylor <rbt(at)rbt(dot)ca> writes:
>> I did something about this --- as of CVS tip, you can do
>> 
>> regression=# create table foo (f1 int);
>> CREATE TABLE
>> regression=# alter table foo drop column f1;
>> ALTER TABLE
>> regression=# select * from foo;

> Which of course would dump as 'create table foo ();'.

True.  I didn't say that everything would be happy with it ;-).  I think
that a zero-column table is only useful as a transient state, and so I'm
happy as long as the backend doesn't core dump.

> I don't think relcache would like a table without any columns, which is
> why the above is rejected.

Relcache doesn't seem to have a problem with it.

> Anyway, should pg_dump ignore the table entirely?  Or do we try to allow
> create table () without any attributes?

I feel no strong need to do either.  But it likely would only take
removal of this error check:

regression=# create table foo ();
ERROR:  DefineRelation: please inherit from a relation or define an attribute

at least as far as the backend goes.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2002-09-29 02:47:42
Subject: Re: Default privileges for new databases (was Re: Can't import
Previous:From: Tom LaneDate: 2002-09-29 02:37:23
Subject: Re: Default privileges for new databases (was Re: Can't import large objects in most recent cvs)

pgsql-patches by date

Next:From: Rod TaylorDate: 2002-09-29 02:50:32
Subject: Re: [PATCHES] Cascaded Column Drop
Previous:From: Rod TaylorDate: 2002-09-29 02:19:50
Subject: Re: [PATCHES] Cascaded Column Drop

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