Re: nasty problem with redhat 6.2 + pg 7.02

Поиск
Список
Период
Сортировка
От Lamar Owen
Тема Re: nasty problem with redhat 6.2 + pg 7.02
Дата
Msg-id 39C79606.8E366767@wgcr.org
обсуждение исходный текст
Ответ на nasty problem with redhat 6.2 + pg 7.02  (leonbloy@sinectis.com.ar)
Ответы Re: nasty problem with redhat 6.2 + pg 7.02  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Re: nasty problem with redhat 6.2 + pg 7.02  ("Roderick A. Anderson" <raanders@altoplanos.net>)
Re: nasty problem with redhat 6.2 + pg 7.02  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
leonbloy@sinectis.com.ar wrote:
>  [postgres@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@utility www]$ export PGDATESTYLE=Postgres
[lowen@utility www]$ psql -c "delete from serv2" test
DELETE 1
[lowen@utility www]$ psql -c "insert into serv2 values
('13-01-2000','01-10-2000')" test
INSERT 407808 1
[lowen@utility www]$ psql -c "select * from serv2" test
   fecha1   |   fecha2
------------+------------
 01-13-2000 | 01-10-2000
(1 row)

[lowen@utility www]$

Still the same results as earlier.

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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re[2]: WTF is going on with PG_VERSION?
Следующее
От: Vince Vielhaber
Дата:
Сообщение: Re: Is it possible to search for sub-strings...