Skip site navigation (1) Skip section navigation (2)

Re: date style bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: felipe(dot)alvarez(at)qlsoft(dot)cl
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: date style bug
Date: 2001-07-23 14:25:24
Message-ID: 14908.995898324@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Felipe Alvarez Harnecker <felipe(at)qlsoft(dot)cl> writes:
> obelix3=> set datestyle=postgres,euro;
> SET VARIABLE

> obelix3=> select * from orden_visita where fecha_emision <= 'today'::date;
> ERROR:  Bad date external representation '07-17-2001'

Since '07-17-2001' is *not* a valid date in Euro convention
(dd-mm-yyyy), I don't see any bug here.

I take it fecha_emision is a text or varchar field that your query is
casting to date on-the-fly.  Perhaps you'd be better advised to use
datatype date (or timestamp) for the field in the first place.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-07-23 15:00:02
Subject: Re: create view bug
Previous:From: Jefim MatskinDate: 2001-07-23 14:13:09
Subject: create view bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group