From 9cecff0314c3c75248f29fea6b80c19d9a8a8c70 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 16 Dec 2002 19:08:25 +0000 Subject: [PATCH] Document that zero-column tables are allowed (and non-standard). --- doc/src/sgml/ref/alter_table.sgml | 8 +++++++- doc/src/sgml/ref/create_table.sgml | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 8c4d6980fed..a8cbfb5bc68 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -1,5 +1,5 @@ @@ -506,6 +506,12 @@ ALTER TABLE distributors ADD PRIMARY KEY (dist_id); The clauses to rename tables, columns, indexes, and sequences are PostgreSQL extensions from SQL92. + + + ALTER TABLE DROP COLUMN can be used to drop the only column + of a table, leaving a zero-column table. This is an extension from SQL92, + which disallows zero-column tables. + diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 6d67f22a6b9..db51a26469f 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -1,5 +1,5 @@ @@ -915,6 +915,19 @@ CREATE ASSERTION name CHECK ( condition< standard. + + + Zero-column tables + + + 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. + +