pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Philip Semanchuk <philip@americanefficient.com>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: Roman Cervenak <roman@cervenak.info>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: IN clause behaving badly with missing comma and line break
Date: Wed, 18 Jan 2023 11:09:38 -0500
Message-ID: <65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com> (raw)
In-Reply-To: <CA+bJJbw=RvKYrespkhD5+=y8SmVXmhtewhaf2MbfVAb2wV6NQQ@mail.gmail.com>
References: <CAGjExY3rn0YEYnCiRkJ+R9czsmz6Fa4xkYaOaY35x6B-UC_53A@mail.gmail.com>
	<1E97D89B-3195-4A55-918B-2C1152EEE497@americanefficient.com>
	<CA+bJJbw=RvKYrespkhD5+=y8SmVXmhtewhaf2MbfVAb2wV6NQQ@mail.gmail.com>



> 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 literal on each line and place the commas all in the same column with a significant amount of white space to the left of the commas. 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 and idiomatic. Not so much in SQL. :-)








view thread (5+ messages)

Message-ID: <65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com>
Permalink:  ../65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com/
Also on:    postgresql.org/message-id/65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com

 · 

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-bugs@postgresql.org
  Cc: philip@americanefficient.com, folarte@peoplecall.com, roman@cervenak.info
  Subject: Re: IN clause behaving badly with missing comma and line break
  In-Reply-To: <65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com>
  References: <CAGjExY3rn0YEYnCiRkJ+R9czsmz6Fa4xkYaOaY35x6B-UC_53A@mail.gmail.com> <1E97D89B-3195-4A55-918B-2C1152EEE497@americanefficient.com> <CA+bJJbw=RvKYrespkhD5+=y8SmVXmhtewhaf2MbfVAb2wV6NQQ@mail.gmail.com> <65C07914-4AB4-43F5-BC5B-E73F1FE99185@americanefficient.com>

* 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