From: Tim Landscheidt <tim@tim-landscheidt.de>
To: pgsql-sql@postgresql.org
Subject: Token separation
Date: Sun, 15 Jan 2012 08:02:27 +0000
Message-ID: <m3ipkd1jho.fsf@passepartout.tim-landscheidt.de> (raw)
Hi,
I just tried to input a hexadecimal number in PostgreSQL
(8.4) and was rather surprised by the result:
| tim=# SELECT 0x13;
| x13
| -----
| 0
| (1 Zeile)
| tim=# SELECT 0abc;
| abc
| -----
| 0
| (1 Zeile)
| tim=#
The documentation says:
| A token can be a key word, an identifier, a quoted identifi-
| er, a literal (or constant), or a special character symbol.
| Tokens are normally separated by whitespace (space, tab,
| newline), but need not be if there is no ambiguity (which is
| generally only the case if a special character is adjacent
| to some other token type).
Is this behaviour really conforming to the standard? Even
stranger is what MySQL (5.1.59) makes out of it:
| mysql> SELECT 0x40;
| +------+
| | 0x40 |
| +------+
| | @ |
| +------+
| 1 row in set (0.00 sec)
| mysql> SELECT 0abc;
| ERROR 1054 (42S22): Unknown column '0abc' in 'field list'
| mysql>
Tim
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tim@tim-landscheidt.de
Subject: Re: Token separation
In-Reply-To: <m3ipkd1jho.fsf@passepartout.tim-landscheidt.de>
* 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