Re: conditional insert - Mailing list pgsql-general

From Sim Zacks
Subject Re: conditional insert
Date
Msg-id 4E64A444.5070604@compulab.co.il
Whole thread Raw
In response to conditional insert  (Pau Marc Muñoz Torres <paumarc@gmail.com>)
List pgsql-general
On 09/05/2011 12:38 PM, Pau Marc Muñoz Torres wrote: <blockquote
cite="mid:CADFuJLjCF6fmxswgS033EFyofmbJFy+J0ToUvwTCDDLYj+nr3Q@mail.gmail.com"type="cite">Hi follk<br /><br />  i
trying to performe a  conditional insert into a table, indeed, what i'm trying to do is not insert a record into the
tableif that record exist<br /><br /> googleling i found something like<br /><br />  insert into XX values (1,2,3)
wherenot exist (select ....);<br /><br /> but i'm having and error near where...<br /><br /> anyone knows how do i can
perfomethis insert?<br /><br /> thanks<br /><br /> p<br /></blockquote><p>You can either do an Insert(...) select...
from...where...<p>oryou can add a rule to the table that checks if the key exists and if so, do an update or nothing
instead.<br/> 

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: conditional insert
Next
From: Pau Marc Muñoz Torres
Date:
Subject: Re: conditional insert