Pg subtracts one minute from time
Pg subtracts one minute from time
От:
Barry Stewart <bstewart@smyrnacable.net>
Дата:
Help!
Postgresql subtracts one minute from any times I enter into a database:
mydb=# create table test (timeval time);
CREATE
mydb=# insert into test values ('02:00');
INSERT 22313 1
mydb=# insert into test values ('03:00:00');
INSERT 22314 1
mydb=# insert into test values ('08:30');
INSERT 22315 1
mydb=# select * from test;
timeval
----------
01:59:00
02:59:00
08:29:00
(3 rows)
mydb=#
What am I doing wrong?
Thanks,
Barry
Re: Pg subtracts one minute from time
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Barry Stewart writes: > Postgresql subtracts one minute from any times I enter into a database: Bizarre. What platform are you running on? What Postgres version? What timezone setting (TZ or PGTZ variable) do you use? regards, tom lane
Re: Pg subtracts one minute from time
От:
Barry Stewart <bstewart@smyrnacable.net>
Дата:
I'm using Trustix Secure Linux 1.2 (RedHat based) on a Pentium 200MMX and Postgresql 7.02. How do I check the TZ/PGTZ variables? On the command line, the date command says: Fri Jan 12 11:37:36 EST 2001 Barry On 2001.01.12 11:00:35 -0500 Tom Lane wrote: > Barry Stewart writes: > > Postgresql subtracts one minute from any times I enter into a database: > > Bizarre. What platform are you running on? What Postgres version? > What timezone setting (TZ or PGTZ variable) do you use? > > regards, tom lane >
Re: Pg subtracts one minute from time
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Barry Stewart writes: > I'm using Trustix Secure Linux 1.2 (RedHat based) on a Pentium 200MMX and > Postgresql 7.02. Seems like a fairly vanilla-flavored platform... I'm baffled, to tell you the truth. I sent a heads-up to our date/time maven, Thomas Lockhart, who might have an idea what's going wrong here. > How do I check the TZ/PGTZ variables? On the command > line, the date command says: > Fri Jan 12 11:37:36 EST 2001 Try "echo $TZ" at the command line. Given that date output, I'm guessing that you'll see "EST5EDT". Just for grins, you might try export PGTZ="EST5EDT" before starting psql, and then see if the behavior is the same or not. Probably won't help but it'd be worth making sure. regards, tom lane
Re: Pg subtracts one minute from time
От:
Barry Stewart <bstewart@smyrnacable.net>
Дата:
echo $TZ and echo $PGTZ both came up empty. So I exported both as "EST5EDT" (as root) and restarted postgresql, but still no luck. Thanks for your prompt attention. I'm going to give more info to Thomas, but if you have any more suggestions, let me know. Thanks for your prompt attention, Barry On 2001.01.12 11:50:20 -0500 Tom Lane wrote: > Barry Stewart writes: > > I'm using Trustix Secure Linux 1.2 (RedHat based) on a Pentium 200MMX > and > > Postgresql 7.02. > > Seems like a fairly vanilla-flavored platform... I'm baffled, to tell > you the truth. I sent a heads-up to our date/time maven, Thomas > Lockhart, who might have an idea what's going wrong here. > > > How do I check the TZ/PGTZ variables? On the command > > line, the date command says: > > Fri Jan 12 11:37:36 EST 2001 > > Try "echo $TZ" at the command line. Given that date output, I'm > guessing that you'll see "EST5EDT". Just for grins, you might try > > export PGTZ="EST5EDT" > > before starting psql, and then see if the behavior is the same or not. > Probably won't help but it'd be worth making sure. > > regards, tom lane >