pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Jaime Casanova <jaime.casanova@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Re: [HACKERS] generated columns
Date: Sat, 30 Dec 2017 13:04:52 -0800
Message-ID: <89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com> (raw)
In-Reply-To: <1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com>
References: <b151f851-4019-bdb1-699e-ebab07d2f40a@2ndquadrant.com>
	<CAJGNTeOxeQPFpEr35PME4yLayRzP_wwzt70kFrPztSTWHf-HDA@mail.gmail.com>
	<CAJGNTeM+MCjA4dBhAdjJ-vR_CwY3u65cCcc+KvnahzLHZjxjbw@mail.gmail.com>
	<1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com>

On 12/27/2017 09:31 AM, Peter Eisentraut wrote:
> On 9/12/17 15:35, Jaime Casanova wrote:
>> On 10 September 2017 at 00:08, Jaime Casanova
>> <jaime.casanova@2ndquadrant.com> wrote:
>>>
>>> During my own tests, though, i found some problems:
> 
> Here is an updated patch that should address the problems you have found.

In the commit message it says:

  "The plan to is implement two kinds of generated columns:
   virtual (computed on read) and stored (computed on write).  This
   patch only implements the virtual kind, leaving stubs to implement
   the stored kind later."

and in the patch itself:

+<para>
+ The generation expression can refer to other columns in the table, but
+ not other generated columns.  Any functions and operators used must be
+ immutable.  References to other tables are not allowed.
+</para>

Question -- when the "stored" kind of generated column is implemented,
will the immutable restriction be relaxed? I would like, for example, be
able to have a stored generated column that executes now() whenever the
row is written/rewritten.

Joe

-- 
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (112+ messages)  latest in thread

Message-ID: <89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com>
Permalink:  ../89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com/
Also on:    postgresql.org/message-id/89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: mail@joeconway.com, peter.eisentraut@2ndquadrant.com, jaime.casanova@2ndquadrant.com
  Subject: Re: [HACKERS] Re: [HACKERS] generated columns
  In-Reply-To: <89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox