From: | Oleg Serov <serovov(at)gmail(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #4673: pl/PgSQL: Bug, when updating changed composite types. |
Date: | 2010-02-26 14:25:47 |
Message-ID: | cec7c6df1002260625u6d1d2e6ev6475d73f09e2ec1d@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hello!? anybody will fix this bug? Hey!
On Mon, Feb 23, 2009 at 5:11 PM, Oleg <serovOv(at)gmail(dot)com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: 4673
> Logged by: Oleg
> Email address: serovOv(at)gmail(dot)com
> PostgreSQL version: 8.3.6
> Operating system: i686-redhat-linux-gnu
> Description: pl/PgSQL: Bug, when updating changed composite types.
> Details:
>
> If you added a field into composite type(table type), plpgsql won't update
> it, until you recompile function.
>
> DEMO SQL:
>
> ROLLBACK;
> BEGIN;
> CREATE TABLE bug_composite (
> column_a INT,
> column_b INT
> );
>
> CREATE TABLE bug_parent (
> id INT,
> info bug_composite
> );
>
> INSERT INTO bug_parent(id, info) VALUES (1, ROW(1, 2));
>
> CREATE OR REPLACE FUNCTION bug_update(r bug_parent) RETURNS void
> AS
> $BODY$
> BEGIN
> UPDATE bug_parent
> SET info = r.info
> WHERE id = r.id;
> END;
> $BODY$ LANGUAGE 'plpgsql' VOLATILE;
>
> SELECT bug_update(ROW(1, ROW(3, 5)));
>
> SELECT * FROM bug_parent; -- WE WILL HAVE ROW(1, ROW(3, 5));
>
> ALTER TABLE bug_composite ADD COLUMN column_c INT;
>
> SELECT * FROM bug_parent; -- WE WILL HAVE ROW(1, ROW(3, 5, NULL));
>
> SELECT bug_update(ROW(1, ROW(4, 6, 9)));
>
> SELECT * FROM bug_parent; -- WE WILL HAVE ROW(1, ROW(4, 6, NULL));
>
> SELECT version(); -- "PostgreSQL 8.3.6 on i686-redhat-linux-gnu, compiled
> by
> GCC gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)"
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>
--
С уважением
Олег Серов
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Serov | 2010-02-26 14:28:49 | Re: Bug in procedure When you modificate table |
Previous Message | David Andersen | 2010-02-26 11:41:51 | BUG #5347: initdb does not work when a data directory has been deleted |