Thread: Time problem

Time problem

From
"Jaya Swarup"
Date:
Hi All,
I have installed postgres 7.1.3 as database.

For my application I have used timestamp as the datatype for date and time.

I am facing the following problem:

1) While inserting data, I do not have any trouble and the time taken is the
system time.
2) In the console when I select data it shows me the correct time.
3) BUT, when I am retrieving data from the sql query (code) and displaying
it, it is inexplicably ahead of the System time by exactly 30 mins.
4) I have tried setting the TIME ZONE variable to all possible combinations
as mentioned in the documentation. But even then if I ask the system to SHOW
TIME ZONE, it says "TIME ZONE IS UNKNOWN".
5) I have tried to find and set the environment variable, but again to no
avail.

I need help to sort this out, since it is throwing my otherwise sensible
application out of gear.

Regards
Jaya


Re: Time problem

From
Tom Lane
Date:
"Jaya Swarup" <jayas@bsil.com> writes:
> 3) BUT, when I am retrieving data from the sql query (code) and displaying
> it, it is inexplicably ahead of the System time by exactly 30 mins.

Sure sounds like you are running in some odd time zone.

> 4) I have tried setting the TIME ZONE variable to all possible combinations
> as mentioned in the documentation. But even then if I ask the system to SHOW
> TIME ZONE, it says "TIME ZONE IS UNKNOWN".

This is bizarre.  Exactly what platform are you running on, and exactly
which "possible combinations" have you tried?

            regards, tom lane

Postgres Log Rolling

From
Naomi Walker
Date:
This should be an easy one, but......

We need to start rolling our postgres error logs.  I wondered whether or
not I could pull the rug out from under postgres by just renaming the
pgsql.log to 'date'.log and then recreating (touch pgsql.log) the log.

I then vacuum'd a database (so it would write stuff in the log), and
noticed that the renamed log ('date'.log) was the one written to, not the
new pgsql.log.

Do I have to bounce the cluster to roll the log?   How should I be
performing this task?

--
Naomi Walker
Chief Information Officer
Eldorado Computing, Inc.
602-604-3100  ext 242


Re: Postgres Log Rolling

From
Tom Lane
Date:
Naomi Walker <nwalker@eldocomp.com> writes:
> Do I have to bounce the cluster to roll the log?   How should I be
> performing this task?

There's some discussion of this point in the 7.2 docs:
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/logfile-maintenance.html

            regards, tom lane