From: | digoal(at)126(dot)com |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #14193: cann't modify composite array's element in plpgsql? |
Date: | 2016-06-15 09:46:03 |
Message-ID: | 20160615094603.5798.46156@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 14193
Logged by: Zhou Digoal
Email address: digoal(at)126(dot)com
PostgreSQL version: 9.5.3
Operating system: CentOS 6.x x64
Description:
postgres=# do language plpgsql $$
declare
tmp_t t[];
begin
tmp_t[1] := '(1,"test","2016-01-01")'::t;
raise notice '%', tmp_t;
tmp_t[1].info := 'new';
raise notice '%', tmp_t;
end;
$$;
ERROR: syntax error at or near "."
LINE 7: tmp_t[1].info := 'new';
^
^
Cann't grant value to tmp_t[1].info but can use it to caculate?
postgres=# do language plpgsql $$
declare
tmp_t t[];
tmp t;
begin
tmp_t[1] := '(1,"test","2016-01-01")'::t;
raise notice '%', tmp_t;
tmp := tmp_t[1];
tmp.info = 'new' || tmp_t[1].info;
tmp_t[1] := tmp;
raise notice '%', tmp_t;
end;
$$;
NOTICE: {"(1,test,\"2016-01-01 00:00:00\")"}
NOTICE: {"(1,newtest,\"2016-01-01 00:00:00\")"}
DO
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-06-15 14:16:14 | Re: BUG #14192: pg_dump/pg_restore omit setting search_path in restored db |
Previous Message | buschmann | 2016-06-15 08:27:14 | BUG #14192: pg_dump/pg_restore omit setting search_path in restored db |