Bruce Momjian wrote:
Can I ask where we are on this?
Sure - posted a follow up to the list a while ago. Subject was
RAISE level expr params: state of play and request for advice
Currently, this works:
CREATE FUNCTION foo_raise_loop(text) RETURNS text AS '
DECLARE
a ALIAS FOR $1;
i
Richard Huxton [EMAIL PROTECTED] writes:
Actually, I like the idea of using the SQL system to evaluate expressions -
why reinvent the wheel?
Sure, that part is great --- it's just the parsing (or lack of it,
to be more accurate) that's an ugly hack.
regards, tom lane
Tom Lane wrote:
and then the code takes care of swallowing expressions until ';',
similarly to the way SQL commands are handled. (plpgsql's parsing
methodology is sinfully ugly, isn't it? But I don't suppose you
want to try to replace it...)
It is, indeed, and I'm sorry for that.
From: Jan Wieck [EMAIL PROTECTED]
Tom Lane wrote:
and then the code takes care of swallowing expressions until ';',
similarly to the way SQL commands are handled. (plpgsql's parsing
methodology is sinfully ugly, isn't it? But I don't suppose you
want to try to replace it...)
It
Muggins here volunteered to get RAISE to accept any expression that
evaluates to a string rather than just a string constant. Think I can see
why it wasn't that way already.
Had a look, and this is easy enough:
RAISE NOTICE ''Hello '' || $1 || '' World'';
Also, I can do:
RAISE NOTICE ''Hello
Richard Huxton [EMAIL PROTECTED] writes:
(For those who haven't looked at that bit of the code recently
plpgsql_read_expression() slurps up to and including a closing token -
either a ';' or ',' above. You've then lost that finishing token)
The real problem is that this *isn't* yacc ... if