Re: Duplicate key insert question

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "Maksim Likharev" <mlikharev(at)aurigin(dot)com>, "Jean-Christian Imbeault" <jc(at)mega-bucks(dot)co(dot)jp>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Duplicate key insert question
Date: 2003-07-02 00:47:40
Message-ID: D90A5A6C612A39408103E6ECDD77B8294CDE4D@voyager.corporate.connx.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> From: Maksim Likharev [mailto:mlikharev(at)aurigin(dot)com]
> Sent: Tuesday, July 01, 2003 5:40 PM
> To: Jean-Christian Imbeault; Dann Corbit
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: RE: [GENERAL] Duplicate key insert question
>
>
> Yes, but for MSSQL unique index with ignore duplicate in
> reality will reject all duplicates. Another word if you are
> trying to insert 2 identical values
> you will insert none.

Their documentation is wrong then. From here:
http://www.mysql.com/doc/en/ALTER_TABLE.html we have this:

"IGNORE is a MySQL extension to SQL-92. It controls how ALTER TABLE
works if there are duplicates on unique keys in the new table. If IGNORE
isn't specified, the copy is aborted and rolled back. If IGNORE is
specified, then for rows with duplicates on a unique key, only the first
row is used; the others are deleted."

> Do search using IF EXISTS SELECT ... or LEFT OUTER JOIN ...
> WHERE ... IS NULL. works pretty fast.
>
>
> -----Original Message-----
> From: Jean-Christian Imbeault [mailto:jc(at)mega-bucks(dot)co(dot)jp]
> Sent: Tuesday, July 01, 2003 5:21 PM
> To: Dann Corbit
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Duplicate key insert question
>
>
> Dann Corbit wrote:
> >
> > SQL*Server has a nice feature for this.
>
> Ok ... is there a way to achieve the same effect in postgres?
>
> Thanks,
>
> Jean-Christian Imbeault
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so
> that your
> message can get through to the mailing list cleanly
>

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2003-07-02 00:47:58 Re: postgresql.org is unreliable
Previous Message Jean-Christian Imbeault 2003-07-02 00:47:15 Re: Duplicate key insert question