public inbox for [email protected]  
help / color / mirror / Atom feed
From: [email protected]
To: Tom Lane <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: Table A-1. PostgreSQL Error Codes (WITH constants)
Date: Fri, 2 Dec 2005 09:51:34 +1100 (EST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

> What exactly is the point of the change at all?

Take a typical line in the table:

Error Code | Meaning
23502      | NOT NULL VIOLATION

Now assume I want to catch this exception in a plpgsql function:

CREATE OR REPLACE FUNCTION foo()
/* boilerplate omitted */

EXCEPTION
    WHEN NOT_NULL_VIOLATION THEN
       RAISE WARNING 'Crikey!';
    WHEN OTHERS THEN
       RAISE NOTICE 'Oh well, [%,%]', SQLSTATE, SQLERRM;

Making the "Meaning" column almost-usable as the exception name is
frustrating. This patch would allow people writing functions to copy and
paste the exception names directly.

It's not a big deal, but it would save some re-typing for people writing a
lot of functions (me, for example).



-----------------
Utiba Pty Ltd 
This message has been scanned for viruses and
dangerous content by Utiba mail server and is 
believed to be clean.




view thread (7+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Table A-1. PostgreSQL Error Codes (WITH constants)
  In-Reply-To: <[email protected]>

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

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