How to debug pl/pgSQL -script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Henriksen, Jonas F

    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

  • ra@konvergencia.hu

    #2
    Re: How to debug pl/pgSQL -script?

    Hi,


    Albert

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



    Comment

    • Alvaro Herrera

      #3
      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 YourEmailAddres sHere" to majordomo@postg resql.org)

      Comment

      Working...