Re: Tightening binary receive functions

From: James William Pye <lists(at)jwp(dot)name>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tightening binary receive functions
Date: 2010-02-17 03:55:11
Message-ID: A8D44326-2FC6-4BF4-B993-35B5A7481690@jwp.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Nov 10, 2009, at 9:54 AM, Bruce Momjian wrote:

> FYI, Heikki has fixed this bug and the fix will appear in Postgres 8.5.

>> Heikki> Oops, you're right. The check is indeed confusing julian day
>> Heikki> numbers, with epoch at 23th of Nov 4714 BC, with
>> Heikki> postgres-reckoning day numbers, with epoch at 1th of Jan
>> Heikki> 2000. Thanks, will fix.

Need a special case for the infinities as well?

postgres=# create table foo (d date);
CREATE TABLE
postgres=# INSERT INTO foo VALUES ('infinity');
INSERT 0 1
postgres=# COPY foo TO '/Users/jwp/foo.copy' WITH BINARY;
COPY 1
postgres=# COPY foo FROM '/Users/jwp/foo.copy' WITH BINARY;
ERROR: date out of range
CONTEXT: COPY foo, line 1, column d
postgres=# DELETE FROM foo;
DELETE 1
postgres=# INSERT INTO foo VALUES ('-infinity');
INSERT 0 1
postgres=# COPY foo TO '/Users/jwp/foo.copy' WITH BINARY;
COPY 1
postgres=# COPY foo FROM '/Users/jwp/foo.copy' WITH BINARY;
ERROR: date out of range
CONTEXT: COPY foo, line 1, column d

postgres=# SELECT version();
version
---------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.5devel on i386-apple-darwin10.2.0, compiled by GCC i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1), 64-bit
(1 row)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-02-17 04:53:30 Re: [COMMITTERS] pgsql: Clean up package namespace use and use of Safe in plperl.
Previous Message Rayson Ho 2010-02-17 03:14:03 Re: OpenVMS?