Re: Can't find the right generated column syntax

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Bzzzz <lazyvirus(at)gmx(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Can't find the right generated column syntax
Date: 2019-11-26 02:41:00
Message-ID: CAKFQuwbJtPX4ZBACxCD=b61B2ykG7UT-evFfJcwJW_PVYnpC3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Monday, November 25, 2019, Bzzzz <lazyvirus(at)gmx(dot)com> wrote:

> Hi list,
>
> I've got this table:
> date_start timestamptz,
> date_end temstamptz
>
> and I'd like to auto-generate a 3rd column with a tstzrange:
> date_start timestamptz,
> date_end temstamptz,
> duration tstzrange GENERATED ALWAYS AS ( ? ) STORED
>
> but I can't find the right syntax to do so :/ (is it even possible ?)
>
>
You should provide actual SQL without typos and also show which version
your are using. Provide the error your are getting as well.

Also:

https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-CONSTRUCT

David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bzzzz 2019-11-26 02:59:36 Re: Can't find the right generated column syntax
Previous Message Bzzzz 2019-11-26 02:30:41 Can't find the right generated column syntax