Re: Can't find the right generated column syntax

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Can't find the right generated column syntax
Дата
Msg-id CAKFQuwaURLKtX3mCvEjoK6dLnEsuPb3bTTxVURFbuUsUE2Akhg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Can't find the right generated column syntax  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-novice
On Monday, November 25, 2019, David G. Johnston <david.g.johnston@gmail.com> wrote:


On Monday, November 25, 2019, Bzzzz <lazyvirus@gmx.com> wrote:


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.


Nevermind this one - getting the quoting correct with a literal input expression is why using the function is much easier.  Even swapping ) for ( isn’t enough though its close - just need to get a and b to be treated as column references.

David J.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Bzzzz
Дата:
Сообщение: Re: Can't find the right generated column syntax
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Can't find the right generated column syntax