Re: SQL Newbie Question

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL Newbie Question
Date: 2007-01-25 15:43:08
Message-ID: 45B8D00C.9040804@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/25/07 09:30, Inoqulath wrote:
> Hello Folks
>
> Have a look at this Table:
>
> CREATE TABLE foo(
> id serial,
> a_name text,
> CONSTRAINT un_name UNIQUE (a_name));
>
> Obviously, inserting a string twice results in an error (as one would
> expect). But: is there any known possibility to ingnore an errorneous
> INSERT like SQLite's "conflict algorithm" (SQLite:"INSERT OR
> [IGNORE|ABORT] INTO foo [...]")?
> I tried to use a trigger before INSERT takes place, but it seems that
> before firing a trigger the constraints are checked...
> Background: I'd like to INSERT a few thousand lines in one transaction,
> where some values will be appear twice.

No.

Unique \U*nique"\, a. [F. unique; cf. It. unico; from L. unicus,
from unus one. See {One}.]
Being without a like or equal; unmatched; unequaled;
unparalleled; single in kind or excellence; sole. --
{U*nique"ly}, adv. -- {U*nique"ness}, n.
[1913 Webster]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFuNAMS9HxQb37XmcRAh4XAJ99ebAGyuHTFc9+bLiuW5ewPJkIYgCgguLP
1UDAUlXSGnZrKQb4Czoqp5w=
=Wm9P
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2007-01-25 15:43:12 Re: Subject: Postgres processes have a burst of CPU usage
Previous Message Isaac Ben 2007-01-25 15:34:08 column limit