Re: [BUGS] Error in PLpgSQL with SELECT INTO and composite types

2009-03-13 Thread Tom Lane
Heikki Linnakangas writes: >SELECT '("(1)")'::btype INTO bvar; -- Should work, but errors No, because it's expecting the SELECT to yield a separate column for each column of the composite variable bvar. Something like SELECT ('("(1)")'::btype).* INTO bvar; would be correct. To make it wo

[BUGS] Error in PLpgSQL with SELECT INTO and composite types

2009-03-13 Thread Heikki Linnakangas
Tested on 8.2, 8.3 and CVS HEAD: CREATE TYPE atype AS (a int); CREATE TYPE btype AS (compcol atype); CREATE FUNCTION foofunc() RETURNS void AS $$ declare avar atype; bvar btype; begin SELECT '("(1)")'::btype INTO bvar; -- Should work, but errors end; $$ LANGUAGE plpgsql; SELECT foofunc(