Re: Create table if not exists ... how ?? - Mailing list pgsql-general

From Sam Mason
Subject Re: Create table if not exists ... how ??
Date
Msg-id 20100720132745.GD7584@samason.me.uk
Whole thread Raw
In response to Re: Create table if not exists ... how ??  (Jennifer Trey <jennifer.trey@gmail.com>)
List pgsql-general
On Tue, Jul 20, 2010 at 10:18:59AM +0100, Jennifer Trey wrote:
> What is the most generic exception in postgres ? Throwable in Java ?

AFAIR, from programming Java many moons ago, you really don't want to go
about catching the most general exception.  The ThreadDeath exception
for instance is derived from Error rather than Exception for this
reason.

That said, maybe you want the "magic" exception type OTHERS, i.e:

  EXCEPTION WHEN OTHERS THEN

PG doesn't have as flexible hierarchy as Java, but a match is considered
to have occurred upto the first zero in the error code.  So you could
also use syntax_error_or_access_rule_violation or transaction_rollback.

--
  Sam  http://samason.me.uk/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Oluwatope Akinniyi
Date:
Subject: I think you'll like it!
Next
From: "Gauthier, Dave"
Date:
Subject: Need a better way to do my constraints