Re: Syntax decisions for pl/pgsql RAISE extension

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Brendan Jurd" <direvus(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Syntax decisions for pl/pgsql RAISE extension
Date: 2008-05-12 18:15:18
Message-ID: 162867790805121115j40dd73a2ye577573fc2f8cc9d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/5/12 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "Brendan Jurd" <direvus(at)gmail(dot)com> writes:
>> I agree that the % formatting in the RAISE message is weird, but it is
>> useful.
>
> Sure, I'm not proposing removing it.
>
>> What would we do if the user specifies a %-formatted message as well
>> as a MESSAGE option?
>
> Throw an error (just like if they specified the same option type twice).
>
>> I like "RAISE condition_name", can we support it in conjunction with
>> the current syntax? That is:
>
>> RAISE level [condition] [string literal, [parameter, ...]] [USING
>> [option = value, ...]]
>
> Well, it's sort of a mess because level has to become optional in order
> to be Oracle-compatible (or PSM-compliant, if Kevin is correct). We
> could get away with it only if the condition were not allowed to be
> a string literal, which I guess is tolerable but it's a bit annoying.
> It would get less annoying if we allowed user-declared exception names.
> I find the Oracle syntax for those to be spectacularly awful:
>
> DECLARE
> deadlock_detected EXCEPTION;
> PRAGMA EXCEPTION_INIT(deadlock_detected, -60);
>
> but it sounds like SQL/PSM's syntax isn't so bad. I could live with
> the reported
>
> DECLARE
> condition-name CONDITION FOR SQLSTATE VALUE character-literal
>
> However, that's a separate feature and I don't want to get into it as
> part of the current patch.
>
> regards, tom lane
>

Tom, it's exactly like my patch that you rejected two years ago.

http://archives.postgresql.org/pgsql-patches/2005-07/msg00176.php

Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-05-12 18:30:20 Re: Syntax decisions for pl/pgsql RAISE extension
Previous Message Pavel Stehule 2008-05-12 18:11:19 Re: Syntax decisions for pl/pgsql RAISE extension