Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 02:22 AM
Henriksen, Jonas F
Guest
 
Posts: n/a
Default 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

  #2  
Old November 23rd, 2005, 02:22 AM
ra@konvergencia.hu
Guest
 
Posts: n/a
Default Re: How to debug pl/pgSQL -script?

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

  #3  
Old November 23rd, 2005, 02:22 AM
Alvaro Herrera
Guest
 
Posts: n/a
Default Re: How to debug pl/pgSQL -script?

On Fri, Oct 01, 2004 at 03:05:14PM +0200, Henriksen, Jonas F wrote:
[color=blue]
> 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?[/color]

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 majordomo@postgresql.org)

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles