Re: Record type and ROW type in pl/pgsql functions - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Record type and ROW type in pl/pgsql functions
Date
Msg-id 7946.1082464937@sss.pgh.pa.us
Whole thread Raw
In response to Record type and ROW type in pl/pgsql functions  (dinar@yantel.ru)
List pgsql-bugs
dinar@yantel.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

pgsql-bugs by date:

Previous
From: dinar@yantel.ru
Date:
Subject: Record type and ROW type in pl/pgsql functions
Next
From: Theo Kramer
Date:
Subject: PQexecPrepared - PostgreSQL 7.4.1