pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedFwd: help with uniq index (fwd)
2+ messages / 2 participants
[nested] [flat]
* Fwd: help with uniq index (fwd)
@ 1998-07-23 18:55 Lorenzo Huerta <lorhuerta@yahoo.com>
1998-07-23 19:41 ` Re: [GENERAL] Fwd: help with uniq index (fwd) Vadim Mikheev <vadim@krs.ru>
0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Huerta @ 1998-07-23 18:55 UTC (permalink / raw)
To: pgsql-general@postgreSQL.org; pgsql-sql
can you all help me with this:
> ---------- Forwarded message ----------
> Date: Thu, 23 Jul 1998 12:50:17 -0600 (MDT)
> From: Lorenzo Huerta <lorenzo@nmsu.edu>
> To: pgsql-sql@postgreSQL.org
> Cc: pgsql-general@postgreSQL.org
> Subject: help with uniq index
>
>
> is there a way to create a unique index on a field (in ver 6.3.1
)and also
> have a single non-uniq value in that value, ie the NULL value?
>
>
> Thanks,
>
>
__________________________________________________________________
> * Lorenzo J. Huerta
*
> * Programming Assistant
*
> * Computing & Networking Networking Architecture and
Operations *
> * New Mexico State University
*
> * phone: (w)(505)646-2582 (h)(505) 521-8699 fax:(505) 646-8139
*
> * e-mail: lorenzo@nmsu.edu
*
> * Web Site: http://web.nmsu.edu/~ljhuerta
*
>
__________________________________________________________________
>
>
>
>
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [GENERAL] Fwd: help with uniq index (fwd)
1998-07-23 18:55 Fwd: help with uniq index (fwd) Lorenzo Huerta <lorhuerta@yahoo.com>
@ 1998-07-23 19:41 ` Vadim Mikheev <vadim@krs.ru>
0 siblings, 0 replies; 2+ messages in thread
From: Vadim Mikheev @ 1998-07-23 19:41 UTC (permalink / raw)
To: Lorenzo Huerta <lorhuerta@yahoo.com>; +Cc: pgsql-general@postgreSQL.org; pgsql-sql
Lorenzo Huerta wrote:
>
> can you all help me with this:
>
> > is there a way to create a unique index on a field
> > (in ver 6.3.1) and also
> > have a single non-uniq value in that value, ie the NULL value?
Why do you ask? Why don't you try first?
vac=> create table t (x int);
CREATE
vac=> create unique index ti on t (x);
CREATE
vac=> insert into t values (1);
INSERT 18444 1
vac=> insert into t values (1);
ERROR: Cannot insert a duplicate key into a unique index
vac=> insert into t values (null);
INSERT 18446 1
vac=> insert into t values (null);
INSERT 18447 1
vac=> insert into t values (null);
INSERT 18448 1
Vadim
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-07-23 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-23 18:55 Fwd: help with uniq index (fwd) Lorenzo Huerta <lorhuerta@yahoo.com>
1998-07-23 19:41 ` Vadim Mikheev <vadim@krs.ru>
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