Re: [PATCHES] Cascaded Column Drop - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Cascaded Column Drop
Date
Msg-id 4644.1033245509@sss.pgh.pa.us
Whole thread Raw
Responses Re: [PATCHES] Cascaded Column Drop  (Rod Taylor <rbt@rbt.ca>)
List pgsql-hackers
Rod Taylor <rbt@rbt.ca> writes:
> Leaving a zero-width table would be best, even if its not so useful.  I
> don't like rejecting a CASCADE as it kinda defeats the purpose of having
> CASCADE.

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;

--
(0 rows)

I fixed the places that were exposed by the regression tests as not
coping with zero-column tables, but it is likely that there are some
more places that will give odd errors with such a table.  Feel free
to beat on it.

psql seems to have some minor issues with a zero-column select.
You can do this:

regression=# insert into foo default values;
INSERT 720976 1
regression=# select * from foo;

--
(1 row)

regression=# insert into foo default values;
INSERT 720977 1
regression=# select * from foo;

--
(2 rows)

regression=# 

Seems like nothing's being printed for an empty row.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: Bug in PL/pgSQL GET DIAGNOSTICS?
Next
From: Alvaro Herrera
Date:
Subject: Re: 7.2.3?