Re: Select question - Mailing list pgsql-sql

From Tom Lane
Subject Re: Select question
Date
Msg-id 15035.990634710@sss.pgh.pa.us
Whole thread Raw
In response to Select question  ("Chris Ruprecht" <chrup999@yahoo.com>)
List pgsql-sql
"Chris Ruprecht" <chrup999@yahoo.com> writes:
> phone=# select * from phonelog where cdate > 2001-05-18 order by cdate limit
> 2 ;

Try

select * from phonelog where cdate > '2001-05-18' order by cdate limit 2

I think it's interpreting your query as where cdate > 1978 (result of
integer subexpression) and then doing some weird integer-to-date
conversion.  In general, any constant of a non-numeric datatype needs
to be quoted in SQL queries.
        regards, tom lane


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Select question
Next
From: Tom Lane
Date:
Subject: Re: index/join madness