Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-16 Thread Bruce Momjian
On Tue, Oct 8, 2013 at 09:05:37AM -0400, Bruce Momjian wrote: On Tue, Oct 8, 2013 at 05:08:17PM +0530, Rushabh Lathia wrote: This might be a case where throwing an error is actually better than trying to make sense of the input. I don't feel super-strongly about this,

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-08 Thread Rushabh Lathia
On Tue, Oct 8, 2013 at 1:34 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 7, 2013 at 12:41 AM, Rushabh Lathia rushabh.lat...@gmail.com wrote: Hmm right it has some inconsistency when year length is 6. But the patch is based on assumption that 5-digit number is a year, because YMD

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-08 Thread Bruce Momjian
On Tue, Oct 8, 2013 at 05:08:17PM +0530, Rushabh Lathia wrote: This might be a case where throwing an error is actually better than trying to make sense of the input. I don't feel super-strongly about this, but I offer it as a question for reflection. At the same

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-07 Thread Robert Haas
On Mon, Oct 7, 2013 at 12:41 AM, Rushabh Lathia rushabh.lat...@gmail.com wrote: Hmm right it has some inconsistency when year length is 6. But the patch is based on assumption that 5-digit number is a year, because YMD and HMS require at least six digits. Now Year with 6-digit number its

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-06 Thread Rushabh Lathia
On Fri, Oct 4, 2013 at 11:35 PM, Bruce Momjian br...@momjian.us wrote: On Fri, Oct 4, 2013 at 10:19:38AM +, Haribabu kommi wrote: On 03 October 2013 19:30 Bruce Momjian wrote: On Thu, Oct 3, 2013 at 11:54:14AM +0530, Rushabh Lathia wrote: Thanks Bruce. Yes for me main

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-04 Thread Haribabu kommi
On 03 October 2013 19:30 Bruce Momjian wrote: On Thu, Oct 3, 2013 at 11:54:14AM +0530, Rushabh Lathia wrote: Thanks Bruce. Yes for me main problem was to make assumption that a 5-digit number is a year, as was bit worried about side effect of that assumption in the date/time module. I

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-04 Thread Bruce Momjian
On Fri, Oct 4, 2013 at 10:19:38AM +, Haribabu kommi wrote: On 03 October 2013 19:30 Bruce Momjian wrote: On Thu, Oct 3, 2013 at 11:54:14AM +0530, Rushabh Lathia wrote: Thanks Bruce. Yes for me main problem was to make assumption that a 5-digit number is a year, as was bit

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-03 Thread Rushabh Lathia
Thanks Bruce. Yes for me main problem was to make assumption that a 5-digit number is a year, as was bit worried about side effect of that assumption in the date/time module. I did tested patch shared by you with various test and so far it looks good to me. I would like reviewer to review/test

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-03 Thread Bruce Momjian
On Thu, Oct 3, 2013 at 11:54:14AM +0530, Rushabh Lathia wrote: Thanks Bruce. Yes for me main problem was to make assumption that a 5-digit number is a year, as was bit worried about side effect of that assumption in the date/time module. I did tested patch shared by you with various test

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-02 Thread Robert Haas
On Tue, Oct 1, 2013 at 7:52 PM, Bruce Momjian br...@momjian.us wrote: On Fri, Sep 27, 2013 at 10:42:17AM +, 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

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-02 Thread Bruce Momjian
On Wed, Oct 2, 2013 at 11:00:30AM -0400, Robert Haas wrote: On Tue, Oct 1, 2013 at 7:52 PM, Bruce Momjian br...@momjian.us wrote: On Fri, Sep 27, 2013 at 10:42:17AM +, Haribabu kommi wrote: If the changes are very high to deal all scenarios, I feel it is better do it only in

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-10-01 Thread Bruce Momjian
On Fri, Sep 27, 2013 at 10:42:17AM +, 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

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-09-27 Thread Rushabh Lathia
Sorry for delay in reply. On Tue, Sep 17, 2013 at 6:23 PM, Haribabu kommi haribabu.ko...@huawei.comwrote: On Tue, 17 September 2013 14:33 Rushabh Lathia wrote: On Mon, Sep 16, 2013 at 7:22 PM, Haribabu kommi haribabu.ko...@huawei.com wrote: ***On *14 August 2013 Rushabh Lathia

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-09-27 Thread Haribabu kommi
On 27 September 2013 15:04 Rushabh Lathia wrote: On Tue, Sep 17, 2013 at 6:23 PM, Haribabu kommi haribabu.ko...@huawei.commailto:haribabu.ko...@huawei.com wrote: I feel changing the year value to accept the length (4) is not simple. So many places the year length crossing more than length 4 is

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-09-17 Thread Rushabh Lathia
On Mon, Sep 16, 2013 at 7:22 PM, Haribabu kommi haribabu.ko...@huawei.comwrote: *On *14 August 2013 Rushabh Lathia wrote:** ** ** postgres=# create table test ( a timestamptz); CREATE TABLE ** ** -- Date with year 1000 postgres=# insert into test values ( 'Sat Mar 11

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-09-17 Thread Haribabu kommi
On Tue, 17 September 2013 14:33 Rushabh Lathia wrote: On Mon, Sep 16, 2013 at 7:22 PM, Haribabu kommi haribabu.ko...@huawei.commailto:haribabu.ko...@huawei.com wrote: On 14 August 2013 Rushabh Lathia wrote: postgres=# create table test ( a timestamptz); CREATE TABLE -- Date with year 1000

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-09-16 Thread Haribabu kommi
On 14 August 2013 Rushabh Lathia wrote: postgres=# create table test ( a timestamptz); CREATE TABLE -- Date with year 1000 postgres=# insert into test values ( 'Sat Mar 11 23:58:48 1000 IST'); INSERT 0 1 -- Now try with year 1 it will return error postgres=# insert into test values ( 'Sat

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-08-16 Thread Rushabh Lathia
On Thu, Aug 15, 2013 at 1:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: Rushabh Lathia rushabh.lat...@gmail.com writes: PFA patch and share your input/suggestions. I think this needs review. Please add it to the next commitfest. Done. Here is latest patch with testcase added to regression.

[HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-08-14 Thread Rushabh Lathia
Hi, While working on something I come across this issue. Consider following test: postgres=# select version(); version -

Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-08-14 Thread Tom Lane
Rushabh Lathia rushabh.lat...@gmail.com writes: PFA patch and share your input/suggestions. I think this needs review. Please add it to the next commitfest. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to