Andrew McMillan <[EMAIL PROTECTED]> writes:
> ... I can't supply either %ROWTYPE or %TYPE within the parameter
> definition without an error either.

Looks like I was mistaken: table.field%type works, but table%type
does not:

test72=# create table foo (f1 int, f2 text);
CREATE
test72=# create function foo(foo.f1%type) returns int as 'select $1'
test72-# language sql;
NOTICE:  foo.f1%TYPE converted to int4
CREATE
test72=# create function foo(foo%type) returns text as 'select $1.f2'
test72-# language sql;
ERROR:  parser: parse error at or near "%"

So you must do it as:

test72=# create function foo(foo) returns text as 'select $1.f2'
test72-# language sql;
CREATE

> Is it a good idea to provide an example (such as the above), or should I
> just try and describe the behaviour?

Examples are generally good things ...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to