469,106 Members | 2,040 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,106 developers. It's quick & easy.

How to debug pl/pgSQL -script?

Hi,
I'm writing some simple triggers and functions for a postgres database, andI'm wondering how to go about to debug a pl/pgSQL-script. Is there a way to echo variable-content to screen, or to file? Or is there other, more advanced ways of debugging such scripts?

regards Jonas:))

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
2 14768
ra
Hi,
http://www.postgresql.org/docs/7.4/s...-messages.html

Albert

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2
On Fri, Oct 01, 2004 at 03:05:14PM +0200, Henriksen, Jonas F wrote:
I'm writing some simple triggers and functions for a postgres
database, and I'm wondering how to go about to debug a
pl/pgSQL-script. Is there a way to echo variable-content to screen, or
to file? Or is there other, more advanced ways of debugging such
scripts?


Yes, use RAISE NOTICE. See the docs -- it takes a string which can have
% in them, like printf %-escapes but without the modifiers.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Postgres is bloatware by design: it was built to house
PhD theses." (Joey Hellerstein, SIGMOD annual conference 2002)
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jozsef Bekes | last post: by
1 post views Thread by Loading name... | last post: by
2 posts views Thread by Dinh Bao Tuyen | last post: by
5 posts views Thread by =?Utf-8?B?SmltIFJvZGdlcnM=?= | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.