Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9cecff0

Browse files
committed
Document that zero-column tables are allowed (and non-standard).
1 parent5131e5a commit9cecff0

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

‎doc/src/sgml/ref/alter_table.sgml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.52 2002/10/19 23:09:20 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.53 2002/12/16 19:08:25 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -506,6 +506,12 @@ ALTER TABLE distributors ADD PRIMARY KEY (dist_id);
506506
The clauses to rename tables, columns, indexes, and sequences are
507507
<productname>PostgreSQL</productname> extensions from SQL92.
508508
</para>
509+
510+
<para>
511+
<command>ALTER TABLE DROP COLUMN</> can be used to drop the only column
512+
of a table, leaving a zero-column table. This is an extension from SQL92,
513+
which disallows zero-column tables.
514+
</para>
509515

510516
</refsect2>
511517
</refsect1>

‎doc/src/sgml/ref/create_table.sgml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.59 2002/11/21 23:34:43 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.60 2002/12/16 19:08:25 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -915,6 +915,19 @@ CREATE ASSERTION <replaceable>name</replaceable> CHECK ( <replaceable>condition<
915915
standard.
916916
</para>
917917
</refsect2>
918+
919+
<refsect2>
920+
<title>Zero-column tables</title>
921+
922+
<para>
923+
<productname>PostgreSQL</productname> allows a table of no columns
924+
to be created (for example, <literal>CREATE TABLE foo();</>). This
925+
is an extension from the SQL standard, which does not allow zero-column
926+
tables. Zero-column tables are not in themselves very useful, but
927+
disallowing them creates odd special cases for <command>ALTER TABLE
928+
DROP COLUMN</>, so it seems cleaner to ignore this spec restriction.
929+
</para>
930+
</refsect2>
918931
</refsect1>
919932

920933

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp