pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sferacarta Software <sferac@bo.nettuno.it>
To: pgsql-sql@postgreSQL.org, Colin Dick <cdick@mail.ocis.net>
Subject: Re: [SQL] Creating table with unique key.
Date: Thu, 6 Aug 1998 16:09:20 +0200
Message-ID: <5673.980806@bo.nettuno.it> (raw)
References: <Pine.LNX.3.96.980805144528.18898A-100000@ocis.ocis.net>

Hello Colin,

mercoledì, 5 agosto 98, you wrote:

>> > CREATE TABLE cliente (
>> >         name    varchar(100) UNIQUE NOT NULL,
>> >         username        varchar(8) NOT NULL ,
>> >         key     int4 NOT NULL DEFAULT nextval('key_s') PRIMARY KEY,
>> >         );

CD> Hi this is from a previous post regarding auto-incrementing.  I have that
CD> part working, now I am trying to create a table with a field which will
CD> not be null and will be unique to the rest of table.  Is this possible and
CD> what is the correct syntax.  I have tried and receeved the following:

CD> CREATE TABLE cust (FileNumber int4 unique not null, CompName varchar(50),
CD> FirstName varchar(50), LastName varchar(50), BirthDate varchar(8), Suite
CD> varchar(5), Address varchar(50), City varchar(20), Province varchar(20),
CD> PostalCode varchar(7), Email varchar(50), HomePhone varchar(14), WorkPhone
CD> varchar(14), FaxPhone varchar(14));
CD> WARN:parser: parse error at or near "unique"

CD> Can someone point me in the right direction.  Thanks.

CD> --
CD> Colin Dick
CD> On Call Internet Services
CD> cdick@mail.ocis.net


The syntax is correct for v6.3.2 and it works for me, maybe you have
an older release of PostgreSQL.

Best regards,
   Jose'                            mailto:sferac@bo.nettuno.it





view thread (3+ messages)

Message-ID: <5673.980806@bo.nettuno.it>
Permalink:  ../5673.980806@bo.nettuno.it/
Also on:    postgresql.org/message-id/5673.980806@bo.nettuno.it

 · 

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-interfaces@postgresql.org
  Cc: sferac@bo.nettuno.it, cdick@mail.ocis.net
  Subject: Re: [SQL] Creating table with unique key.
  In-Reply-To: <5673.980806@bo.nettuno.it>

* 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