Re: Tightening binary receive functions - Mailing list pgsql-hackers

From James William Pye
Subject Re: Tightening binary receive functions
Date
Msg-id A8D44326-2FC6-4BF4-B993-35B5A7481690@jwp.name
Whole thread Raw
In response to Re: Tightening binary receive functions  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Tightening binary receive functions
List 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.5develon i386-apple-darwin10.2.0, compiled by GCC i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
(dot1), 64-bit 
(1 row)



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: OpenVMS?
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Clean up package namespace use and use of Safe in plperl.