Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output - Mailing list pgsql-bugs

From David Johnston
Subject Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output
Date
Msg-id 1385571205704-5780604.post@n5.nabble.com
Whole thread Raw
In response to Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output  (bricklen <bricklen@gmail.com>)
Responses Re: Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
bricklen wrote
> On Wed, Nov 27, 2013 at 7:49 AM, <

> michael.lancaster@.co

> >wrote:
>
>>
>> Reading the value from a variable named 'current_time' that has a value
>> assigned to it then assigns the value of the function 'current_time'
>> rather
>> than reading the value that was previously assigned.
>>
>
> 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.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-8633-Assigning-to-a-variable-named-current-time-gives-wrong-output-tp5780601p5780604.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

pgsql-bugs by date:

Previous
From: bricklen
Date:
Subject: Re: BUG #8633: Assigning to a variable named "current_time" gives wrong output
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #8434: Why does dead lock occur many times ?