pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: Is this a bug? Deleting a column deletes the constraint.
Date: Thu, 12 Oct 2006 10:56:14 -0400
Message-ID: <60iripr3ap.fsf@dba2.int.libertyrms.com> (raw)
References: <452DCE97.2090706@obviously.com>
	<2323.1160630748@sss.pgh.pa.us>
	<1160645987.51367.13.camel@pampa>

dev@freedomcircle.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



view thread (6+ messages)  latest in thread

Message-ID: <60iripr3ap.fsf@dba2.int.libertyrms.com>
Permalink:  ../60iripr3ap.fsf@dba2.int.libertyrms.com/
Also on:    postgresql.org/message-id/60iripr3ap.fsf@dba2.int.libertyrms.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: cbbrowne@acm.org
  Subject: Re: Is this a bug? Deleting a column deletes the constraint.
  In-Reply-To: <60iripr3ap.fsf@dba2.int.libertyrms.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox