Re: plpgsql raise - parameters can be expressions - Mailing list pgsql-patches

From Pavel Stehule
Subject Re: plpgsql raise - parameters can be expressions
Date
Msg-id Pine.LNX.4.44.0506130837190.17363-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Re: plpgsql raise - parameters can be expressions  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
> I don't see an easy way to get around this, though, and it's not too
> concerning. Amusingly it does completely break the SQLSTATE and SQLERRM
> tests we added a few days ago :)

Yes, it's true. But with simple plpgsql parser isn't possible expect
miracles :). I think so there is some space for modifications -
read_sql_construct - add control for availability sql params. You can
solve all errors where is expr_until_semi.

This is exactly same situation like

create function ...
begin
  execute 'select '||a;
end; $$

it generate runtime error

>
> BTW, another easy improvement in this area is changing the RAISE format
> string to allow it to be an expression, rather than only a string literal.
>

No problem. But it's maybe big change. And I don't see using format string
too much limiting.

Pavel




pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: psql: make \x affect normal queries only
Next
From: Neil Conway
Date:
Subject: Re: plpgsql raise - parameters can be expressions