Re: [HACKERS] generated columns

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] generated columns
Date: 2018-02-01 14:29:09
Message-ID: bf9c8765-1aa0-432a-442e-45f715ebe4e7@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/31/18 08:18, Michael Paquier wrote:
>> This also raises a question how a row type with generated columns should
>> behave. I think a generation expression is a property of a table, so it
>> does not apply in a row type. (Just like a default is a property of a
>> table and does not apply in row types.)
>
> Hm. Identity columns and default columns are part of rowtypes. STORED
> columns can alsobe part of a row type with little effort, so in order to
> be consistent with the all the existing behaviors, it seems to me that
> virtually-generated columns should be part of it as well. I have
> compiled in the attached SQL file how things behave with your
> patch. Only virtually-generated columns show a blank value.
>
> A empty value is unhelpful for the user, which brings a couple of
> possible approaches:
> 1) Make virtual columns part of a row type, which would make it
> consistent with all the other types.

That would be nice. I'm going to study this some more to see what can
be done.

--
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 Simon Riggs 2018-02-01 14:47:35 Re: [HACKERS] make async slave to wait for lsn to be replayed
Previous Message Peter Eisentraut 2018-02-01 14:09:34 Re: [HACKERS] Can ICU be used for a database's default sort order?