Commit 0acd5efe authored by Eric Marsden's avatar Eric Marsden

Fix to timezone handling when parsing timestamps (timezone offset can

be negative).

From Katsuya Tomioka.
parent de5acca9
......@@ -30,3 +30,12 @@ Brian Mastenbrook:
Risto Sakari Laakso:
Provided a parser for the NUMERIC type
Andreas Fuchs
Patch to allow connection via a unix socket with SBCL
Katsuya Tomioka
Patch to timezone handling in timestamp parsing
(apologies for people who have been forgotten in this file)
pg.lisp -- socket level interface to the PostgreSQL RDBMS for Common Lisp
Author: Eric Marsden <eric.marsden@free.fr>
Time-stamp: <2005-07-17 emarsden>
Time-stamp: <2005-12-19 emarsden>
Version: 0.22
Copyright (C) 1999,2000,2001,2002,2003,2004 Eric Marsden
Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Eric Marsden
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -244,16 +244,16 @@ pg.lisp -- socket level interface to the PostgreSQL RDBMS for Common Lisp
end of the tunnel, since pg.lisp defaults to this value.
This code has been tested or reported to work with
At various times, this code has been tested or reported to work with
* CMUCL 18d, 18e, 19a on Solaris/SPARC and Linux/x86
* SBCL 0.9.2 on Linux/x86
* CMUCL 18d, 18e, 19a, 19c on Solaris/SPARC and Linux/x86
* SBCL 0.9.2 to 0.9.7 on Linux/x86
* CLISP 2.30 on LinuxPPC and SPARC
* OpenMCL 0.13.x and 0.14.x on LinuxPPC
* Armed Bear Common Lisp
* ACL 6.1 trial/x86
* Lispworks 4.3 on Linux and Windows
* PostgreSQL versions 6.5, 7.0, 7.1.2, 7.2, 7.3, 7.4, 8.0
* PostgreSQL versions 6.5, 7.0, 7.1.2, 7.2, 7.3, 7.4, 8.0, 8.1
You may be interested in using "pg-psql" by Harley Gorrell, which
......
;;; parsers.lisp -- type coercion support
;;;
;;; Author: Eric Marsden <emarsden@laas.fr>
;;; Author: Eric Marsden <eric.marsden@free.fr>
;;
;;
;; When returning data from a SELECT statement, PostgreSQL starts by
......@@ -65,6 +65,7 @@ Needed to define the type of objects in pg-prepare")
(defvar *type-parsers*
`(("bool" . ,'bool-parser)
("bytea" . ,'identity)
("char" . ,'text-parser)
("char2" . ,'text-parser)
("char4" . ,'text-parser)
......@@ -76,7 +77,11 @@ Needed to define the type of objects in pg-prepare")
("int2" . ,'integer-parser)
("int4" . ,'integer-parser)
("int8" . ,'integer-parser)
;; int2vector
("oid" . ,'integer-parser)
;; oidvector
;; bit
;; varbit
("float4" . ,'float-parser)
("float8" . ,'float-parser)
("money" . ,'text-parser) ; "$12.34"
......@@ -153,7 +158,7 @@ Needed to define the type of objects in pg-prepare")
(minutes (parse-integer str :start 14 :end 16))
(seconds (parse-integer str :start 17 :end 19))
(length (length str))
(start-tz (if (eql #\+ (char str (- length 3)))
(start-tz (if (find (char str (- length 3)) "+-")
(- length 3)))
(tz (when start-tz
(parse-integer str :start start-tz)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment