Re: Duplicate key insert question
От | Dann Corbit |
---|---|
Тема | Re: Duplicate key insert question |
Дата | |
Msg-id | D90A5A6C612A39408103E6ECDD77B8294CDE4D@voyager.corporate.connx.com обсуждение исходный текст |
Ответ на | Duplicate key insert question (Jean-Christian Imbeault <jc@mega-bucks.co.jp>) |
Список | pgsql-general |
> -----Original Message----- > From: Maksim Likharev [mailto:mlikharev@aurigin.com] > Sent: Tuesday, July 01, 2003 5:40 PM > To: Jean-Christian Imbeault; Dann Corbit > Cc: pgsql-general@postgresql.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@mega-bucks.co.jp] > Sent: Tuesday, July 01, 2003 5:21 PM > To: Dann Corbit > Cc: pgsql-general@postgresql.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@postgresql.org so > that your > message can get through to the mailing list cleanly >
В списке pgsql-general по дате отправления: