Alvaro Herrera wrote:
>
> No, only the "second" one will fail (though it's difficult which one is
> the second)
From:
http://marc.theaimsgroup.com/?l=postgresql-general&m=105656988915991&w=2
Ian Barwick wrote:
[...]
I proposed that same solution 3 years ago. Tom shoots it down:
[...]
I couldn't get the link to work so I couldn't read why Tom shot it down.
But if Tom shot down this idea down ... then it mustn't be correct.
>>If I followed all the arguments correctly according to the thread there
>>is *no* way to do what I (and you ;) want in one simple query.
>
>
> No, there's not.
You say no, but at first you say that the proposed method works. The
proposed method, if it is correct, is simple enough for me. By simple I
mean all can be done with one query.
> You should check the returned value from the insertion
> function to see if it succeeded or not.
No, what I want if to have one query that will *always* insert if there
is no record with this primary key and *always* do nothing (not fail,
not generate an error) if there is already a record with this primary
key. I don't want to check return values :)
Thanks,
Jean-Christian Imbeault
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster