pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rainer Leo <leo@workfile.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: error code invalid_input_syntax
Date: Thu, 12 Jan 2006 11:05:49 -0500
Message-ID: <5380.1137081949@sss.pgh.pa.us> (raw)
In-Reply-To: <loom.20060112T094211-926@post.gmane.org>
References: <loom.20060112T094211-926@post.gmane.org>

Rainer Leo <leo@workfile.de> writes:
> Now I want to catch
> ERROR:  invalid input syntax for integer: "i"
> but although I tried quite a few I can't find the right
> error code for this exception.

Crank up the error reporting verbosity.  For instance, in psql

regression=# select 'i'::integer;
ERROR:  invalid input syntax for integer: "i"
regression=# \set VERBOSITY verbose
regression=# select 'i'::integer;
ERROR:  22P02: invalid input syntax for integer: "i"
LOCATION:  pg_atoi, numutils.c:84
regression=#

A look in Appendix A of the manual shows that 22P02 is
INVALID TEXT REPRESENTATION

			regards, tom lane



view thread (2+ messages)

Message-ID: <5380.1137081949@sss.pgh.pa.us>
Permalink:  ../5380.1137081949@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5380.1137081949@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, leo@workfile.de
  Subject: Re: error code invalid_input_syntax
  In-Reply-To: <5380.1137081949@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox