Of course having the ability to execute arbitrary plpgsql in .sql
scripts would be handy in some cases as well, though as others pointed
out there are alternatives.

I don't know if it's possible. PL/pgSQL parser live in different context than SQL parser and PostgreSQL supports more languages than one. These needs different syntax, maybe:

EXECUTE CODE (integer, integer) RETURNS integer AS $$
DECLARE c integer = 10;
BEGIN
 RETURN $1 + $2 + c;
END;
$$ LANGUAGE plppgsql USING(10,20);

we can use plplgsql compiler, and only use different memory context. It's maybe better solution than temp functions.

Regards
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to