Thread: Timezones on HPUX

Timezones on HPUX

From
"Gilbert Wong"
Date:
I am running PostgreSQL 7.0.3 on HPUX 11.0.  I get the expected behavior if
my PGTZ environment variable is not set:

select current_timestamp;

       timestamp
------------------------
2001-05-29 12:56:16-04
(1 row)


The I ran the date command in the shell and received the following output:

Tue May 29 09:57:09 PDT 2001

I have my TZ enviornment set to the correct value PST8PDT.  When I set the
PGTZ variable to PST8PDT, I also get the correct time output:

select current_timestamp;

       timestamp
------------------------
2001-05-29 09:58:26-07
(1 row)


So this works fine if I'm using psql.  However, I am using PostgreSQL in
conjunction with AOLServer and I get the incorrect date/time when I run the
current_timestamp query from a .tcl page in AOLServer.

Here is a snippet from my init.d script:

su - $PGUSER -c "$PGHOME/bin/pg_ctl -o '$PGOPTS' -D $PGHOME/data start"

Is there any way I can pass the PGTZ variable when I execute this script?
Thanks.

Gilbert








_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Re: Timezones on HPUX

From
Tom Lane
Date:
"Gilbert Wong" <gilwong@hotmail.com> writes:
> [ doesn't like the default timezone ]

Try setting TZ in the postmaster's environment.  Note this is not the
same as your client program's environment.  Also check to see if
AOLServer is sending a timezone-set command when it connects; if
plain psql shows the desired timezone and AOLServer is getting different
results, then it's certainly the latter.

            regards, tom lane