Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a6Btv-0006S5-Dc for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Dec 2015 06:37:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a6Btu-0007GC-Ns for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Dec 2015 06:37:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a6BtI-00069b-7B for pgsql-bugs@postgresql.org; Tue, 08 Dec 2015 06:36:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a6BtB-00047E-7J for pgsql-bugs@postgresql.org; Tue, 08 Dec 2015 06:36:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tB86addM014235; Tue, 8 Dec 2015 01:36:39 -0500 From: Tom Lane To: David Gould cc: amutu@amutu.com, pgsql-bugs@postgresql.org Subject: Re: BUG #13805: plpgsql execute using expression evaluate wrong In-reply-to: <20151207220847.4da716e1@engels> References: <20151208035444.5253.30717@wrigleys.postgresql.org> <20151207220847.4da716e1@engels> Comments: In-reply-to David Gould message dated "Mon, 07 Dec 2015 22:08:47 -0800" Date: Tue, 08 Dec 2015 01:36:39 -0500 Message-ID: <14234.1449556599@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org David Gould writes: > However, it does seem a little odd that the literal syntax for > intervals accepts the '$': > ... > I would have expected it to raise an error. The documentation does not shed > any light on this. Anyone? The datetime input parser tends to consider most non-alphanumeric characters as being insignificant except as field separators. We could tighten that up, but I think we should tread pretty carefully for fear of breaking cases that used to work. A trivial example: regression=# select '1 mon 1 day'::interval; interval ------------- 1 mon 1 day (1 row) regression=# select '1 mon, 1 day'::interval; interval ------------- 1 mon 1 day (1 row) If we started to reject the second case, we'd likely get complaints. But the parser doesn't see that as any different from regression=# select '1 mon$ 1 day'::interval; interval ------------- 1 mon 1 day (1 row) Trying to decide which characters are legitimate noise and which aren't seems like a tarbaby best not to get stuck to :-( 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