Re: PostgreSQL equivalent of the Oracale 'unique' qualifier - Mailing list pgsql-general

From Alexander Staubo
Subject Re: PostgreSQL equivalent of the Oracale 'unique' qualifier
Date
Msg-id 4D1E93C0-17B0-4A29-B463-3917CE380B9A@purefiction.net
Whole thread Raw
In response to PostgreSQL equivalent of the Oracale 'unique' qualifier  ("Wm.A.Stafford" <stafford@marine.rutgers.edu>)
List pgsql-general
On Nov 20, 2006, at 21:13 , Wm.A.Stafford wrote:

> I hope the subject says it all.  I'm porting an Oracle-centric
> application to PostgreSQL and the Oracle sql is full of the
> 'unique' qualifier.  I'm assuming PostgreSQL does not support
> 'unique' since don't see a 'unique' anywhere in the PostgreSQL
> docs.  Is there a substitute or a technique to get the same result?

Which documentation? It's in the index:

   http://www.postgresql.org/docs/8.1/interactive/bookindex.html

The entry points here:

   http://www.postgresql.org/docs/8.1/interactive/ddl-
constraints.html#AEN2016

PostgreSQL does ANSI SQL:

   create table foo (s text unique);

   create table foo (s text, constraint s_unique unique (s));

   alter table foo add constraint s_unique unique (s);

And the usual index syntax:

   create unique index foo_s_index on foo (s);

Syntax reference:

   http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html
   http://www.postgresql.org/docs/8.1/interactive/sql-altertable.html
   http://www.postgresql.org/docs/8.1/interactive/sql-createindex.html

Alexander.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL equivalent of the Oracale 'unique' qualifier
Next
From: gonzales@linuxlouis.net
Date:
Subject: Re: PostgreSQL equivalent of the Oracale 'unique' qualifier