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 03:35:50
Message-ID: CAKFQuwbUVHmYyCfkvzUwwcnod-dbbJEai0dg7vcEUDy8OR7H8g@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:

>
>
> CREATE TABLE tst_timerange(a timestamptz, b timestamptz, c tstzrange
> generated always as ( SELECT tstzrange(a, b, '[)' ) ) stored); ERROR:
> syntax error at or near "SELECT" LINE 1: ... b timestamptz, c tstzrange
> generated always as ( SELECT tst...
>
>
>
>
Correct, i think, you recognized that removing select is what the error was
telling you.

>
>
>
> CREATE TABLE tst_timerange(a timestamptz, b timestamptz, c tstzrange
> generated always as ( ('[a,b(') ) stored); ERROR: malformed range
> literal: "[a,b(" LINE 1: ...b timestamptz, c tstzrange generated always
> as ( ('[a,b(') )...
>
>
>
Also probably correct if you recognize that [( doesn’t make sense as a
range boundary specification.

David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bzzzz 2019-11-26 03:39:42 Re: Can't find the right generated column syntax
Previous Message David G. Johnston 2019-11-26 03:31:31 Re: Can't find the right generated column syntax