Re: Can't find the right generated column syntax

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: Can't find the right generated column syntax
Дата
Msg-id
CAKFQuwbUVHmYyCfkvzUwwcnod-dbbJEai0dg7vcEUDy8OR7H8g@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Can't find the right generated column syntax Bzzzz <lazyvirus@gmx.com>
Re: Can't find the right generated column syntax Laurenz Albe <laurenz.albe@cybertec.at>
Re: Can't find the right generated column syntax "David G. Johnston" <david.g.johnston@gmail.com>
Re: Can't find the right generated column syntax Bzzzz <lazyvirus@gmx.com>
Re: Can't find the right generated column syntax "David G. Johnston" <david.g.johnston@gmail.com>
Re: Can't find the right generated column syntax Bzzzz <lazyvirus@gmx.com>
Re: Can't find the right generated column syntax "David G. Johnston" <david.g.johnston@gmail.com>
Re: Can't find the right generated column syntax "David G. Johnston" <david.g.johnston@gmail.com>


On Monday, November 25, 2019, Bzzzz <lazyvirus@gmx.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.
 
В списке pgsql-novice по дате отправления
От: David G. Johnston
Дата:
От: Bzzzz
Дата:
FAQ