Re: plpgsql function question - Mailing list pgsql-sql

From John DeSoi
Subject Re: plpgsql function question
Date
Msg-id F345B309-CEDD-43E1-8D2A-A978AE22FE31@pgedit.com
Whole thread Raw
In response to Re: plpgsql function question  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List pgsql-sql
If you use a plpgsql function to select the row you want to validate,  
it will make life much easier. Something like

...
$$
declare  my_row a_row_type;  is_ok integer;
begin  select into my_row * from a_row_type where ....  is_ok := my_a_validate(my_row);  return is_ok;
$$
...

On Apr 4, 2007, at 1:01 AM, A. Kretschmer wrote:

> 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)



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL



pgsql-sql by date:

Previous
From:
Date:
Subject: CPU statistics
Next
From:
Date:
Subject: Setting high performance on huge server