How to 'print a table' in the middle of a plpgsql function

From: Leon Starr <leon_starr(at)modelint(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to 'print a table' in the middle of a plpgsql function
Date: 2011-01-29 05:59:15
Message-ID: 6149D332-A822-4F8C-A04E-1D98BF0DD916@modelint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am deep into debugging some pretty extensive plpgsql and it would be nice sometimes if I could somehow output the content of a table to the psql console at a particular point in a function.

For example, I am executing a select that is not returning the expected row. So I am wondering, what exactly was in the table at the time the query was performed.

Of course, I could just write a loop prior to my query with a bunch of raise notice statements, but I'll get a stack trace for each one. So that won't be pretty.

Suggestions? Thx.

- Leon

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mladen Gogala 2011-01-29 19:49:57 Re: How to 'print a table' in the middle of a plpgsql function
Previous Message Jasen Betts 2011-01-29 03:32:27 Re: Set default time zone for displaying dates in a session