pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
Cc: ddurst@larubber.com
Subject: Re: Question about passing User defined types to functions
Date: Thu, 30 Jan 2003 16:29:08 +0100
Message-ID: <3E3944C4.7D1226BE@rodos.fzk.de> (raw)

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




view thread (3+ messages)  latest in thread

Message-ID: <3E3944C4.7D1226BE@rodos.fzk.de>
Permalink:  ../3E3944C4.7D1226BE@rodos.fzk.de/
Also on:    postgresql.org/message-id/3E3944C4.7D1226BE@rodos.fzk.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ch@rodos.fzk.de, ddurst@larubber.com
  Subject: Re: Question about passing User defined types to functions
  In-Reply-To: <3E3944C4.7D1226BE@rodos.fzk.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox