Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vljca-0001FD-PI for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Nov 2013 18:13:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vljca-0005ED-1x for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Nov 2013 18:13:56 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VljcZ-0005E7-AL for pgsql-bugs@postgresql.org; Wed, 27 Nov 2013 18:13:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VljcW-0008EB-2q for pgsql-bugs@postgresql.org; Wed, 27 Nov 2013 18:13:54 +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 rARIDpdr019674; Wed, 27 Nov 2013 13:13:51 -0500 From: Tom Lane To: David Johnston cc: pgsql-bugs@postgresql.org Subject: Re: Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output In-reply-to: <1385571205704-5780604.post@n5.nabble.com> References: <1385571205704-5780604.post@n5.nabble.com> Comments: In-reply-to David Johnston message dated "Wed, 27 Nov 2013 08:53:25 -0800" Date: Wed, 27 Nov 2013 13:13:51 -0500 Message-ID: <19673.1385576031@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 Johnston writes: > bricklen wrote >> I don't think this is a bug, "current_time" is a reserved word. See >> http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html > Agreed; though I am curious why this does not throw an error during the > declaration or assignment. A spurious parser error would be welcomed > compared to silently ignoring the requested action. Well, it's not "ignoring the action", it's just that the keyword meaning now takes precedence in expressions. We changed that in 9.0 I believe. We could possibly throw an error if you use a SQL reserved word in a declaration without double-quoting it. That wouldn't be a complete fix, because if you did that and then forgot to double-quote the name in expressions, it'd still do the wrong thing. But this might at least help you remember you need to do that. I think though that at one time it was considered a feature that we didn't insist on double-quoting plpgsql variable names unnecessarily. Don't know if changing this would be a net improvement for everyone. 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