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

Re: function exception

From: "Wright, George" <George(dot)Wright(at)infimatic(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: function exception
Date: 2008-05-06 14:52:14
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
Perfect! Thank you.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us] 
Sent: Tuesday, May 06, 2008 10:45 AM
To: Wright, George
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] function exception 

"Wright, George" <George(dot)Wright(at)infimatic(dot)com> writes:
> I would expect it to return FALSE but it returns:
> ERROR:  date/time field value out of range: "2008-05-06 00:00:95"
> Is there either a specific error code to use or is there a generic
> all code? I didn't see anything better listed at

Well, the way to debug this sort of thing is to look at the error code
number.  In psql you do it like this:

regression=# \set VERBOSITY verbose
regression=# select '2008-05-06 00:00:95'::timestamptz;
ERROR:  22008: date/time field value out of range: "2008-05-06 00:00:95"
LOCATION:  DateTimeParseError, datetime.c:3112

and then a search in the appendix for 22008 finds


			regards, tom lane

In response to

pgsql-novice by date

Next:From: Guillaume SmetDate: 2008-05-07 09:30:16
Subject: Re: [NOVICE] encoding problems
Previous:From: Tom LaneDate: 2008-05-06 14:45:11
Subject: Re: function exception

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