pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe <dev@freedomcircle.net>
Cc: Bryce Nesbitt <bryce1@obviously.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is this a bug? Deleting a column deletes the constraint.
Date: Thu, 12 Oct 2006 10:39:09 -0400
Message-ID: <10299.1160663949@sss.pgh.pa.us> (raw)
In-Reply-To: <1160645987.51367.13.camel@pampa>
References: <452DCE97.2090706@obviously.com>
	<2323.1160630748@sss.pgh.pa.us>
	<1160645987.51367.13.camel@pampa>

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 extension of 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 the SQL standard, which
  does not allow zero-column tables. Zero-column tables are not in
  themselves very useful, but disallowing them creates odd special cases
  for ALTER TABLE DROP COLUMN, so it seems cleaner to ignore this spec
  restriction.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <10299.1160663949@sss.pgh.pa.us>
Permalink:  ../10299.1160663949@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10299.1160663949@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, dev@freedomcircle.net, bryce1@obviously.com
  Subject: Re: Is this a bug? Deleting a column deletes the constraint.
  In-Reply-To: <10299.1160663949@sss.pgh.pa.us>

* 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