Today, in a message to Joachim Achtzehnter, Ed Loehr wrote:
>
> More efficient, yes. However, given the lack of "statement-only"
> aborts and the state of pg error codes (all strings, no numeric
> codes), the programmatic/query check appears not only compulsory but
> simpler code-wise.
Given current limitations of the postgresql implementation, you are
certainly right: there is no other choice. I was merely countering the
suggestion that there was something wrong with the approach of simply
trying the insert first. It is a perfectly valid approach when used with
an SQL92 compliant database. We just have to live without it until
postgresql improves on this point. This is certainly not a show stopper
for most of us unless perhaps when somebody has to port a ton of code from
another database :-(
Joachim
--
private: joachim@kraut.bc.ca (http://www.kraut.bc.ca)
work: joachim@mercury.bc.ca (http://www.mercury.bc.ca)