Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f44MhkA86841 for ; Fri, 4 May 2001 18:43:46 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f44MheR01838; Fri, 4 May 2001 18:43:40 -0400 (EDT) To: LeoDeBeo cc: pgsql-sql@postgresql.org Subject: Re: create table In-reply-to: <9chqd9$21vm$2@news.tht.net> References: <9chqd9$21vm$2@news.tht.net> Comments: In-reply-to LeoDeBeo message dated "Sun, 29 Apr 2001 21:34:29 +0200" Date: Fri, 04 May 2001 18:43:40 -0400 Message-ID: <1835.989016220@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200105/31 X-Sequence-Number: 2829 LeoDeBeo writes: > i don't understand what the curly brace means after PRIMARY KEY (where is > the other matching brace? Typo. Try more recent versions of the docs. 7.1 says CREATE [ TEMPORARY | TEMP ] TABLE table_name ( { column_name type [ column_constraint [ ... ] ] | table_constraint } [, ... ] ) [ INHERITS ( inherited_table [, ... ] ) ] where column_constraint can be: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | UNIQUE | PRIMARY KEY | DEFAULT value | CHECK (condition) | REFERENCES table [ ( column ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] } and table_constraint can be: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | CHECK ( condition ) | FOREIGN KEY ( column_name [, ... ] ) REFERENCES table [ ( column [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] } The curly braces are just for grouping in cases where it'd not be clear how far the alternatives are supposed to extend. regards, tom lane