Re: insert throw error when year field len > 4 for timestamptz datatype

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Haribabu kommi <haribabu(dot)kommi(at)huawei(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Rushabh Lathia <rushabh(dot)lathia(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: insert throw error when year field len > 4 for timestamptz datatype
Date: 2013-10-01 23:52:18
Message-ID: 20131001235218.GE13385@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 27, 2013 at 10:42:17AM +0000, Haribabu kommi wrote:
> If the changes are very high to deal all scenarios,
>
> I feel it is better do it only in scenarios where the use cases needs it, until
> it is not confusing users.
>
> The rest can be documented.
>
> Any other opinions/suggestions welcome.

I have reviewed this patch and it is good. The problem is guessing if a
number with 5+ digits is YMD, HMS, or a year. I have created a modified
patch, attached, assumes a 5-digit number is a year, because YMD and HMS
require at least six digits, and used your date/time test to control the
other cases. I also added a few more regression tests.

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

+ It's impossible for everything to be true. +

Attachment Content-Type Size
timestamp.diff text/x-diff 5.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2013-10-02 00:23:01 Re: pg_stat_statements: calls under-estimation propagation
Previous Message David E. Wheeler 2013-10-01 23:30:37 Re: No Index-Only Scan on Partial Index