Re: nasty problem with redhat 6.2 + pg 7.02 - Mailing list pgsql-general

From Ross J. Reedstrom
Subject Re: nasty problem with redhat 6.2 + pg 7.02
Date
Msg-id 20000919115329.B6108@rice.edu
Whole thread Raw
In response to nasty problem with redhat 6.2 + pg 7.02  (leonbloy@sinectis.com.ar)
List 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@sinectis.com.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@ren postgres]$ createdb  test1
>  CREATE DATABASE
>  [postgres@ren postgres]$ echo "create table serv2 (fecha1 date,fecha2 date);" |
> psql test1
>  CREATE
>  [postgres@ren postgres]$ echo "insert into serv2 values
> ('13-01-2000','01-10-2000');"| psql test1
>  INSERT 380928512 1
>  [postgres@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@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

pgsql-general by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: Is it possible to search for sub-strings...
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: nasty problem with redhat 6.2 + pg 7.02