Re: nasty problem with redhat 6.2 + pg 7.02

From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
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:36:22
Message-ID: 39C79606.8E366767@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

leonbloy(at)sinectis(dot)com(dot)ar wrote:
> [postgres(at)ren postgres]$ echo "select * from serv2;" | psql test1
> fecha1 | fecha2
> ------------+------------
> 13-01-2000 | 30-09-2000
> (1 row)

> ?????? What's happening here ???

I can't duplicate:
test=# SET datestyle=postgres;
SET VARIABLE
test=# create table serv2 (fecha1 date, fecha2 date);
CREATE
test=# insert into serv2 values ('13-01-2000','01-10-2000');
INSERT 407754 1
test=# select * from serv2;
fecha1 | fecha2
------------+------------
01-13-2000 | 01-10-2000
(1 row)

test=#
System is RedHat 6.2 with the PostgreSQL 7.0.2-2 RPMset loaded. Hmmm,
but 13-01-2000 got flipped to 01-13-2000, and 01-10-2000 didn't flip...
Now that is strange.

Let's try something...
test=# delete from serv2;
DELETE 1
test=# insert into serv2 values ('10-01-2000','01-10-2000');
INSERT 407765 1
test=# select * from serv2;
fecha1 | fecha2
------------+------------
10-01-2000 | 01-10-2000
(1 row)

Nope, still right.
Hmmm, if I insert '30-09-2000', I get:
test=# select * from serv2;
fecha1 | fecha2
------------+------------
01-13-2000 | 09-30-2000
(1 row)

Now, this is with DATESTYLE set within the psql session using 'set
datestyle' -- let's try the PGDATESTYLE variable...
[lowen(at)utility www]$ export PGDATESTYLE=Postgres
[lowen(at)utility www]$ psql -c "delete from serv2" test
DELETE 1
[lowen(at)utility www]$ psql -c "insert into serv2 values
('13-01-2000','01-10-2000')" test
INSERT 407808 1
[lowen(at)utility www]$ psql -c "select * from serv2" test
fecha1 | fecha2
------------+------------
01-13-2000 | 01-10-2000
(1 row)

[lowen(at)utility www]$

Still the same results as earlier.

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vince Vielhaber 2000-09-19 16:49:45 Re: Is it possible to search for sub-strings...
Previous Message Tom Lane 2000-09-19 16:24:01 Re: Re[2]: WTF is going on with PG_VERSION?