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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
Cc: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Function inserting into tstzrange ? (syntax error at or near...)
Date: 2024-02-18 17:48:35
Message-ID: CAKFQuwZsjAv56H-vx1KAUEuvYP_uu+FOfznERn5kzG_7YSe50w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, February 18, 2024, Laura Smith <
n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch> wrote:

> 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...
>
>
It’s telling you you have a syntax error so no you’ve don’t have the syntax
right.

The [ and ) used to describe the bound inclusiveness of the range must
appear in a string literal, I.e. enclosed in single quotes.

The functional constructors for ranges allow you to specify a single string
literal containing both as the third argument.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-02-18 17:49:36 Re: Function inserting into tstzrange ? (syntax error at or near...)
Previous Message Laura Smith 2024-02-18 17:40:57 Function inserting into tstzrange ? (syntax error at or near...)