Re: how to call a function with row-type arg - Mailing list pgsql-sql

From Tom Lane
Subject Re: how to call a function with row-type arg
Date
Msg-id 10528.1063375074@sss.pgh.pa.us
Whole thread Raw
In response to how to call a function with row-type arg  (sad <sad@bankir.ru>)
List pgsql-sql
sad <sad@bankir.ru> writes:
>  how to call a function with a row_type arg ??

> CREATE FUNCTION foo(tablename) returns int .....
SELECT foo(tablename) FROM tablename;
orSELECT foo(tablename.*) FROM tablename;

The first is traditional Postgres usage, but I think the second makes it
more clear what's going on.

BTW, if you use a table alias then the alias is the name to refer to.
SELECT foo(x.*) FROM tablename as x;
        regards, tom lane


pgsql-sql by date:

Previous
From: "vijaykumar M"
Date:
Subject: createlang plpgsql failing on redhatlinux7.2
Next
From: Richard Huxton
Date:
Subject: Re: createlang plpgsql failing on redhatlinux7.2