X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BD74C52809 for ; Wed, 6 Jul 2005 22:00:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20322-09 for ; Thu, 7 Jul 2005 01:00:36 +0000 (GMT) Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by svr1.postgresql.org (Postfix) with ESMTP id 6287B529B4 for ; Wed, 6 Jul 2005 22:00:35 -0300 (ADT) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id C51199B4C4; Wed, 6 Jul 2005 21:00:39 -0400 (EDT) Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id 73094-01-3; Wed, 6 Jul 2005 21:00:38 -0400 (EDT) Received: from [61.88.101.19] (unknown [61.88.101.19]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailbox.samurai.com (Postfix) with ESMTP id 1059C9B4C7; Wed, 6 Jul 2005 21:00:36 -0400 (EDT) Message-ID: <42CC7EB4.5090201@samurai.com> Date: Thu, 07 Jul 2005 11:00:36 +1000 From: Neil Conway User-Agent: Debian Thunderbird 1.0.2 (X11/20050602) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Pavel Stehule , pgsql-patches@postgresql.org Subject: Re: User's exception plpgsql References: <42CBF6AD.9080600@samurai.com> <26946.1120665361@sss.pgh.pa.us> <42CC0260.4090407@samurai.com> <28184.1120669779@sss.pgh.pa.us> In-Reply-To: <28184.1120669779@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.016 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/194 X-Sequence-Number: 16534 Tom Lane wrote: > RAISE NOTICE '12' !! '345', ... > > Is !! an infix operator (using both strings as arguments) or a postfix > operator (in which case '345' is the format)? Ah, I see. I would be content to allow opt_sqlstate to be either a string literal, a T_WORD (predefined error condition), or a TEXT variable. If users need to throw a sqlstate that is derived from a SQL expression, they can always assign to a TEXT variable and then specify that variable to RAISE. >> RAISE [ opt_sqlstate ] LEVEL 'fmt' [ , expr ... ] This syntax might be slightly better anyway, as allowing two string literals without any intervening tokens is a bit ugly. We would still need to restrict opt_sqlstate as described above, though. -Neil