Mirek Rusin wrote: > ...what is the best way to force duplicated unique > or primary key'ed row inserts not to raise errors? Doesn't make sense, am I missing the point ? Regards Gaetano Mendola
>>...what is the best way to force duplicated unique >>or primary key'ed row inserts not to raise errors? Remove the columns' UNIQUE or PRIMARY KEY constraints. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
On Thu, 25 Sep 2003, Gaetano Mendola wrote: > Mirek Rusin wrote: > > > ...what is the best way to force duplicated unique > > or primary key'ed row inserts not to raise errors? > > Doesn't make sense, am I missing the point ? I think what he may want is: create table test (id serial primary key, info text unique); begin; insert into test values (DEFAULT,'abc'); INSERT 1 insert into test values (22,'def'); INSERT 1 insert into test values (22,'def'); INSERT 0 commit; In order to do this, you'll need triggers that fire on the unique / pk before insertion, and if the values would be dups, to simply drop the insert silently. Can that be done, by the way?
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера