Brian Hurt <bhurt(at)janestcapital(dot)com> writes:
> I'd like to do is something like (note that this does not work):
> FOR t_rec IN
> SELECT * from foo_table WHERE primary_key = old_key
> t_rec.primary_key := new_key;
> t_rec.other_column := new_value;
> INSERT INTO foo_table VALUES ( t_rec ); -- Wrong- does not work
As of PG 8.2 I think that that will work if you say "t_rec.*" in the
VALUES. As-is, it's asking the system to insert a composite datum into
the first column of the table.
regards, tom lane