Skip site navigation (1) Skip section navigation (2)

timetz range check issue

From: Andrew Chernow <ac(at)esilo(dot)com>
To: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>
Subject: timetz range check issue
Date: 2007-12-22 03:42:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
When inserting a timetz in binary mode, there are no range checks on the time 
value (nor on the zone).  In text mode, things are fine:

postgres=# insert into t values ('24:00:00.000001-05'::timetz);
ERROR:  date/time field value out of range: "24:00:00.000001-05"

// 24:00:00.000001-05
double d = ((24 * MINS_PER_HOUR + 0) * SECS_PER_MINUTE) + 0 + 0.000001);

postgres=# select * from t;


It displays it correctly, but it doesn't seem like proper behavior.  If I insert 
25:00:00.000000-05, I get nothing:

postgres=# select * from t;

(1 row)

LOG:  execute <unnamed>: INSERT INTO timetz_test VALUES ($1)
DETAIL:  parameters: $1 = 'p£  '

I get no error from libpq.  I think a range check is needed in timetz_recv & 

version: (interger_datetimes=off)
PostgreSQL 8.3devel on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.1 
20070105 (Red Hat 4.1.1-52)



pgsql-hackers by date

Next:From: Bruce MomjianDate: 2007-12-22 05:14:01
Subject: Re: pgsql: Improve wording.
Previous:From: Bruce MomjianDate: 2007-12-22 02:50:08
Subject: Re: New style of hash join proposal

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group