pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Jaime Casanova <jaime.casanova@2ndquadrant.com>
Subject: Re: [HACKERS] generated columns
Date: Wed, 16 Jan 2019 09:26:10 +0100
Message-ID: <78225f31-09ed-a353-edd2-d01ae100e3d6@2ndquadrant.com> (raw)
In-Reply-To: <CAFj8pRAuSk=C5XQG+BwCjFZGd69twFQG_v_jNgnN+Qcr6ZEetA@mail.gmail.com>
References: <bf9c8765-1aa0-432a-442e-45f715ebe4e7@2ndquadrant.com>
	<20180202022532.GA84623@paquier.xyz>
	<050e663d-d915-f61b-af96-5a09c10ade02@2ndquadrant.com>
	<79e4de23-52e3-2c45-9ba0-5f6932f590aa@2ndquadrant.com>
	<28574501540912440@iva5-750e13568e4d.qloud-c.yandex.net>
	<2ddd0bfa-0fcd-35ec-266c-f03cf72fc581@2ndquadrant.com>
	<26129f50-cf47-2013-8f9b-e7a98853aa69@2ndquadrant.com>
	<CAFj8pRCnXSjxvDqDgruAbf36TEdZZHmV5=xAUbn8Pc2=wHX84A@mail.gmail.com>
	<acb103e7-a1c6-8e53-ec63-0ee02ea8dd73@2ndquadrant.com>
	<CAFj8pRB=L3At5R=DXWRw7OFCdaeZ_+3S5e==DbGgD_7POsqngA@mail.gmail.com>
	<20190115071359.GF1433@paquier.xyz>
	<CAFj8pRAuSk=C5XQG+BwCjFZGd69twFQG_v_jNgnN+Qcr6ZEetA@mail.gmail.com>

On 15/01/2019 08:18, Pavel Stehule wrote:
> I would to have a mechanism for safe replacement of triggers of type
> 
> if TG_TYPE = 'INSERT' THEN
>   NEW.inserted := CURRENT_TIMESTAMP;
> ELSE IF TG_TYPE = 'UPDATE' THEN
>   NEW.updated := CURRENT_TIMESTAMP;
>  ..

That kind of use is probably better addressed with a temporal facility.

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




view thread (112+ messages)  latest in thread

Message-ID: <78225f31-09ed-a353-edd2-d01ae100e3d6@2ndquadrant.com>
Permalink:  ../78225f31-09ed-a353-edd2-d01ae100e3d6@2ndquadrant.com/
Also on:    postgresql.org/message-id/78225f31-09ed-a353-edd2-d01ae100e3d6@2ndquadrant.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: peter.eisentraut@2ndquadrant.com, pavel.stehule@gmail.com, michael@paquier.xyz, sk@zsrv.org, michael.paquier@gmail.com, jaime.casanova@2ndquadrant.com
  Subject: Re: [HACKERS] generated columns
  In-Reply-To: <78225f31-09ed-a353-edd2-d01ae100e3d6@2ndquadrant.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