Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B21129FBAB9 for ; Tue, 3 Apr 2007 17:27:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 99975-01 for ; Tue, 3 Apr 2007 17:27:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from a2s5.a2hosting.com (a2s5.a2hosting.com [209.124.50.10]) by postgresql.org (Postfix) with ESMTP id 138139FBA97 for ; Tue, 3 Apr 2007 17:27:25 -0300 (ADT) Received: from adsl-153-116-39.tys.bellsouth.net ([70.153.116.39] helo=[192.168.1.12]) by a2s5.a2hosting.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1HYpb7-0008P5-67; Tue, 03 Apr 2007 16:27:21 -0400 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Andreas Kretschmer , Content-Transfer-Encoding: 7bit From: John DeSoi Subject: Re: plpgsql function question Date: Tue, 3 Apr 2007 16:27:16 -0400 To: Karthikeyan Sundaram X-Mailer: Apple Mail (2.752.3) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a2s5.a2hosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pgedit.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/44 X-Sequence-Number: 28044 It should work pretty much like you have it. You don't need a type; the table is already a type. Something like: create or replace function a_func (in p_row a) returns int as $$ if p_row.i ... if p_row.j ... $$ If it does not work, show the error and I'll try to dig up an example. John On Apr 3, 2007, at 2:33 PM, Karthikeyan Sundaram wrote: > What I want is something like this > create or replace functinon a_func (in a%rowtype) returns int as > $$ > ---- do the validation > $$ > language 'plpgsql'; > > execute a_func(1, 'good','04/02/2007'); John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL