Re: printing variable values in pl/pgsql functions

From: "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com>
To: "Harpreet Dhaliwal" <harpreet(dot)dhaliwal01(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: printing variable values in pl/pgsql functions
Date: 2007-05-09 01:12:23
Message-ID: a47902760705081812r1cee5824v3ad1e193d20bd58f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

you can use
RAISE NOTICE 'i want to print % and %', var1,var2;

then run your function and click the MESSAGE tab at the bottom of your query
analyzer screen and you'll see sometime like

NOTICE: i want to print <value of var 1> and <value of var2

you can use any number of RAISE NOTICE statements as you want and they will
be printed in order under messages.

I hope this helps
~Jas

On 5/8/07, Harpreet Dhaliwal <harpreet(dot)dhaliwal01(at)gmail(dot)com> wrote:
>
>
>
> Hi,
>
> I have a pl/pgsql in which i have to print various variable values during
> the execution of the function to see
> what values are getting populated inside those variables with due course
> of time.
>
> PRINT <variable name>
> doesn't work.
>
> Can anyone tell me how to print these values??
>
>
> Thanks,
> ~Harpreet
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin Gainty 2007-05-09 01:18:01 Re: printing variable values in pl/pgsql functions
Previous Message Harpreet Dhaliwal 2007-05-09 01:10:11 printing variable values in pl/pgsql functions