pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] surprising to_timestamp behavior
Date: Mon, 20 Jan 2014 13:53:33 -0500
Message-ID: <32524.1390244013@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM2+6=WGtL-_X0j9QJnYrHUWPxAzROzh_7HX3y1obKi7BXefDg@mail.gmail.com>
References: <CA+TgmobO2Jc2meW0tWpcNcX0Q3AoddcfWwKvBD+tp3VNPef_7w@mail.gmail.com>
	<2726.1383062593@sss.pgh.pa.us>
	<CA+TgmobE0DoqF8W7=AmSiiJMfDWg5LMZhE0TgG+cOEJ-JF=uug@mail.gmail.com>
	<CAM2+6=UooEhX+CMx+9CUAvKifqvhiT=XRn4KR5aF6Hhqj6Jmhg@mail.gmail.com>
	<CAM2+6=Uk4j0ibOGYO7rmePHwWLB5ZvXJ4iN7p5LHyY4mrn0OfQ@mail.gmail.com>
	<9795.1389987385@sss.pgh.pa.us>
	<CAM2+6=WGtL-_X0j9QJnYrHUWPxAzROzh_7HX3y1obKi7BXefDg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Jeevan Chalke <jeevan.chalke@enterprisedb.com> writes:
>> I went to review this, and found that there's not actually a patch
>> attached ...

> Attached. Sorry for that.

This looks good to me except for one thing: if the upcoming node is a
DCH_FX action (ie, turn on fx_mode), I don't think we want to skip
whitespace.  The original coding had that bug too, but it was only
exposed if the FX prefix was immediately preceded by whitespace in
the format.

It's a bit hard to think of useful cases where this would make a
difference, because it turns out that from_char_parse_int contains
an internal skip-whitespace action that's applied regardless of FX
mode, so it really only matters for non-integer field types.  I
kinda think that maybe now we should remove that extra skip, or at
least count the skipped whitespace against the field width, but
did not experiment to see what the results would be.

Committed with that change and some cosmetic adjustments.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)

Message-ID: <32524.1390244013@sss.pgh.pa.us>
Permalink:  ../32524.1390244013@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/32524.1390244013@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeevan.chalke@enterprisedb.com, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] surprising to_timestamp behavior
  In-Reply-To: <32524.1390244013@sss.pgh.pa.us>
  References: <CA+TgmobO2Jc2meW0tWpcNcX0Q3AoddcfWwKvBD+tp3VNPef_7w@mail.gmail.com> <2726.1383062593@sss.pgh.pa.us> <CA+TgmobE0DoqF8W7=AmSiiJMfDWg5LMZhE0TgG+cOEJ-JF=uug@mail.gmail.com> <CAM2+6=UooEhX+CMx+9CUAvKifqvhiT=XRn4KR5aF6Hhqj6Jmhg@mail.gmail.com> <CAM2+6=Uk4j0ibOGYO7rmePHwWLB5ZvXJ4iN7p5LHyY4mrn0OfQ@mail.gmail.com> <9795.1389987385@sss.pgh.pa.us> <CAM2+6=WGtL-_X0j9QJnYrHUWPxAzROzh_7HX3y1obKi7BXefDg@mail.gmail.com> <32524.1390244013@sss.pgh.pa.us>

* 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