Re: Record type and ROW type in pl/pgsql functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dinar(at)yantel(dot)ru
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Record type and ROW type in pl/pgsql functions
Date: 2004-04-20 12:42:17
Message-ID: 7946.1082464937@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

dinar(at)yantel(dot)ru writes:
> declare
> hosts_str mail_relayhosts%ROWTYPE;
> ...
> FOR hosts_str IN SELECT hosts from mail_relayhosts LOOP

You would need SELECT * FROM here, if you're selecting the whole row.
This is going to try to stuff "hosts" into the first column of the
rowtype variable, which is the wrong datatype. (I think it would then
complain about too few columns supplied, but it's not getting that far.)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Theo Kramer 2004-04-20 15:45:41 PQexecPrepared - PostgreSQL 7.4.1
Previous Message dinar 2004-04-20 04:55:38 Record type and ROW type in pl/pgsql functions