Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Insert with pos...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3097 of 3160
Post > Topic >>

Insert with possible constraint violations?

by gentosaker@[EMAIL PROTECTED] ("A B") Apr 29, 2008 at 09:56 AM

Hello.
What is the proper way of inserting stuff into a table with two fields
(A and B) with a  constraint unique(A,B) and you suspect you will get
some unique constraint violations?
Should I just do INSERT etc...  and just ignore the answer?
Or do a select first and see if it returned any record?
Or is there a way of way to write a function that do the INSERT but
catches the error and do not write anything to the log about the
violation? In that case, what would such a function look like?
To me it seems that writing error messages  to log files  is not very
efficient.
So what would you suggest me doing?

-- 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice




 2 Posts in Topic:
Insert with possible constraint violations?
gentosaker@[EMAIL PROTECT  2008-04-29 09:56:21 
Re: Insert with possible constraint violations?
gentosaker@[EMAIL PROTECT  2008-04-30 08:45:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 9:43:45 CDT 2008.