Re: [HACKERS] generated columns

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Sergei Kornilov <sk(at)zsrv(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
Subject: Re: [HACKERS] generated columns
Date: 2019-01-11 15:22:11
Message-ID: CAFj8pRCnXSjxvDqDgruAbf36TEdZZHmV5=xAUbn8Pc2=wHX84A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

pá 11. 1. 2019 v 9:31 odesílatel Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> napsal:

> On 06/11/2018 13:27, Peter Eisentraut wrote:
> > This is a small bug that I will fix in my next update.
>
> Time for another update. Lot's of rebasing, many things fixed,
> including the ADD COLUMN bug you found, replication, foreign tables,
> better caching, some corner cases in trigger behavior, more
> documentation. This addresses everything I've had in my notes, so it's
> functionally and logically complete from my perspective.
>

I am looking on this patch - it is great feature.

The documentation contains paragraph

+ The generation expression can only use immutable functions and cannot
+ use subqueries or reference anything other than the current row in
any
+ way.

It is necessary for stored columns?

I tested it with pseudo constant - current_timestamp, session_user. But
current_database() is disallowed.

on second hand, this is strange

postgres=# create table foo3 (inserted text generated always as
(current_timestamp) virtual);
CREATE TABLE

Regards

Pavel

>
> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-01-11 15:32:03 Re: Acceptable/Best formatting of callbacks (for pluggable storage)
Previous Message Tom Lane 2019-01-11 15:15:20 Re: port of INSTALL file generation to XSLT