pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: LeoDeBeo <leodebeo@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: create table
Date: Fri, 04 May 2001 18:43:40 -0400
Message-ID: <1835.989016220@sss.pgh.pa.us> (raw)
In-Reply-To: <9chqd9$21vm$2@news.tht.net>
References: <9chqd9$21vm$2@news.tht.net>

LeoDeBeo <leodebeo@hotmail.com> 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



view thread (17+ messages)  latest in thread

Message-ID: <1835.989016220@sss.pgh.pa.us>
Permalink:  ../1835.989016220@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1835.989016220@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, leodebeo@hotmail.com
  Subject: Re: create table
  In-Reply-To: <1835.989016220@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox