2 $PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.83 2004/07/12 01:22:53 momjian Exp $
3 PostgreSQL documentation
6 <refentry id="SQL-CREATETABLE">
8 <refentrytitle id="sql-createtable-title">CREATE TABLE</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
13 <refname>CREATE TABLE</refname>
14 <refpurpose>define a new table</refpurpose>
17 <indexterm zone="sql-createtable">
18 <primary>CREATE TABLE</primary>
23 CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PARAMETER">table_name</replaceable> (
24 { <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [ DEFAULT <replaceable>default_expr</> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
25 | <replaceable>table_constraint</replaceable>
26 | LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } DEFAULTS ] } [, ... ]
28 [ INHERITS ( <replaceable>parent_table</replaceable> [, ... ] ) ]
29 [ WITH OIDS | WITHOUT OIDS ]
30 [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
31 [ TABLESPACE <replaceable class="PARAMETER">tablespace</replaceable> ]
33 where <replaceable class="PARAMETER">column_constraint</replaceable> is:
35 [ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
36 { NOT NULL | NULL | UNIQUE | PRIMARY KEY |
37 CHECK (<replaceable class="PARAMETER">expression</replaceable>) |
38 REFERENCES <replaceable class="PARAMETER">reftable</replaceable> [ ( <replaceable class="PARAMETER">refcolumn</replaceable> ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
39 [ ON DELETE <replaceable class="parameter">action</replaceable> ] [ ON UPDATE <replaceable class="parameter">action</replaceable> ] }
40 [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
42 and <replaceable class="PARAMETER">table_constraint</replaceable> is:
44 [ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
45 { UNIQUE ( <replaceable class="PARAMETER">column_name</replaceable> [, ... ] ) |
46 PRIMARY KEY ( <replaceable class="PARAMETER">column_name</replaceable> [, ... ] ) |
47 CHECK ( <replaceable class="PARAMETER">expression</replaceable> ) |
48 FOREIGN KEY ( <replaceable class="PARAMETER">column_name</replaceable> [, ... ] ) REFERENCES <replaceable class="PARAMETER">reftable</replaceable> [ ( <replaceable class="PARAMETER">refcolumn</replaceable> [, ... ] ) ]
49 [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE <replaceable class="parameter">action</replaceable> ] [ ON UPDATE <replaceable class="parameter">action</replaceable> ] }
50 [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
55 <refsect1 id="SQL-CREATETABLE-description">
56 <title>Description</title>
59 <command>CREATE TABLE</command> will create a new, initially empty table
60 in the current database. The table will be owned by the user issuing the
65 If a schema name is given (for example, <literal>CREATE TABLE
66 myschema.mytable ...</>) then the table is created in the
67 specified schema. Otherwise it is created in the current schema.
68 Temporary tables exist in a special schema, so a schema name may not be
69 given when creating a temporary table.
70 The table name must be distinct from the name of any other table,
71 sequence, index, or view in the same schema.
75 <command>CREATE TABLE</command> also automatically creates a data
76 type that represents the composite type corresponding
77 to one row of the table. Therefore, tables cannot have the same
78 name as any existing data type in the same schema.
82 A table cannot have more than 1600 columns. (In practice, the
83 effective limit is lower because of tuple-length constraints).
87 The optional constraint clauses specify constraints (or tests) that
88 new or updated rows must satisfy for an insert or update operation
89 to succeed. A constraint is an SQL object that helps define the
90 set of valid values in the table in various ways.
94 There are two ways to define constraints: table constraints and
95 column constraints. A column constraint is defined as part of a
96 column definition. A table constraint definition is not tied to a
97 particular column, and it can encompass more than one column.
98 Every column constraint can also be written as a table constraint;
99 a column constraint is only a notational convenience if the
100 constraint only affects one column.
105 <title>Parameters</title>
110 <term><literal>TEMPORARY</> or <literal>TEMP</></term>
113 If specified, the table is created as a temporary table.
114 Temporary tables are automatically dropped at the end of a
115 session, or optionally at the end of the current transaction
116 (see <literal>ON COMMIT</literal> below). Existing permanent
117 tables with the same name are not visible to the current session
118 while the temporary table exists, unless they are referenced
119 with schema-qualified names. Any indexes created on a temporary
120 table are automatically temporary as well.
124 Optionally, <literal>GLOBAL</literal> or <literal>LOCAL</literal>
125 can be written before <literal>TEMPORARY</> or <literal>TEMP</>.
126 This makes no difference in <productname>PostgreSQL</>, but see
127 <xref linkend="sql-createtable-compatibility"
128 endterm="sql-createtable-compatibility-title">.
134 <term><replaceable class="PARAMETER">table_name</replaceable></term>
137 The name (optionally schema-qualified) of the table to be created.
143 <term><replaceable class="PARAMETER">column_name</replaceable></term>
146 The name of a column to be created in the new table.
152 <term><replaceable class="PARAMETER">data_type</replaceable></term>
155 The data type of the column. This may include array
156 specifiers. For more information on the data types included with
157 <productname>PostgreSQL</productname>, refer to <xref
164 <term><literal>DEFAULT
165 <replaceable>default_expr</replaceable></literal></term>
168 The <literal>DEFAULT</> clause assigns a default data value for
169 the column whose column definition it appears within. The value
170 is any variable-free expression (subqueries and cross-references
171 to other columns in the current table are not allowed). The
172 data type of the default expression must match the data type of the
177 The default expression will be used in any insert operation that
178 does not specify a value for the column. If there is no default
179 for a column, then the default is null.
185 <term><literal>LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } DEFAULTS ]</literal></term>
188 The <literal>LIKE</literal> clause specifies a table from which
189 the new table automatically copies all column names, their data types,
190 and their not-null constraints.
193 Unlike <literal>INHERITS</literal>, the new table and original table
194 are completely decoupled after creation is complete. Changes to the
195 original table will not be applied to the new table, and it is not
196 possible to include data of the new table in scans of the original
200 Default expressions for the copied column definitions will only be
201 included if <literal>INCLUDING DEFAULTS</literal> is specified. The
202 default is to exclude default expressions.
208 <term><literal>INHERITS ( <replaceable>parent_table</replaceable> [, ... ] )</literal></term>
211 The optional <literal>INHERITS</> clause specifies a list of
212 tables from which the new table automatically inherits all
217 Use of <literal>INHERITS</> creates a persistent relationship
218 between the new child table and its parent table(s). Schema
219 modifications to the parent(s) normally propagate to children
220 as well, and by default the data of the child table is included in
221 scans of the parent(s).
225 If the same column name exists in more than one parent
226 table, an error is reported unless the data types of the columns
227 match in each of the parent tables. If there is no conflict,
228 then the duplicate columns are merged to form a single column in
229 the new table. If the column name list of the new table
230 contains a column name that is also inherited, the data type must
231 likewise match the inherited column(s), and the column
232 definitions are merged into one. However, inherited and new
233 column declarations of the same name need not specify identical
234 constraints: all constraints provided from any declaration are
235 merged together and all are applied to the new table. If the
236 new table explicitly specifies a default value for the column,
237 this default overrides any defaults from inherited declarations
238 of the column. Otherwise, any parents that specify default
239 values for the column must all specify the same default, or an
240 error will be reported.
244 <productname>PostgreSQL</> automatically allows the
245 created table to inherit
246 functions on tables above it in the inheritance hierarchy; that
247 is, if we create table <literal>foo</literal> inheriting from
248 <literal>bar</literal>, then functions that accept the tuple
249 type <literal>bar</literal> can also be applied to instances of
250 <literal>foo</literal>. (Currently, this works reliably for
251 functions on the first or only parent table, but not so well for
252 functions on additional parents.)
259 <term><literal>WITH OIDS</></term>
260 <term><literal>WITHOUT OIDS</></term>
263 This optional clause specifies whether rows of the new table
264 should have OIDs (object identifiers) assigned to them. If
265 neither <literal>WITH OIDS</literal> nor <literal>WITHOUT
266 OIDS</literal> is specified, the default value depends upon the
267 <xref linkend="guc-default-with-oids"> configuration parameter. (If
268 the new table inherits from any tables that have OIDs, then
269 <literal>WITH OIDS</> is forced even if the command says
270 <literal>WITHOUT OIDS</>.)
274 If <literal>WITHOUT OIDS</literal> is specified or implied, this
275 means that the generation of OIDs for this table will be
276 supressed. This is generally considered worthwhile, since it
277 will reduce OID consumption and thereby postpone the wraparound
278 of the 32-bit OID counter. Once the counter wraps around, OIDs
279 can no longer be assumed to be unique, which makes them
280 considerably less useful. In addition, excluding OIDs from a
281 table reduces the space required on disk to storage the table by
282 4 bytes per row, leading to increased performance.
286 To remove OIDs from a table after it has been created, use <xref
287 linkend="sql-altertable" endterm="sql-altertable-title">.
293 <term><literal>CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable></literal></term>
296 An optional name for a column or table constraint. If not specified,
297 the system generates a name.
303 <term><literal>NOT NULL</></term>
306 The column is not allowed to contain null values.
312 <term><literal>NULL</></term>
315 The column is allowed to contain null values. This is the default.
319 This clause is only available for compatibility with
320 non-standard SQL databases. Its use is discouraged in new
327 <term><literal>UNIQUE</> (column constraint)</term>
328 <term><literal>UNIQUE ( <replaceable class="PARAMETER">column_name</replaceable> [, ... ] )</> (table constraint)</term>
332 The <literal>UNIQUE</literal> constraint specifies that a
333 group of one or more distinct columns of a table may contain
334 only unique values. The behavior of the unique table constraint
335 is the same as that for column constraints, with the additional
336 capability to span multiple columns.
340 For the purpose of a unique constraint, null values are not
345 Each unique table constraint must name a set of columns that is
346 different from the set of columns named by any other unique or
347 primary key constraint defined for the table. (Otherwise it
348 would just be the same constraint listed twice.)
354 <term><literal>PRIMARY KEY</> (column constraint)</term>
355 <term><literal>PRIMARY KEY ( <replaceable class="PARAMETER">column_name</replaceable> [, ... ] )</> (table constraint)</term>
358 The primary key constraint specifies that a column or columns of a table
359 may contain only unique (non-duplicate), nonnull values.
360 Technically, <literal>PRIMARY KEY</literal> is merely a
361 combination of <literal>UNIQUE</> and <literal>NOT NULL</>, but
362 identifying a set of columns as primary key also provides
363 metadata about the design of the schema, as a primary key
364 implies that other tables
365 may rely on this set of columns as a unique identifier for rows.
369 Only one primary key can be specified for a table, whether as a
370 column constraint or a table constraint.
374 The primary key constraint should name a set of columns that is
375 different from other sets of columns named by any unique
376 constraint defined for the same table.
382 <term><literal>CHECK (<replaceable class="PARAMETER">expression</replaceable>)</literal></term>
385 The <literal>CHECK</> clause specifies an expression producing a
386 Boolean result which new or updated rows must satisfy for an
387 insert or update operation to succeed. Expressions evaluating
388 to TRUE or UNKNOWN succeed. Should any row of an insert or
389 update operation produce a FALSE result an error exception is
390 raised and the insert or update does not alter the database. A
391 check constraint specified as a column constraint should
392 reference that column's value only, while an expression
393 appearing in a table constraint may reference multiple columns.
397 Currently, <literal>CHECK</literal> expressions cannot contain
398 subqueries nor refer to variables other than columns of the
406 <term><literal>REFERENCES <replaceable class="parameter">reftable</replaceable> [ ( <replaceable class="parameter">refcolumn</replaceable> ) ] [ MATCH <replaceable class="parameter">matchtype</replaceable> ] [ ON DELETE <replaceable class="parameter">action</replaceable> ] [ ON UPDATE <replaceable class="parameter">action</replaceable> ]</literal> (column constraint)</term>
408 <term><literal>FOREIGN KEY ( <replaceable class="parameter">column</replaceable> [, ... ] )
409 REFERENCES <replaceable class="parameter">reftable</replaceable> [ ( <replaceable class="parameter">refcolumn</replaceable> [, ... ] ) ]
410 [ MATCH <replaceable class="parameter">matchtype</replaceable> ]
411 [ ON DELETE <replaceable class="parameter">action</replaceable> ]
412 [ ON UPDATE <replaceable class="parameter">action</replaceable> ]</literal>
413 (table constraint)</term>
417 Theses clauses specify a foreign key constraint, which specifies
418 that a group of one or more columns of the new table must only
419 contain values which match against values in the referenced
420 column(s) <replaceable class="parameter">refcolumn</replaceable>
421 of the referenced table <replaceable
422 class="parameter">reftable</replaceable>. If <replaceable
423 class="parameter">refcolumn</replaceable> is omitted, the
424 primary key of the <replaceable
425 class="parameter">reftable</replaceable> is used. The
426 referenced columns must be the columns of a unique or primary
427 key constraint in the referenced table.
431 A value inserted into these columns is matched against the
432 values of the referenced table and referenced columns using the
433 given match type. There are three match types: <literal>MATCH
434 FULL</>, <literal>MATCH PARTIAL</>, and <literal>MATCH
435 SIMPLE</literal>, which is also the default. <literal>MATCH
436 FULL</> will not allow one column of a multicolumn foreign key
437 to be null unless all foreign key columns are null.
438 <literal>MATCH SIMPLE</literal> allows some foreign key columns
439 to be null while other parts of the foreign key are not
440 null. <literal>MATCH PARTIAL</> is not yet implemented.
444 In addition, when the data in the referenced columns is changed,
445 certain actions are performed on the data in this table's
446 columns. The <literal>ON DELETE</literal> clause specifies the
447 action to perform when a referenced row in the referenced table is
448 being deleted. Likewise, the <literal>ON UPDATE</literal>
449 clause specifies the action to perform when a referenced column
450 in the referenced table is being updated to a new value. If the
451 row is updated, but the referenced column is not actually
452 changed, no action is done. There are the following possible
453 actions for each clause:
457 <term><literal>NO ACTION</literal></term>
460 Produce an error indicating that the deletion or update
461 would create a foreign key constraint violation. This is
468 <term><literal>RESTRICT</literal></term>
471 Same as <literal>NO ACTION</literal> except that this action
472 will not be deferred even if the rest of the constraint is
473 deferrable and deferred.
479 <term><literal>CASCADE</literal></term>
482 Delete any rows referencing the deleted row, or update the
483 value of the referencing column to the new value of the
484 referenced column, respectively.
490 <term><literal>SET NULL</literal></term>
493 Set the referencing column values to null.
499 <term><literal>SET DEFAULT</literal></term>
502 Set the referencing column values to their default value.
510 If primary key column is updated frequently, it may be wise to
511 add an index to the foreign key column so that <literal>NO
512 ACTION</literal> and <literal>CASCADE</literal> actions
513 associated with the foreign key column can be more efficiently
520 <term><literal>DEFERRABLE</literal></term>
521 <term><literal>NOT DEFERRABLE</literal></term>
524 This controls whether the constraint can be deferred. A
525 constraint that is not deferrable will be checked immediately
526 after every command. Checking of constraints that are
527 deferrable may be postponed until the end of the transaction
528 (using the <xref linkend="sql-set-constraints" endterm="sql-set-constraints-title"> command).
529 <literal>NOT DEFERRABLE</literal> is the default. Only foreign
530 key constraints currently accept this clause. All other
531 constraint types are not deferrable.
537 <term><literal>INITIALLY IMMEDIATE</literal></term>
538 <term><literal>INITIALLY DEFERRED</literal></term>
541 If a constraint is deferrable, this clause specifies the default
542 time to check the constraint. If the constraint is
543 <literal>INITIALLY IMMEDIATE</literal>, it is checked after each
544 statement. This is the default. If the constraint is
545 <literal>INITIALLY DEFERRED</literal>, it is checked only at the
546 end of the transaction. The constraint check time can be
547 altered with the <xref linkend="sql-set-constraints" endterm="sql-set-constraints-title"> command.
553 <term><literal>ON COMMIT</literal></term>
556 The behavior of temporary tables at the end of a transaction
557 block can be controlled using <literal>ON COMMIT</literal>.
558 The three options are:
562 <term><literal>PRESERVE ROWS</literal></term>
565 No special action is taken at the ends of transactions.
566 This is the default behavior.
572 <term><literal>DELETE ROWS</literal></term>
575 All rows in the temporary table will be deleted at the
576 end of each transaction block. Essentially, an automatic
577 <xref linkend="sql-truncate"> is done at each commit.
583 <term><literal>DROP</literal></term>
586 The temporary table will be dropped at the end of the current
597 <term><literal>TABLESPACE <replaceable class="PARAMETER">tablespace</replaceable></literal></term>
600 The <replaceable class="PARAMETER">tablespace</replaceable> is the name
601 of the tablespace in which the new table is to be created. If not
602 supplied, the default tablespace of the table's schema will be used.
610 <refsect1 id="SQL-CREATETABLE-notes">
616 Using OIDs in new applications is not recommended: where
617 possible, using a <literal>SERIAL</literal> or other sequence
618 generator as the table's primary key is preferred. However, if
619 your application does make use of OIDs to identify specific rows
620 rows of a table, it is recommended to create a unique constraint
621 on the <structfield>oid</> column of that table, to ensure that
622 OIDs in the table will indeed uniquely identify rows even after
623 counter wraparound. Avoid assuming that OIDs are unique across
624 tables; if you need a database-wide unique identifier, use the
625 combination of <structfield>tableoid</> and row OID for the
631 The use of <literal>WITHOUT OIDS</literal> is not recommended
632 for tables with no primary key, since without either an OID or a
633 unique data key, it is difficult to identify specific rows.
640 <productname>PostgreSQL</productname> automatically creates an
641 index for each unique constraint and primary key constraint to
642 enforce the uniqueness. Thus, it is not necessary to create an
643 explicit index for primary key columns. (See <xref
644 linkend="sql-createindex" endterm="sql-createindex-title"> for more information.)
650 Unique constraints and primary keys are not inherited in the
651 current implementation. This makes the combination of
652 inheritance and unique constraints rather dysfunctional.
659 <refsect1 id="SQL-CREATETABLE-examples">
660 <title>Examples</title>
663 Create table <structname>films</> and table
664 <structname>distributors</>:
668 code char(5) CONSTRAINT firstkey PRIMARY KEY,
669 title varchar(40) NOT NULL,
670 did integer NOT NULL,
673 len interval hour to minute
678 CREATE TABLE distributors (
679 did integer PRIMARY KEY DEFAULT nextval('serial'),
680 name varchar(40) NOT NULL CHECK (name <> '')
686 Create a table with a 2-dimensional array:
696 Define a unique table constraint for the table
697 <literal>films</literal>. Unique table constraints can be defined
698 on one or more columns of the table.
707 len interval hour to minute,
708 CONSTRAINT production UNIQUE(date_prod)
714 Define a check column constraint:
717 CREATE TABLE distributors (
718 did integer CHECK (did > 100),
725 Define a check table constraint:
728 CREATE TABLE distributors (
731 CONSTRAINT con1 CHECK (did > 100 AND name <> '')
737 Define a primary key table constraint for the table
738 <structname>films</>. Primary key table constraints can be defined
739 on one or more columns of the table.
748 len interval hour to minute,
749 CONSTRAINT code_title PRIMARY KEY(code,title)
755 Define a primary key constraint for table
756 <structname>distributors</>. The following two examples are
757 equivalent, the first using the table constraint syntax, the second
758 the column constraint notation.
761 CREATE TABLE distributors (
769 CREATE TABLE distributors (
770 did integer PRIMARY KEY,
777 This assigns a literal constant default value for the column
778 <literal>name</literal>, arranges for the default value of column
779 <literal>did</literal> to be generated by selecting the next value
780 of a sequence object, and makes the default value of
781 <literal>modtime</literal> be the time at which the row is
785 CREATE TABLE distributors (
786 name varchar(40) DEFAULT 'Luso Films',
787 did integer DEFAULT nextval('distributors_serial'),
788 modtime timestamp DEFAULT current_timestamp
794 Define two <literal>NOT NULL</> column constraints on the table
795 <classname>distributors</classname>, one of which is explicitly
799 CREATE TABLE distributors (
800 did integer CONSTRAINT no_null NOT NULL,
801 name varchar(40) NOT NULL
807 Define a unique constraint for the <literal>name</literal> column:
810 CREATE TABLE distributors (
812 name varchar(40) UNIQUE
816 The above is equivalent to the following specified as a table constraint:
819 CREATE TABLE distributors (
828 Create table <structname>cinemas</> in tablespace <structname>diskvol1</>:
831 CREATE TABLE cinemas (
835 ) TABLESPACE diskvol1;
841 <refsect1 id="SQL-CREATETABLE-compatibility">
842 <title id="SQL-CREATETABLE-compatibility-title">Compatibility</title>
845 The <command>CREATE TABLE</command> command conforms to SQL92
846 and to a subset of SQL99, with exceptions listed below.
850 <title>Temporary Tables</title>
853 Although the syntax of <literal>CREATE TEMPORARY TABLE</literal>
854 resembles that of the SQL standard, the effect is not the same. In the
856 temporary tables are defined just once and automatically exist (starting
857 with empty contents) in every session that needs them.
858 <productname>PostgreSQL</productname> instead
859 requires each session to issue its own <literal>CREATE TEMPORARY
860 TABLE</literal> command for each temporary table to be used. This allows
861 different sessions to use the same temporary table name for different
862 purposes, whereas the standard's approach constrains all instances of a
863 given temporary table name to have the same table structure.
867 The standard's definition of the behavior of temporary tables is
868 widely ignored. <productname>PostgreSQL</productname>'s behavior
869 on this point is similar to that of several other SQL databases.
873 The standard's distinction between global and local temporary tables
874 is not in <productname>PostgreSQL</productname>, since that distinction
875 depends on the concept of modules, which
876 <productname>PostgreSQL</productname> does not have.
877 For compatibility's sake, <productname>PostgreSQL</productname> will
878 accept the <literal>GLOBAL</literal> and <literal>LOCAL</literal> keywords
879 in a temporary table declaration, but they have no effect.
883 The <literal>ON COMMIT</literal> clause for temporary tables
884 also resembles the SQL standard, but has some differences.
885 If the <literal>ON COMMIT</> clause is omitted, SQL specifies that the
886 default behavior is <literal>ON COMMIT DELETE ROWS</>. However, the
887 default behavior in <productname>PostgreSQL</productname> is
888 <literal>ON COMMIT PRESERVE ROWS</literal>. The <literal>ON COMMIT
889 DROP</literal> option does not exist in SQL.
894 <title>Column Check Constraints</title>
897 The SQL standard says that <literal>CHECK</> column constraints
898 may only refer to the column they apply to; only <literal>CHECK</>
899 table constraints may refer to multiple columns.
900 <productname>PostgreSQL</productname> does not enforce this
901 restriction; it treats column and table check constraints alike.
906 <title><literal>NULL</literal> <quote>Constraint</quote></title>
909 The <literal>NULL</> <quote>constraint</quote> (actually a
910 non-constraint) is a <productname>PostgreSQL</productname>
911 extension to the SQL standard that is included for compatibility with some
912 other database systems (and for symmetry with the <literal>NOT
913 NULL</literal> constraint). Since it is the default for any
914 column, its presence is simply noise.
919 <title>Inheritance</title>
922 Multiple inheritance via the <literal>INHERITS</literal> clause is
923 a <productname>PostgreSQL</productname> language extension. SQL99
924 (but not SQL92) defines single inheritance using a different
925 syntax and different semantics. SQL99-style inheritance is not
926 yet supported by <productname>PostgreSQL</productname>.
931 <title>Object IDs</title>
934 The <productname>PostgreSQL</productname> concept of OIDs is not
940 <title>Zero-column tables</title>
943 <productname>PostgreSQL</productname> allows a table of no columns
944 to be created (for example, <literal>CREATE TABLE foo();</>). This
945 is an extension from the SQL standard, which does not allow zero-column
946 tables. Zero-column tables are not in themselves very useful, but
947 disallowing them creates odd special cases for <command>ALTER TABLE
948 DROP COLUMN</>, so it seems cleaner to ignore this spec restriction.
953 <title>TABLESPACE</title>
956 The <productname>PostgreSQL</productname> concept of tablespaces is not
964 <title>See Also</title>
966 <simplelist type="inline">
967 <member><xref linkend="sql-altertable" endterm="sql-altertable-title"></member>
968 <member><xref linkend="sql-droptable" endterm="sql-droptable-title"></member>
969 <member><xref linkend="sql-createtablespace" endterm="sql-createtablespace-title"></member>
974 <!-- Keep this comment at the end of the file
979 sgml-minimize-attributes:nil
980 sgml-always-quote-attributes:t
983 sgml-parent-document:nil
984 sgml-default-dtd-file:"../reference.ced"
985 sgml-exposed-tags:nil
986 sgml-local-catalogs:"/usr/lib/sgml/catalog"
987 sgml-local-ecat-files:nil