X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id F2EA1D1B528 for ; Fri, 12 Sep 2003 13:58:09 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 85914-03 for ; Fri, 12 Sep 2003 10:58:02 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 9DCEAD1B4E5 for ; Fri, 12 Sep 2003 10:57:58 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h8CDvtAn010529; Fri, 12 Sep 2003 09:57:55 -0400 (EDT) To: sad Cc: pgsql-sql@postgresql.org Subject: Re: how to call a function with row-type arg In-reply-to: <200309120931.13760.sad@bankir.ru> References: <200309120931.13760.sad@bankir.ru> Comments: In-reply-to sad message dated "Fri, 12 Sep 2003 09:31:13 +0400" Date: Fri, 12 Sep 2003 09:57:54 -0400 Message-ID: <10528.1063375074@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/98 X-Sequence-Number: 15076 sad writes: > how to call a function with a row_type arg ?? > CREATE FUNCTION foo(tablename) returns int ..... SELECT foo(tablename) FROM tablename; or SELECT 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