Re: Two questions about stored procedures - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Two questions about stored procedures
Date
Msg-id 200303070543.h275hOv01569@candle.pha.pa.us
Whole thread Raw
In response to Two questions about stored procedures  ("Bruno Baguette" <bruno.baguette@netcourrier.com>)
List pgsql-general
Bruno Baguette wrote:
> First of all, I've more or less 200 procedures and I wish to store
> theses procedures inside packages (like Oracle PL/SQL packages). I see
> that feature is in the TODO list, but is this feature is currently under
> development or not ? Or is this feature is planned for a precise release
> ? (maybe 7.4 ???).

No one is working on it and there is no schedule for completion.  Patch?  :-)

> Second question : Once I've put a stored procedure, is the procedure is
> recompiled every time before the execution or is the stored procedure
> compiled one time when being recorded ? Please note that I dont make use
> of NOW() in theses stored procedure.

PL/pgSQL is compiled the first time it is run in the session.  You can
use EXECUTE if you need a query to be reparsed every time, but now() is
automatically handled properly.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: "Robert Wille"
Date:
Subject: Why are queries with subselects so slow?
Next
From: valerian
Date:
Subject: Re: index on lower(column) is very slow