Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Geoff Tolley <geoff(dot)tolley(at)yougov(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped
Date: 2009-10-08 14:54:51
Message-ID: 20091008145451.GA5510@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Geoff Tolley wrote:

> postgres=# SELECT 'hello' WHERE '1' IN ('1' '2');
> ERROR: syntax error at or near "'2'"
> LINE 1: SELECT 'hello' WHERE '1' IN ('1' '2');
> ^
> postgres=# SELECT 'hello' WHERE '1' IN ('1'
> postgres(# '2');
> ?column?
> ----------
> (0 rows)

I guess what's happening here is this:

alvherre=# select 'a'
alvherre-# 'b';
?column?
----------
ab
(1 fila)

I don't know much about this oddity but my first guess is that it's
mandated by the SQL standard.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2009-10-08 14:56:29 Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped
Previous Message Walter Mesz 2009-10-08 14:42:25 BUG #5105: "Select Into Strict" does not throw NO_DATA_FOUND