Re: plpgsql function question - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: plpgsql function question
Date
Msg-id 20070404050116.GA27391@a-kretschmer.de
Whole thread Raw
In response to plpgsql function question  (Karthikeyan Sundaram <skarthi98@hotmail.com>)
Responses Re: plpgsql function question  (John DeSoi <desoi@pgedit.com>)
List pgsql-sql
am  Tue, dem 03.04.2007, um 13:19:26 -0700 mailte Karthikeyan Sundaram folgendes:
> Thank you very much. It works.  I am not doing any insert or update hence I
> cannot create a trigger.  But my another question is
>  
> How will I pass the values to Foo parameters.
>  
> I mean
>  
>  I want to pass
>  i = 1
>  j = 'God'
>  K = now()
>  
> which all the three will be used to check in the function
> should I say
>  
> select a_func(1,'good',now());

Because your function expects one parameter of your new type, you have
to CAST your data into this type:



test=# select * from my_a((1, 'foo', current_date)::a);my_a
------   1
(1 row)


[ dumb fullquote deleted ]


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: exception handling in postgres plpgsql
Next
From: Paul Lambert
Date:
Subject: Moving a simple function to pl/pgsql (Novice question)