Re: [HACKERS] generated columns - Mailing list pgsql-hackers

From Serge Rielau
Subject Re: [HACKERS] generated columns
Date
Msg-id BFDFB10B-27E1-4427-B304-EEDC47578327@rielau.com
Whole thread Raw
In response to Re: [HACKERS] generated columns  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
List pgsql-hackers

On Sep 12, 2017, at 12:35 PM, Jaime Casanova <jaime.casanova@2ndquadrant.com> wrote:

also is interesting that in triggers, both before and after, the
column has a null. that seems reasonable in a before trigger but not
in an after trigger
Why is a NULL reasonable for before triggers?
If I create a table with a column with default and I omit that column on INSERT
Is the column value also NULL in the before trigger? (I hope not)

BTW, the original idea behind generated columns was to materialize them.
Reason being to avoid expensive computations of frequently used expressions 
(and to support indexing in the absence of indexes with expressions)
 
You may find the following amusing:

Cheers
Serge Rielau


pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Next
From: Chapman Flack
Date:
Subject: Re: [HACKERS] Faster methods for getting SPI results