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

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

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: Leon Starr <leon_starr(at)modelint(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to 'print a table' in the middle of a plpgsql function
Date: 2011-01-29 19:49:57
Message-ID: 4D446F65.90107@vmsinfo.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 1/29/2011 12:59 AM, Leon Starr wrote:
> 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.
Raise notice is PLPGSQL equivalent of DBMS_OUTPUT.PUT_LINE.

-- 
Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
www.vmsinfo.com


In response to

Responses

pgsql-novice by date

Next:From: ashima athriDate: 2011-01-30 03:55:42
Subject: Fwd: How to 'print a table' in the middle of a plpgsql function
Previous:From: Leon StarrDate: 2011-01-29 05:59:15
Subject: How to 'print a table' in the middle of a plpgsql function

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