From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> |
Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Sergei Kornilov <sk(at)zsrv(dot)org>, Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com> |
Subject: | Re: [HACKERS] generated columns |
Date: | 2019-03-18 14:14:09 |
Message-ID: | CAFj8pRApJQfre4zpAx+PR0KHazqzgJDEB=hG9hmdzt16xoaprw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi
po 18. 3. 2019 v 8:35 odesílatel Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> napsal:
> Here is an updated patch with just the "stored" functionality, as
> discussed.
>
> The actual functionality is much smaller now, contained in the executor.
> Everything else is mostly DDL support, trigger handling, and some
> frontend stuff.
>
probably I found a bug
create table foo(id int, name text);
insert into foo values(1, 'aaa');
alter table foo add column name_upper text generated always as
(upper(name)) stored;
update foo set name = 'bbb' where id = 1; -- ok
alter table foo drop column name_upper;
update foo set name = 'bbbx' where id = 1; -- ok
alter table foo add column name_upper text generated always as
(upper(name)) stored;
update foo set name = 'bbbxx' where id = 1; -- error
postgres=# update foo set name = 'bbbxx' where id = 1; -- error
ERROR: no generation expression found for column number 3 of table "foo"
Regards
Pavel
> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2019-03-18 14:34:46 | Re: Compressed TOAST Slicing |
Previous Message | Tom Lane | 2019-03-18 14:13:46 | Re: Compressed TOAST Slicing |