X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 857F39DD6D4 for ; Thu, 1 Dec 2005 18:48:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31352-03 for ; Thu, 1 Dec 2005 18:48:09 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail1.utiba.com (eth2643.vic.adsl.internode.on.net [150.101.158.82]) by postgresql.org (Postfix) with ESMTP id 88FF89DCAB5 for ; Thu, 1 Dec 2005 18:48:09 -0400 (AST) Received: from support.utiba.com (support.utiba.melb [192.168.1.11]) by mail1.utiba.com (Postfix) with ESMTP id 6DED013ECD2; Fri, 2 Dec 2005 09:48:07 +1100 (EST) Received: from 192.168.0.49 (SquirrelMail authenticated user philip) by support.utiba.melb with HTTP; Fri, 2 Dec 2005 09:51:34 +1100 (EST) Message-ID: <49275.192.168.0.49.1133477494.squirrel@support.utiba.melb> In-Reply-To: <17026.1133470623@sss.pgh.pa.us> References: <200512012048.jB1Kmg624757@candle.pha.pa.us> <17026.1133470623@sss.pgh.pa.us> Date: Fri, 2 Dec 2005 09:51:34 +1100 (EST) Subject: Re: Table A-1. PostgreSQL Error Codes (WITH constants) From: philip@utiba.com To: "Tom Lane" Cc: "Bruce Momjian" , kdio@uenf.br, pgsql-docs@postgresql.org User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Utiba-MailScanner-Information: Please contact the Systems Administrator at Utiba for more information X-Utiba-MailScanner: Found to be clean Utiba-MailScanner-MCPCheck: X-MailScanner-From: philip@utiba.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] X-Spam-Score: 0.55 X-Spam-Level: X-Archive-Number: 200512/4 X-Sequence-Number: 3352 > 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.