Re: [GENERAL] to_timestamp() and quartersf

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, Scott Bailey <artacus(at)comcast(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] to_timestamp() and quartersf
Date: 2010-03-03 22:30:01
Message-ID: 201003032230.o23MU1p03432@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Here is an updated patch that honors 'Q' only if the month has not been
> > previously supplied:
>
> That's just weird. It's not even self-consistent much less
> unsurprising --- having the behavior be dependent on field order is
> really horrid.
>
> I think what people would actually want for this type of situation is
> a way to specify "there is an integer here but I want to ignore it".
> Q as it's presently constituted accomplishes that, though it is not
> documented as doing so. Brendan's comment about quoted text is
> interesting, but it doesn't really solve the problem because of the
> possibility of the integer field being variable width.

I have updated the comments that "Q" is ignored by to_date and
to_timestamp, and added a C comment.

I also documented the double-quote input-skip behavior of to_timestamp,
to_number, and to_date.

Applied patch attached.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do

Attachment Content-Type Size
/rtmp/diff text/x-diff 2.8 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Hunsberger 2010-03-03 22:33:49 Re: The REAL cost of joins
Previous Message Guillaume Yziquel 2010-03-03 22:27:44 Re: PQntuples returns an int.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-03-03 23:07:24 Re: Linux start script updates
Previous Message Grzegorz Jaskiewicz 2010-03-03 20:37:08 Re: double and numeric conversion