Error in PLpgSQL with SELECT INTO and composite types

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Error in PLpgSQL with SELECT INTO and composite types
Date: 2009-03-13 20:44:54
Message-ID: 49BAC5C6.3040802@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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();

Gives error:

ERROR: invalid input syntax for integer: "(1)"
CONTEXT: PL/pgSQL function "foofunc" line 6 at SQL statement

Surely assigning a value of btype to a variable of the same type should
always work..

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Roman Kononov 2009-03-13 21:41:02 BUG #4702: refusal to compute date_trunc('week', '0001-12-09 BC');
Previous Message Heikki Linnakangas 2009-03-13 19:31:03 Re: Subbestions: 1) Query timeout 2) Session kill by same login