Commit 9cecff03 authored by Tom Lane's avatar Tom Lane

Document that zero-column tables are allowed (and non-standard).

parent 5131e5ab
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.52 2002/10/19 23:09:20 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.53 2002/12/16 19:08:25 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -506,6 +506,12 @@ ALTER TABLE distributors ADD PRIMARY KEY (dist_id); ...@@ -506,6 +506,12 @@ ALTER TABLE distributors ADD PRIMARY KEY (dist_id);
The clauses to rename tables, columns, indexes, and sequences are The clauses to rename tables, columns, indexes, and sequences are
<productname>PostgreSQL</productname> extensions from SQL92. <productname>PostgreSQL</productname> extensions from SQL92.
</para> </para>
<para>
<command>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.
</para>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.59 2002/11/21 23:34:43 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.60 2002/12/16 19:08:25 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -915,6 +915,19 @@ CREATE ASSERTION <replaceable>name</replaceable> CHECK ( <replaceable>condition< ...@@ -915,6 +915,19 @@ CREATE ASSERTION <replaceable>name</replaceable> CHECK ( <replaceable>condition<
standard. standard.
</para> </para>
</refsect2> </refsect2>
<refsect2>
<title>Zero-column tables</title>
<para>
<productname>PostgreSQL</productname> allows a table of no columns
to be created (for example, <literal>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 <command>ALTER TABLE
DROP COLUMN</>, so it seems cleaner to ignore this spec restriction.
</para>
</refsect2>
</refsect1> </refsect1>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment