Re: nasty problem with redhat 6.2 + pg 7.02

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: leonbloy(at)sinectis(dot)com(dot)ar
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: nasty problem with redhat 6.2 + pg 7.02
Date: 2000-09-19 16:53:29
Message-ID: 20000919115329.B6108@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Leon -
I can't reproduce this with 7.0.2 on a Debian install, but it smacks
of a timezone problem of some sort. Do you have any other environment
variables set that might affect the interpretation of date/time info?

Note that you've shown us the environment your running the _client_
in. What does the _server_ have set in it's environment? I'm not sure
about RedHat: on Debian, it's set in /etc/postgresql/postgresql.env

Note that I had
to explicitly set "European" to get output that matched yours: just using
"postgres" used US conventions.

Here's my transcript:

test=# create table serv2 (fecha1 date,fecha2 date);
CREATE
test=# insert into serv2 values ('13-01-2000','01-10-2000');
INSERT 712438 1
test=# set datestyle = European;
SET VARIABLE
test=# set datestyle = postgres;
SET VARIABLE
test=# show datestyle;
NOTICE: DateStyle is Postgres with European conventions
SHOW VARIABLE
test=# insert into serv2 values ('13-01-2000','01-10-2000');
INSERT 712439 1
test=# select * from serv2;
fecha1 | fecha2
------------+------------
13-01-2000 | 01-10-2000
13-01-2000 | 01-10-2000
(2 rows)

test=# select version();
version
---------------------------------------------------------------
PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2
(1 row)

test=#

Ross

On Tue, Sep 19, 2000 at 11:37:52AM -0300, leonbloy(at)sinectis(dot)com(dot)ar wrote:
> After more than two years of using postgresql with linux, this
> may turn to be my last frustration; not being able to find the
> problem, and with several thousands of customers that must pay
> on the FIRST day of each month, I find this NASTY; must I
> turn to oracle on solaris, I wonder....
>
> Take a look at this: if you can't spot the problem,
> (I couldn't) at least you should be warned: this
> seems pretty serious.
>
> (using PGDATESTYLE=Postgres )
>
>
> [postgres(at)ren postgres]$ createdb test1
> CREATE DATABASE
> [postgres(at)ren postgres]$ echo "create table serv2 (fecha1 date,fecha2 date);" |
> psql test1
> CREATE
> [postgres(at)ren postgres]$ echo "insert into serv2 values
> ('13-01-2000','01-10-2000');"| psql test1
> INSERT 380928512 1
> [postgres(at)ren postgres]$ echo "select * from serv2;" | psql test1
> fecha1 | fecha2
> ------------+------------
> 13-01-2000 | 30-09-2000
> (1 row)
>
>
> ?????? What's happening here ???
>

--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-09-19 16:59:58 Re: nasty problem with redhat 6.2 + pg 7.02
Previous Message Vince Vielhaber 2000-09-19 16:49:45 Re: Is it possible to search for sub-strings...