Re: trailing junk in numeric literals

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: trailing junk in numeric literals
Дата
Msg-id alpine.DEB.2.22.394.2012290614480.3485095@pseudo
обсуждение исходный текст
Ответ на Re: trailing junk in numeric literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
Hello Peter,

My 0.02€:

>> So strictly speaking this SQL code is nonstandard anyway.  But our
>> lexer has always been forgiving about not requiring space if it's
>> not logically necessary to separate tokens.  I doubt trying to
>> change that would improve matters.
>
> Well, the idea is to diagnose potential typos better.  But if there is no 
> interest, then that's fine.

ISTM that silently accepting bogus syntax hides bugs rather than helps 
users. I'm personaly all for fixing these, especially when I'm said user.

My latest catch was:

   SELECT TIMESTAMP '2020-12-29Z06:16:18'; # 2020-12-29 00:00:00

But:

   SELECT TIMESTAMPTZ '2020-12-29Z06:16:18'; # 2020-12-29 07:16:18+01
   SELECT TIMESTAMP '2020-12-29T06:16:18'; # 2020-12-29 06:16:18

I happen to type a O which is close to 0 for which the shift key is also 
needed on the French keyboard. This makes the unhelpful:

   SELECT 12O; # 12 as O

I think that the policy should be to help user by detecting mistyped 
entries, not trying to interpret them out of the norm and expectations.

-- 
Fabien.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ajin Cherian
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: doc review for v14