BUG #5314: Error in nested composite types in plpgsql. - Mailing list pgsql-bugs

From Oleg
Subject BUG #5314: Error in nested composite types in plpgsql.
Date
Msg-id 201002041613.o14GDYZQ051230@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5314: Error in nested composite types in plpgsql.
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5314
Logged by:          Oleg
Email address:      serovov@gmail.com
PostgreSQL version: 8.3/8.4
Operating system:   any
Description:        Error in nested composite types in plpgsql.
Details:

Here is it reproduce code:
It works only, when procedure is plpgsql, with sql works fine.

ROLLBACK;
BEGIN;
CREATE TABLE bug_level_tree(
    field BIGINT
);
CREATE TABLE bug_level_two(
    field bug_level_tree
);
CREATE TABLE bug_level_one(
    id BIGINT,
    field bug_level_two
);
CREATE FUNCTION bug_procedure(in_row bug_level_one) RETURNS text AS $$
BEGIN
    -- void
    SELECT 1/0;
END;
$$ LANGUAGE plpgsql;

-- All okey
SELECT '(1,)'::bug_level_one;

-- Throws error
SELECT bug_procedure('(1,)');

-- ERROR:  cannot assign non-composite value to a row variable
CONTEXT:  PL/pgSQL function "bug_procedure" while storing call arguments
into local variables

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #5312: I NEED HELP
Next
From: Joe Conway
Date:
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server