Re: Is this a bug? Deleting a column deletes the constraint. - Mailing list pgsql-sql

From Tom Lane
Subject Re: Is this a bug? Deleting a column deletes the constraint.
Date
Msg-id 10299.1160663949@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is this a bug? Deleting a column deletes the constraint.  (Joe <dev@freedomcircle.net>)
Responses Re: Is this a bug? Deleting a column deletes the constraint.  (Florian Weimer <fweimer@bfk.de>)
List pgsql-sql
Joe <dev@freedomcircle.net> writes:
> I didn't realize before that you can also drop all columns, leaving a
> table without *any* columns.  Is that a SQL92 "feature"?

See the ALTER TABLE reference page:
 ALTER TABLE DROP COLUMN can be used to drop the only column of a table, leaving a zero-column table. This is an
extensionof SQL, which disallows zero-column tables.
 

The CREATE TABLE reference page further amplifies:
 PostgreSQL allows a table of no columns to be created (for example, CREATE TABLE foo();). This is an extension from
theSQL standard, which does not allow zero-column tables. Zero-column tables are not in themselves very useful, but
disallowingthem creates odd special cases for ALTER TABLE DROP COLUMN, so it seems cleaner to ignore this spec
restriction.
        regards, tom lane


pgsql-sql by date:

Previous
From: Joe
Date:
Subject: Re: Is this a bug? Deleting a column deletes the constraint.
Next
From: Chris Browne
Date:
Subject: Re: Is this a bug? Deleting a column deletes the constraint.