On Thu, Aug 02, 2018 at 06:17:01PM +0300, Alexander Korotkov wrote:
> So, if number of spaces/separators between fields in input string is
> more than in format string and list space/separator skipped is minus
> sign, then it decides to glue that minus sign to TZH. I think this
> behavior is nice to follow, because it allows us to skip spaces after
> fields.
Good approach! With this change the following queries work now:
=# SELECT to_timestamp('2000 + JUN', 'YYYY MON');
=# SELECT to_timestamp('2000 + JUN', 'YYYY MON');
I think it is worth to add them to regression tests.
> 4) Spaces and separators in format string seem to be handled in the
> same way in non-FX mode. But strange things happen when you mix
> spaces and separators there.
> ...
> 1+2+3 are implemented in the attached patch, but not 4. I think that
> it's only worth to follow Oracle when it does reasonable things.
I agree with you. I think it isn't worth to copy this behaviour.
--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company