Re: IN clause behaving badly with missing comma and line break - Mailing list pgsql-bugs

From Philip Semanchuk
Subject Re: IN clause behaving badly with missing comma and line break
Date
Msg-id 65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com
Whole thread Raw
In response to Re: IN clause behaving badly with missing comma and line break  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-bugs

> On Jan 18, 2023, at 11:06 AM, Francisco Olarte <folarte@peoplecall.com> wrote:
>
> On Wed, 18 Jan 2023 at 16:21, Philip Semanchuk
> <philip@americanefficient.com> wrote:
>
>> .... We’ve adopted a formatting standard that helps us to avoid surprises due to missing commas. We put one string
literalon each line and place the commas all in the same column with a significant amount of white space to the left of
thecommas. With this safeguard in place, it’s very easy to spot a missing comma. 
>>
>> WHERE t IN ('a'      ,
>>            'foo'    ,
>>            'bar'    ,
>>            )
>
> I believe that one is a syntax error ( last comma ).


Ooops, yes, thanks for catching that. I spend about half of my time in Python where that trailing comma is acceptable
andidiomatic. Not so much in SQL. :-) 






pgsql-bugs by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: IN clause behaving badly with missing comma and line break
Next
From: "Sam.Mesh"
Date:
Subject: Re: index not used for bigint without explicit cast