sqlstate 22P06 is a warning in an error's clothing

From: Abhijit Menon-Sen <ams(at)oryx(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: sqlstate 22P06 is a warning in an error's clothing
Date: 2007-11-10 13:22:47
Message-ID: 20071110132247.GA29577@toroid.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The server logs "WARNING: nonstandard use of \\ in a string literal at
character 44", but the message comes with sqlstate code 22P06, which is
in an error class ("Data exception"). So my application thinks it's an
error, and is unhappy.

Since the sqlstate code is the only useful machine-readable field in the
error message, it is rather unfortunate for it to not reflect the actual
failure status.

Of course, I can special-case code 22P06 in my code and treat it as a
warning (which is what I'll have to do anyway, for 8.2 compatibility),
but I think:

- the warning should be assigned a different code in the 01 class.
- The 22P06 code should be "retired", i.e. not reassigned to a real
error in future (because then any bug workaround similar to mine
would break).

Thoughts?

-- ams

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Glaesemann 2007-11-10 13:41:49 Re: minimal update
Previous Message rcolmegna@tiscali.it 2007-11-10 07:47:46 data access automatic filter