Re: [SQL] Is this a bug? Deleting a column deletes the constraint.

2006-10-12 Thread Joe
On Thu, 2006-10-12 at 01:25 -0400, Tom Lane wrote: It does seem like this is wrong, in view of SQL92's statement about ALTER TABLE DROP COLUMN: 4) If RESTRICT is specified, then C shall not be referenced in the query expression of any view descriptor or in the search

Re: [SQL] Is this a bug? Deleting a column deletes the constraint.

2006-10-12 Thread Tom Lane
Joe [EMAIL PROTECTED] 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

Re: [SQL] Is this a bug? Deleting a column deletes the constraint.

2006-10-12 Thread Chris Browne
[EMAIL PROTECTED] (Joe) writes: On Thu, 2006-10-12 at 01:25 -0400, Tom Lane wrote: It does seem like this is wrong, in view of SQL92's statement about ALTER TABLE DROP COLUMN: 4) If RESTRICT is specified, then C shall not be referenced in the query expression of any

Re: [SQL] Is this a bug? Deleting a column deletes the constraint.

2006-10-12 Thread Florian Weimer
* Tom Lane: 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 the SQL standard, which does not allow zero-column tables. Zero-column tables are not in themselves very

[SQL] Is this a bug? Deleting a column deletes the constraint.

2006-10-11 Thread Bryce Nesbitt
I got bit by this to be sure, but is it a bug? I guess I'd hoped for a warning at the critical step (see poof below): create table tester (one int, two int, three int); alter table only tester add constraint no_dupes unique (one, two, three); insert into tester values(1,2,3); insert into tester

Re: [SQL] Is this a bug? Deleting a column deletes the constraint.

2006-10-11 Thread Tom Lane
Bryce Nesbitt [EMAIL PROTECTED] writes: I got bit by this to be sure, but is it a bug? I guess I'd hoped for a warning at the critical step (see poof below): create table tester (one int, two int, three int); alter table only tester add constraint no_dupes unique (one, two, three); ...