Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id BAA33490 for ; Tue, 8 Feb 2000 01:42:39 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id BAA00408; Tue, 8 Feb 2000 01:42:14 -0500 (EST) To: Thomas Lockhart cc: Axel at ansonic , pgsql-interfaces@postgreSQL.org, "Ross J. Reedstrom" , blackw@sfu.ca Subject: Re: [INTERFACES] Bug in parser? In-reply-to: <389FB27B.1F9702BD@alumni.caltech.edu> References: <27734.949981876@sss.pgh.pa.us> <389FB27B.1F9702BD@alumni.caltech.edu> Comments: In-reply-to Thomas Lockhart message dated "Tue, 08 Feb 2000 06:06:51 +0000" Date: Tue, 08 Feb 2000 01:42:13 -0500 Message-ID: <405.949992133@sss.pgh.pa.us> From: Tom Lane Thomas Lockhart writes: > Pretty sure that the SQL92 rules for the "string across lines" is more > restrictive than just allowing spaces between double quotes; you > actually need something close to a line break. > > select * from "T1" "A1"; > > would do horrible things if I interpret your suggestion correctly. No, because we're talking about string literals (single quotes) not double-quoted names. Is there harm in interpreting select 'a string' ' literal'; as select 'a string literal'; ? And if so, why does it suddenly become OK if I write it as select 'a string' ' literal'; The SQL92 spec isn't particularly transparent about this, but if I am looking at the right syntax items, we have ::= [ ] [ ... ] [ { ... [ ... ] }... ] ::= { | | }... which sure as heck looks like you can write either newline or just plain space between 'a string' and ' literal' and get the same answer. A couple other items: * I see why xqdouble has to be separate from xqcat; the former produces a single quote in the represented string, the latter doesn't. So xqcat must at least be defined as xqcat {quote}{space}{space}*{quote} to allow it to be distinguished from xqdouble. * I see that the spec allows comments between segments of a string literal. This works in current code: regression=# select 'a string' -- zzz regression-# ' literal'; ?column? ------------------ a string literal (1 row) but I'm durned if I see where that behavior is implemented. Do you? regards, tom lane