ecpg and the timezone database
Does ecpg need to use the same timezone database as the backend?
I just committed code so it will not, but I am not sure.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Does ecpg need to use the same timezone database as the backend?
I just committed code so it will not, but I am not sure.
I think it should not use it, for the following reasons:
* When ecpg is used to write a program, this is a client program. I'd
expect a client program to follow the timezone rules of the client (and
other rules), and not the server. And it has to interface with any
amount of other code that is linked only against the normal timezone
libraries on the client.
* Ecpg is used to write client programs. If it used the "special pg
timezone library", every client program written using ecpg would have to
ship with the pg *timezone database* as well. I'm sure that's now what
you'd want.
But then again, I don't use ecpg myself, so others may certainly have
better arguments in either direction.
//Magnus
Import Notes
Resolved by subject fallback
Bruce Momjian said:
Does ecpg need to use the same timezone database as the backend?
I just committed code so it will not, but I am not sure.
surely all clients should be utterly ignorant of what the backend uses?
cheers
andrew
Andrew Dunstan wrote:
Bruce Momjian said:
Does ecpg need to use the same timezone database as the backend?
I just committed code so it will not, but I am not sure.
surely all clients should be utterly ignorant of what the backend uses?
OK, just asking the question to be sure. I was a little concerned that
ecpg would be looking at some binary data from the backend and trying to
do some timezone comparison on it.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
On Fri, Apr 30, 2004 at 04:48:33PM -0400, Bruce Momjian wrote:
Does ecpg need to use the same timezone database as the backend?
I have to check what you changed. ecpg itself does not use the timezone
database, but some of that code is used in pgtypeslib.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
Michael Meskes wrote:
On Fri, Apr 30, 2004 at 04:48:33PM -0400, Bruce Momjian wrote:
Does ecpg need to use the same timezone database as the backend?
I have to check what you changed. ecpg itself does not use the timezone
database, but some of that code is used in pgtypeslib.
Yea, that's where I saw it used.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Michael Meskes wrote:
On Fri, Apr 30, 2004 at 04:48:33PM -0400, Bruce Momjian wrote:
Does ecpg need to use the same timezone database as the backend?
I have to check what you changed. ecpg itself does not use the timezone
database, but some of that code is used in pgtypeslib.
For changes see include/port.h:
#define localtime(timep) pg_localtime(timep)
#define gmtime(timep) pg_gmtime(timep)
#define asctime(timep) pg_asctime(timep)
#define ctime(timep) pg_ctime(timep)
#define difftime(t1,t2) pg_difftime(t1,t2)
#define mktime(tm) pg_mktime(tm)
#define tzset pg_tzset
Right now it is only Win32, but there are plans to use this for all
ports.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073