return error from date_part

Started by PostgreSQL Bugs Listabout 25 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Antonio Murillo (toni-m@usa.net) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
return error from date_part

Long Description
I've Postgres 7.02, run in Linux "RedHat 7.0 i386".
When I have a specific select, only whitch this date return a error.

"SELECT date_part('day',fecha) AS day FROM fecha;

day | fecha
-----+------------
24 | 2001-03-25
(1 row)

Sample Code
SET DATESTYLE TO 'European';
CREATE TABLE "fecha" (
"idfecha" int4 NOT,
"fecha" date
);
INSERT into fecha (idfecha,fecha) VALUES(1,'25/3/2001');
SELECT date_part('day',fecha) AS day FROM fecha;

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: return error from date_part

pgsql-bugs@postgresql.org writes:

When I have a specific select, only whitch this date return a error.

"SELECT date_part('day',fecha) AS day FROM fecha;

day | fecha
-----+------------
24 | 2001-03-25
(1 row)

Is that a daylight-savings-time transition day in your timezone?
If so, this is a known bug in date-to-timestamp conversion (try
"SELECT fecha::timestamp" to see what's going on).

It's fixed in 7.1.

regards, tom lane