RE: IN List operator , where list of values are over a number of lines

White, Ian Keith <ian.white@ncratleos.com>

From: "White, Ian Keith" <Ian.White@ncratleos.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-10-02T08:32:02Z
Lists: pgsql-bugs
Hi

Thank you for your prompt response most apricated.

I agree it is a bizarre  behaviour .
Programmatically I wouldn’t rely on that to do concatenation I would expect a specific concatenation operator  to required, so it is obvious to all  what is going on !

You live and learn

All my colleagues were baffled by this – so I have updated them.

Many Thanks Ian


From: Pavel Stehule <pavel.stehule@gmail.com>
Sent: 01 October 2025 19:16
To: White, Ian Keith <Ian.White@ncratleos.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: IN List operator , where list of values are over a number of lines

Hi st 1. 10. 2025 v 19: 50 odesílatel White, Ian Keith <Ian. White@ ncratleos. com> napsal: Hi We have noticed a quirk in the IN list operator where the list of values are over several lines , but some have missing comma separators. The command
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi

st 1. 10. 2025 v 19:50 odesílatel White, Ian Keith <Ian.White@ncratleos.com<mailto:Ian.White@ncratleos.com>> napsal:
Hi

We have noticed a quirk in the IN list operator where the list of values are over several lines , but some have missing comma separators.
The command should fail, however it executes only returning certain values.

Create table, insert vales, show values , select using IN List
[cid:image001.png@01DC337F.676EA580]

First query  errors as expected , Second executes with out error! Returning A & F .
[cid:image002.png@01DC337F.676EA580]

Details of server .
[cid:image003.png@01DC337F.676EA580]

Attached is the sql that I ran

Please investigate

Many Thanks Ian White
Member British Computer Society

[ncr corporation]
Oracle & Postgres Database Administrator & Perfomance Expert.
Based London
Ian.White@ncratleos.com<mailto:Ian.White@ncratleos.com>


It is effect of multiline SQL strings

(2025-10-01 20:07:45) postgres=# select 'a' 'hoj';
ERROR:  syntax error at or near "'hoj'"
LINE 1: select 'a' 'hoj';
                   ^
but

(2025-10-01 20:08:38) postgres=# select 'a'
postgres-# 'hoj';
┌──────────┐
│ ?column? │
╞══════════╡
│ ahoj     │
└──────────┘
(1 row)
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS<https://urldefense.com/v3/__https:/www.postgresql.org/docs/current/sql-syntax-lexical.html*SQL-SYNTAX-STRINGS__;Iw!!D5WlZnHMtQ!U6la6p9C9Hg-Jy5JVv-NIvOb9uWV-usnsRV-OEREVbrows8rbhOkvqtMpnCj_yCiqS96V6267N5LnLRwW-SLuNZm$>

Regards

Pavel