X-Original-To: pgsql-hackers@postgresql.org Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by postgresql.org (Postfix) with ESMTP id A9659476371 for ; Thu, 13 Mar 2003 21:51:04 -0500 (EST) Received: (from root@localhost) by houston.familyhealth.com.au (8.11.6/8.11.6) id h2E2p7J43701 for pgsql-hackers@postgresql.org; Fri, 14 Mar 2003 10:51:07 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from mariner (mariner.internal [192.168.0.101]) by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h2E2p5743611; Fri, 14 Mar 2003 10:51:05 +0800 (WST) Message-ID: <0d9901c2e9d4$9a3ad280$6500a8c0@fhp.internal> From: "Christopher Kings-Lynne" To: "Neil Conway" Cc: "PostgreSQL Hackers" , "Tom Lane" References: <9168.1047588660@sss.pgh.pa.us> <0cfd01c2e9cf$c16ea070$6500a8c0@fhp.internal> <1047609869.357.1856.camel@tokyo> Subject: Re: Upgrading the backend's error-message infrastructure Date: Fri, 14 Mar 2003 10:51:24 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) X-Archive-Number: 200303/595 X-Sequence-Number: 36841 > On Thu, 2003-03-13 at 21:16, Christopher Kings-Lynne wrote: > > Would it be possible to do a command line app? > > > > bash$ pg_error 1200D > > Severity: ERROR > > Message: Division by zero > > Detail: > > Hint: Modify statement to prevent zeros appearing in denominators. > > Is there any benefit to having this over just including an index of > error codes in the documentation? It's quick and easy, especially when there's thousands of error codes. Ideally, the pg_error app and the error code documentation should be automatically generated... You could have a built-in function: pg_print_error(text) returns text, then the pg_error command line program could just call that, plus the user could check up errors from within postgresql as well... Chris