From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Johnston <polobo@yahoo.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output
Date: Wed, 27 Nov 2013 13:13:51 -0500
Message-ID: <19673.1385576031@sss.pgh.pa.us> (raw)
In-Reply-To: <1385571205704-5780604.post@n5.nabble.com>
References: <E1VlhN7-0006I7-1M@wrigleys.postgresql.org>
<CAGrpgQ_6aBgPDXTR3G8KN6tsOuonBdvyXR3UEmB6GFYDqQOm0g@mail.gmail.com>
<1385571205704-5780604.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
David Johnston <polobo@yahoo.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, polobo@yahoo.com
Subject: Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output
In-Reply-To: <19673.1385576031@sss.pgh.pa.us>
References: <E1VlhN7-0006I7-1M@wrigleys.postgresql.org> <CAGrpgQ_6aBgPDXTR3G8KN6tsOuonBdvyXR3UEmB6GFYDqQOm0g@mail.gmail.com> <1385571205704-5780604.post@n5.nabble.com> <19673.1385576031@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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