Re: [HACKERS] generated columns

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
Subject: Re: [HACKERS] generated columns
Date: 2018-10-30 15:14:00
Message-ID: 28574501540912440@iva5-750e13568e4d.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I applied this patch on top 2fe42baf7c1ad96b5f9eb898161e258315298351 commit and found a bug while adding STORED column:

postgres=# create table test(i int);
CREATE TABLE
postgres=# insert into test values (1),(2);
INSERT 0 2
postgres=# alter table test add column gen_stored integer GENERATED ALWAYS AS ((i * 2)) STORED;
ALTER TABLE
postgres=# alter table test add column gen_virt integer GENERATED ALWAYS AS ((i * 2));
ALTER TABLE
postgres=# table test;
i | gen_stored | gen_virt
---+------------+----------
1 | | 2
2 | | 4

Virtual columns was calculated on table read and its ok, but stored column does not update table data.

regards, Sergei

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-10-30 15:29:17 Re: Getting fancy errors when accessing information_schema on 10.5
Previous Message Axel Rau 2018-10-30 15:12:32 Re: Getting fancy errors when accessing information_schema on 10.5