Skip site navigation (1) Skip section navigation (2)

plpgsql bug OR future request: Assign fileds in composite subfiled. eg. table.compositefield.subfield := TRUE;

From: "Oleg Serov" <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: plpgsql bug OR future request: Assign fileds in composite subfiled. eg. table.compositefield.subfield := TRUE;
Date: 2008-12-10 10:19:15
Message-ID: cec7c6df0812100219t5cc57ce3wba6c140fa288791a@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
SQL:
CREATE TABLE second_type (
	flag BOOLEAN
);
CREATE TABLE main_type (
	subtype second_type
);
CREATE OR REPLACE FUNCTION "bug_in_tabletypes" () RETURNS pg_catalog.void AS
$body$
DECLARE
	row_main_table main_type%rowtype;
BEGIN
	row_main_table.subtype := NULL; -- all okey;
	row_main_table.subtype.flag := FALSE; -- cannot set
END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

Will produce error:


ERROR:  syntax error at or near "row_main_table"
LINE 1: row_main_table.subtype.flag := FALSE
        ^
QUERY:  row_main_table.subtype.flag := FALSE
CONTEXT:  SQL statement in PL/PgSQL function "bug_in_tabletypes" near line

Responses

pgsql-bugs by date

Next:From: Pavel StehuleDate: 2008-12-10 10:45:19
Subject: Re: Bug in plpgsql, when using NEW with composite field value.
Previous:From: Oleg SerovDate: 2008-12-10 09:54:27
Subject: Bug in plpgsql, when using NEW with composite field value.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group