Re: plpgsql debugging

From: Richard Huxton <dev(at)archonet(dot)com>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plpgsql debugging
Date: 2003-09-08 15:53:53
Message-ID: 200309081653.53784.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday 08 September 2003 15:14, Andreas Pflug wrote:
>
> Looking at the code, I think that a validator could be added quite soon.
> The PLpgSQL_execstate struct could be extended by a validation_active
> bool flag, which changes the behaviour of all exec_stmt_XXX routines.
> The validator primarily executes the function, with that flag to TRUE,
> forcing all conditional statements to execute all execution paths
> exactly once, and sql statements being parsed.

Sounds good.

> Debugging is much harder.
>
> There are two levels of debugging thinkable: full-blown stepping with
> breakpoints etc while running in the backend, and the small version
> having an intelligent console which simulates a backend understanding
> plpgsql language natively, so you can test the code by executing single
> blocks of code one after another (i.e not storing the function, but
> selectively executing parts of the function definition).

Actually, a simple trace ability would be a huge step forward. It'd save me
dotting RAISE statements around my functions while I write them. Even the
ability to add DEBUG statements that checked some global flag before firing
would be very useful (to me at least).

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-09-08 16:10:27 Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean
Previous Message Tom Lane 2003-09-08 15:40:32 plpgsql doesn't coerce boolean expressions to boolean