ecpg and the timezone database

Started by Bruce Momjianover 21 years ago7 messages
#1Bruce Momjian
pgman@candle.pha.pa.us

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
#2Magnus Hagander
mha@sollentuna.net
In reply to: Bruce Momjian (#1)
Re: 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.

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

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#1)
Re: ecpg and the timezone database

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

#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Andrew Dunstan (#3)
Re: ecpg and the timezone database

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
#5Michael Meskes
meskes@postgresql.org
In reply to: Bruce Momjian (#1)
Re: [HACKERS] ecpg and the timezone database

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!

#6Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Michael Meskes (#5)
Re: [HACKERS] ecpg and the timezone database

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
#7Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Michael Meskes (#5)
Re: [HACKERS] ecpg and the timezone database

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