pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedUsing rowtype as function argument
2+ messages / 2 participants
[nested] [flat]
* Using rowtype as function argument
@ 2003-08-06 09:23 Martin Brommer <martin@brommer.nl>
2003-08-06 14:40 ` Re: Using rowtype as function argument Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Martin Brommer @ 2003-08-06 09:23 UTC (permalink / raw)
To: pgsql-sql
Hi all,
I suppose this must be easy to figure out, but I can't find it anywhere in
the documentation.
How do I call a function that takes a rowtype for an argument as in:
CREATE FUNCTION myfunc(mytablename) RETURNS INT AS '
BEGIN
-- Do stuff
RETURN val;
END;
' LANGUAGE 'plpgsql'
How do I call this function? I haven't been able to figure it out or find
it anywhere...
Thanks in advance,
Martin
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Using rowtype as function argument
2003-08-06 09:23 Using rowtype as function argument Martin Brommer <martin@brommer.nl>
@ 2003-08-06 14:40 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2003-08-06 14:40 UTC (permalink / raw)
To: Martin Brommer <martin@brommer.nl>; +Cc: pgsql-sql
Martin Brommer <martin@brommer.nl> writes:
> How do I call a function that takes a rowtype for an argument as in:
> CREATE FUNCTION myfunc(mytablename) RETURNS INT AS '
SELECT myfunc(mytablename.*) FROM mytablename;
This also works at the moment, but seems less clear to me:
SELECT myfunc(mytablename) FROM mytablename;
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-08-06 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-08-06 09:23 Using rowtype as function argument Martin Brommer <martin@brommer.nl>
2003-08-06 14:40 ` Tom Lane <tgl@sss.pgh.pa.us>
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