Re: [HACKERS] Bug in to_timestamp().
От
Arthur Zakirov
Тема
Re: [HACKERS] Bug in to_timestamp().
Дата
Msg-id
20180201102449.GA29082@zakirov.localdomain
Ответ на
Re: [HACKERS] Bug in to_timestamp(). (Dmitry Dolgov)
Список
Дерево обсуждения
Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). Alex Ignatov <a.ignatov@postgrespro.ru>
Re: Bug in to_timestamp(). Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Bug in to_timestamp(). Alex Ignatov <a.ignatov@postgrespro.ru>
Re: Bug in to_timestamp(). Steve Crawford <scrawford@pinpointresearch.com>
Re: Bug in to_timestamp(). "Joshua D. Drake" <jd@commandprompt.com>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). "Joshua D. Drake" <jd@commandprompt.com>
Re: Bug in to_timestamp(). Steve Crawford <scrawford@pinpointresearch.com>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: Bug in to_timestamp(). Alex Ignatov <a.ignatov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Bruce Momjian <bruce@momjian.us>
Re: Bug in to_timestamp(). Alex Ignatov <a.ignatov@postgrespro.ru>
Re: Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Alex Ignatov <a.ignatov@postgrespro.ru>
Re: Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: Bug in to_timestamp(). Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Bug in to_timestamp(). Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). Alex Ignatov <a.ignatov@postgrespro.ru>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). Pavel Stehule <pavel.stehule@gmail.com>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). amul sul <sul_amul@yahoo.co.in>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). Amul Sul <sulamul@gmail.com>
Re: Bug in to_timestamp(). Michael Paquier <michael.paquier@gmail.com>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Bug in to_timestamp(). Prabhat Sahu <prabhat.sahu@enterprisedb.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). amul sul <sulamul@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Liudmila Mantrova <l.mantrova@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Liudmila Mantrova <l.mantrova@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: Bug in to_timestamp(). Haribabu Kommi <kommi.haribabu@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Amul Sul <sulamul@gmail.com>
Re: [HACKERS] Bug in to_timestamp(). Artur Zakirov <a.zakirov@postgrespro.ru>
Re: [HACKERS] Bug in to_timestamp(). David Steele <david@pgmasters.net>
Re: Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
Re: Bug in to_timestamp(). Robert Haas <robertmhaas@gmail.com>
Re: Bug in to_timestamp(). Bruce Momjian <bruce@momjian.us>
Re: Bug in to_timestamp(). "David G. Johnston" <david.g.johnston@gmail.com>
On Wed, Jan 31, 2018 at 05:53:29PM +0100, Dmitry Dolgov wrote:
> Thanks for working on that! I haven't followed this thread before, and after a
> quick review I have few side questions.
Thank you for your comments!
> Why not write `is_separator_char` using `isprint`, `isalpha`, `isdigit` from
> ctype.h? Something like:
>
> return isprint(*str) && !isalpha(*str) && !isdigit(*str)
>
> From what I see in the source code they do exactly the same and tests are
> successfully passing with this change.
Fixed. The patch uses those functions now. I made is_separator_char() as a
IS_SEPARATOR_CHAR() macro.
> What do you think about providing two slightly different messages for these two
> situations:
>
> if (n->type == NODE_TYPE_SPACE && !isspace((unsigned char) *s))
> ereport(ERROR,
> (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
> errmsg("unexpected character \"%.*s\", expected \"%s\"",
> pg_mblen(s), s, n->character),
> errhint("In FX mode, punctuation in the input string "
> "must exactly match the format string.")));
> /*
> * In FX mode we insist that separator character from the format
> * string matches separator character from the input string.
> */
> else if (n->type == NODE_TYPE_SEPARATOR && *n->character != *s)
> ereport(ERROR,
> (errcode(ERRCODE_INVALID_DATETIME_FORMAT),
> errmsg("unexpected character \"%.*s\", expected \"%s\"",
> pg_mblen(s), s, n->character),
> errhint("In FX mode, punctuation in the input string "
> "must exactly match the format string.")));
>
> E.g. "unexpected space character" and "unexpected separator character". The
> difference is quite subtle, but I think a bit of context would never hurt.
I fixed those messages, but in a different manner. I think that an
unexpected character is unknown and neither space nor separator. And
better to say that was expected space/separator character.
Attached fixed patch.
--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
В списке pgsql-hackers по дате отправления
От: Rajkumar Raghuwanshi
Дата: