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

how to process?

From: "sdeel" <sdeel(at)cox(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: how to process?
Date: 2002-09-14 04:41:49
Message-ID: 004401c25ba9$0a515c20$ (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I am new to sql processing.  I have a java connection to my database and
will be inserting to a table with a primary key, which will provide
uniquness to the rows in my table.  In java, I will be handling exceptions
and I am assuming postgresql would throw an SQLException if a user tried to
add a record with a key that already exists.

First, I want to know if that is a good assmption.  Second, and my real
question, should I gard against this by doing a select on the key and seeing
if it already exists?  Or should I just handle this as one of the exceptions
that might occur?

Please point me to reading if this is an area of discussion that I should
research further.

Thanks in advance.

Sam Deel
Everybody's got to believe in something, I believe I'll have another beer...

pgsql-novice by date

Next:From: Hubert depesz LubaczewskiDate: 2002-09-14 12:15:24
Subject: Re: pl/pgsql and returns timestamp type
Previous:From: Tom LaneDate: 2002-09-13 04:38:54
Subject: Re: Reserved words and workarounds...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group