Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Efficient Insert statement for one record into multiple



If you create the key using nextval you will never get duplicate key exceptions.

However, you should never close connections in the catch clause. Always close connections in a finally clause.

Dave
On 19-Dec-06, at 5:18 AM, Peter Neu wrote:

Hello,

the insertion within the same connection objects works just fine. ;o)
One thing which still keeps me thinking is how should I handle duplicate key exceptions when it happens in the first insert? Should I just close the connection object in the catch clause when this happens in the first statement so the second statement hits an AlreadyClosedConnectionException?

Cheers,
Pete



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
       message can get through to the mailing list cleanly





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group