Skip site navigation (1) Skip section navigation (2)

Re: Oracle PL/SQL Anonymous block equivalent in postgres

From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: jnasby(at)pervasive(dot)com, pgman(at)candle(dot)pha(dot)pa(dot)us
Cc: hannu(at)skype(dot)net, Ashok(dot)Agrawal(at)Sun(dot)COM, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Oracle PL/SQL Anonymous block equivalent in postgres
Date: 2005-12-27 21:44:25
Message-ID: BAY20-F181BA7E63C93ED9E8F901DF9370@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-hackers
>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/


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-12-27 22:22:56
Subject: Re: Possible savepoint bug
Previous:From: Tom LaneDate: 2005-12-27 20:51:29
Subject: Re: Possible savepoint bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group