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

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Is this a bug? Deleting a column deletes the constraint.
Date: 2006-10-12 14:56:14
Message-ID: 60iripr3ap.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

dev(at)freedomcircle(dot)net (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 view descriptor or in the <search
>> condition> of any constraint descriptor other than a table con-
>> straint descriptor that contains references to no other column
>> and that is included in the table descriptor of T.
>>
>> IOW we should only allow unique constraints to be auto-dropped if
>> they reference just the one single column. Ick.
>
> I didn't realize before that you can also drop all columns, leaving a
> table without *any* columns. Is that a SQL92 "feature"?

You can create a table without any columns.

tutorial=# create table empty_table ();
CREATE TABLE
tutorial=# \d empty_table
Table "public.empty_table"
Column | Type | Modifiers
--------+------+-----------

tutorial=# select * from empty_table ;

--
(0 rows)

A table without columns is of pretty limited usefulness, until you add
some columns, but having a form of "zero" seems not insensible...
--
let name="cbbrowne" and tld="acm.org" in String.concat "@" [name;tld];;
http://www3.sympatico.ca/cbbrowne/lisp.html
They are called computers simply because computation is the only
significant job that has so far been given to them. -- Louis Ridenour

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Florian Weimer 2006-10-12 16:19:57 Re: Is this a bug? Deleting a column deletes the constraint.
Previous Message Tom Lane 2006-10-12 14:39:09 Re: Is this a bug? Deleting a column deletes the constraint.