Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 12DF0476198 for ; Thu, 30 Jan 2003 10:29:07 -0500 (EST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id DA4CC476130 for ; Thu, 30 Jan 2003 10:29:05 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Thu Jan 30 16:29:09 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id QAA05942; Thu, 30 Jan 2003 16:29:08 +0100 (MET) Message-ID: <3E3944C4.7D1226BE@rodos.fzk.de> Date: Thu, 30 Jan 2003 16:29:08 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: ddurst@larubber.com Subject: Re: Question about passing User defined types to functions Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/504 X-Sequence-Number: 11369 > > CREATE TYPE dumby_type AS (dumby_id int4, dumby_name text); > > create function kick_dumby(dumby dumby_type) returns INTEGER AS ' > DECLARE > somenumber integer; > BEGIN > return 1; > END; > ' language 'plpgsql'; > > > Is there some way of doing this, because the above doesn't work. > After having a look into the documentation on CREATE TYPE I would say the statement looks very wrong. But I haven't done any user defined type so far, so I can't be of any help in this case. The CREATE FUNCTION statement is not considered to accept parameter names within the parameter list. So use create function kick_dumby(dumby_type) returns INTEGER AS ' DECLARE dumby ALIAS FOR $1; ... Regards, Christoph