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

Re: Re: plpgsql: Debug function?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Turbo Fredriksson <turbo(at)bayour(dot)com>
Cc: Joel Burton <jburton(at)scw(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: plpgsql: Debug function?
Date: 2001-07-25 15:46:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> Is there a way to debug a PL/pgSQL function? It's behaving very
> irradic!

>     Joel> It's crude, but you can output debugging statements w/ RAISE
>     Joel> NOTICE or catch flawed assumptions by RAISE EXCEPTION.

Also try turning on query logging, so you can see in the postmaster
log the queries plpgsql is sending to the SQL engine.  This is especially
helpful for catching unexpected substitutions or lack of substitutions
of plpgsql variables, as in Morgan Curley's recent problem over in

A volunteer to improve plpgsql's debugging/tracing facilities would
be favorably received...

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Howard WilliamsDate: 2001-07-25 16:11:55
Subject: Can Postgres handle 2-phase commits ?
Previous:From: Tom LaneDate: 2001-07-25 15:38:04
Subject: Re: PostgreSQL 7.0 problem (may be bug?)

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