Re: Function inserting into tstzrange ? (syntax error at or near...)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function inserting into tstzrange ? (syntax error at or near...)
Дата
Msg-id 3883445.1708278779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function inserting into tstzrange ? (syntax error at or near...)  (Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>)
Ответы Re: Function inserting into tstzrange ? (syntax error at or near...)
Список pgsql-general
Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch> writes:
> I'm sure I'm doing something stupid here, but I think I've got the syntax right ?
> The error I'm seeing:
> psql:event_session_funcs.sql:26: ERROR:  syntax error at or near "["
> LINE 11:         VALUES(p_event_id,[p_start_time,p_end_time)) RETURNI...

There's not bespoke SQL syntax for constructing a range.  You must
use a function, something like

VALUES(p_event_id, tstzrange(p_start_time,p_end_time,'[)')) ...

although I believe '[)' is the default bounds type so that could be
simplified to

VALUES(p_event_id, tstzrange(p_start_time,p_end_time)) ...

            regards, tom lane



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Function inserting into tstzrange ? (syntax error at or near...)
Следующее
От: Laura Smith
Дата:
Сообщение: Re: Function inserting into tstzrange ? (syntax error at or near...)