pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12242: No error - if there is no comma seperator
2+ messages / 2 participants
[nested] [flat]

* BUG #12242: No error - if there is no comma seperator
@ 2014-12-15 16:25  omkar1103@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: omkar1103@gmail.com @ 2014-12-15 16:25 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12242
Logged by:          Onkar Gaonkar
Email address:      omkar1103@gmail.com
PostgreSQL version: 9.3.3
Operating system:   Windows
Description:        

Below script does not throw error
=======================================
SELECT 
claim_status,
claim_key
FROM tbl_claim
WHERE claim_key IN 
(
'1140799265' 
'2129945595'
)
=======================================


Throws Error
=======================================
SELECT 
claim_status,
claim_key
FROM tbl_claim
WHERE claim_key IN 
(
'1140799265' '2129945595'
)


ERROR:  syntax error at or near "'2129945595'"
LINE 7: '1140799265' '2129945595'
                     ^
********** Error **********
ERROR: syntax error at or near "'2129945595'"
SQL state: 42601
Character: 113
=======================================


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #12242: No error - if there is no comma seperator
@ 2014-12-16 01:15  Tom Lane <tgl@sss.pgh.pa.us>
  parent: omkar1103@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-12-16 01:15 UTC (permalink / raw)
  To: omkar1103@gmail.com; +Cc: pgsql-bugs

omkar1103@gmail.com writes:
> Below script does not throw error
> =======================================
> SELECT 
> claim_status,
> claim_key
> FROM tbl_claim
> WHERE claim_key IN 
> (
> '1140799265' 
> '2129945595'
> )

> Throws Error
> =======================================
> SELECT 
> claim_status,
> claim_key
> FROM tbl_claim
> WHERE claim_key IN 
> (
> '1140799265' '2129945595'
> )

Yup.  This is not only not a bug, it's behavior required by the SQL
standard.  Literal strings are concatenated automatically as long as
they're separated by a newline.  This is mentioned in the PG docs
under 4.1.2.1. String Constants:
http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS

(This is one of many decisions I'm sure the SQL committee would like
to have back, but we're pretty much stuck with it now.)

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-12-16 01:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 16:25 BUG #12242: No error - if there is no comma seperator omkar1103@gmail.com
2014-12-16 01:15 ` Tom Lane <tgl@sss.pgh.pa.us>

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