pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
Cc: postgre <pgsql-general@lists.postgresql.org>
Subject: Re: Function inserting into tstzrange ? (syntax error at or near...)
Date: Sun, 18 Feb 2024 12:52:59 -0500
Message-ID: <3883445.1708278779@sss.pgh.pa.us> (raw)
In-Reply-To: <5Tfn0cxmVyZ3uSyl4_GqlisTneXWCuH0I5Jk6PgEGtFXkBGlTXiXfT8ffk1YyF1zhGoGOxdpmpOPvOQfK4l74T4fK8xKMxTHcs-J_08M8j4=@protonmail.ch>
References: <5Tfn0cxmVyZ3uSyl4_GqlisTneXWCuH0I5Jk6PgEGtFXkBGlTXiXfT8ffk1YyF1zhGoGOxdpmpOPvOQfK4l74T4fK8xKMxTHcs-J_08M8j4=@protonmail.ch>
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
view thread (7+ messages) latest in thread
Message-ID: <3883445.1708278779@sss.pgh.pa.us> Permalink: ../3883445.1708278779@sss.pgh.pa.us/ Also on: postgresql.org/message-id/3883445.1708278779@sss.pgh.pa.us ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-general@postgresql.org Cc: tgl@sss.pgh.pa.us, n5d9xq3ti233xiyif2vp@protonmail.ch Subject: Re: Function inserting into tstzrange ? (syntax error at or near...) In-Reply-To: <3883445.1708278779@sss.pgh.pa.us> References: <5Tfn0cxmVyZ3uSyl4_GqlisTneXWCuH0I5Jk6PgEGtFXkBGlTXiXfT8ffk1YyF1zhGoGOxdpmpOPvOQfK4l74T4fK8xKMxTHcs-J_08M8j4=@protonmail.ch> <3883445.1708278779@sss.pgh.pa.us> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox