Miloslav H?la <M.Hula (AT) pod (DOT) cvut.cz> wrote:
Quote:
Hi, does exist any development tool for PL/pgSQL? An environment where
debug and test stored procedeures...
Thank you
Hi. There is a commerical, timelimit shareware too, EMS SQL Manager for
Postgres.
You can run debug, set breakpoints and step line by line with watch. |
I have taken a look at that, because I wondered how a tool can offer
something that is not supported by the database server.
I found that what actually happens is that they parse and run the
stored procedures *on the client side*, issuing SQL statements against
the database as necessary.
This is impressive and frequently useful, but has the obvious limitation
that you're running a simulation and not the thing itself.
If there is a bug in PostgreSQL *or* EMS, the results may be different
and things will work in the simulation, but not in real life, or vice
versa.
Also, and more grave, PL/pgSQL changes from version to version.
You'd always need a version of EMS that matches exactly the PostgreSQL
version you are using.
I have actually run into that immediately when I tried EMS with a stored
procedure that used a statement that ran perfectly fine on PostgreSQL,
but gave me an error in the debugger.
One small example of differences between 8.1 and 8.2:
In 8.1 a FOR x IN SELECT ... loop requires x to be of a composite type,
while in 8.2 you can have a comma separated list of variables of a
simple type.
Yours,
Laurenz Albe