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

Re: How to trap invalid enum input exception?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Leon Starr <leon_starr(at)modelint(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to trap invalid enum input exception?
Date: 2010-08-16 03:58:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Leon Starr <leon_starr(at)modelint(dot)com> writes:
> I have tried catching following with no success:
> 	SQLSTATE '22P02'
> 	SQLSTATE '22000'

> (lest we think I am completely incompetent ;), I have had success
> catching all manner of FOREIGN_KEY_VIOLATION, UNIQUE_VIOLATION, CHECK_VIOLATION, NO_DATA_FOUND, etc. in other functions.   So something is very different about this particular exception!)

> It seems to me that it is not a normal exception and evades the exception clause.  Any thoughts on where to go from here?

Hmm, maybe the error is not being thrown when/where you think it is?
Coercions of constants, in particular, happen very early and might
possibly need some contortions to catch.  Could we see an exact example
of what's not working for you?

			regards, tom lane

In response to


pgsql-novice by date

Next:From: Josh KupershmidtDate: 2010-08-16 15:50:55
Subject: Re: Listing Schemas - Revisited
Previous:From: Leon StarrDate: 2010-08-16 03:53:50
Subject: Re: How to trap invalid enum input exception?

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