Greg Lindstrom <greg.lindstrom@novasyshealth.com> writes:
> What I would then like to do is:
> INSERT INTO my_table ib837;
The trick is to get it to "burst" the rowtype value into separate columns.
I don't think you could get it to do that before 8.0, but this works
as of 8.0:
regression=# \d int8_tbl
Table "public.int8_tbl"
Column | Type | Modifiers
--------+--------+-----------
q1 | bigint |
q2 | bigint |
regression=# create function foo(bigint,bigint) returns void as $$
regression$# declare myrow int8_tbl;
regression$# begin
regression$# myrow.q1 = $1;
regression$# myrow.q2 = $2;
regression$# insert into int8_tbl select (x).* from (select myrow as x) ss;
regression$# return;
regression$# end$$ language plpgsql;
CREATE FUNCTION
regards, tom lane