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

Search Discussions

  • Pavel Stehule at Dec 10, 2008 at 10:48 am
    Hello

    2008/12/10 Oleg Serov <serovov@gmail.com>:
    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
    try
    (row_main_table.subtype).flag := FALSE; -- cannot set

    regards
    Pavel Stehule
    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

    --
    Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgsql-bugs
  • Oleg Serov at Dec 10, 2008 at 12:48 pm
    ERROR: syntax error at or near "("
    LINE 15: (row_main_table.subtype).flag := FALSE; -- cannot set
    ^

    ********** Ошибка **********

    ERROR: syntax error at or near "("
    SQL state: 42601
    Характеристика:321

    2008/12/10 Pavel Stehule <pavel.stehule@gmail.com>:
    Hello

    2008/12/10 Oleg Serov <serovov@gmail.com>:
    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
    try
    (row_main_table.subtype).flag := FALSE; -- cannot set

    regards
    Pavel Stehule
    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

    --
    Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgsql-bugs

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-bugs @
categoriespostgresql
postedDec 10, '08 at 10:19a
activeDec 10, '08 at 12:48p
posts3
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Oleg Serov: 2 posts Pavel Stehule: 1 post

People

Translate

site design / logo © 2021 Grokbase