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

From: "White, Ian Keith" <Ian(dot)White(at)ncratleos(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: IN List operator , where list of values are over a number of lines
Date: 2025-10-02 08:32:02
Message-ID: BLAPR05MB73295CE99A8B90B89883E727E5E7A@BLAPR05MB7329.namprd05.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
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(dot)stehule(at)gmail(dot)com>
Sent: 01 October 2025 19:16
To: White, Ian Keith <Ian(dot)White(at)ncratleos(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)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(dot)White(at)ncratleos(dot)com<mailto:Ian(dot)White(at)ncratleos(dot)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(dot)png(at)01DC337F(dot)676EA580]

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

Details of server .
[cid:image003(dot)png(at)01DC337F(dot)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(dot)White(at)ncratleos(dot)com<mailto:Ian(dot)White(at)ncratleos(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2025-10-02 09:33:02 Re: [Bug] Usage of stale dead_items pointer in parallel vacuum
Previous Message John Naylor 2025-10-02 05:09:47 Re: [Bug] Usage of stale dead_items pointer in parallel vacuum