Re: Data comparison SQL in PG 8.2.9

From: "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>
To: "Thomas Markus" <t(dot)markus(at)proventis(dot)net>
Cc: "PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Data comparison SQL in PG 8.2.9
Date: 2009-01-12 08:40:22
Message-ID: e373d31e0901120040o78fac653qca7b40df5b1f9307@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/1/12 Thomas Markus <t(dot)markus(at)proventis(dot)net>:
> be sure to use correct data types. I suppose psql uses timestamps so
>
> select id from users where modify_date = '2009-01-08' limit 1;
>
> is converted to
>
> select id from users where modify_date = '2009-01-08 00:00:00'::timestamp
> limit 1;
>
>
> try
>
> select id from users where modify_date::date = '2009-01-08'::date limit 1;

Thanks. But it used to work without this, and more importantly, this
doesn't explain why the ">" queries are so exceedingly slow now! Any
thoughts?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Markus 2009-01-12 09:03:09 Re: Data comparison SQL in PG 8.2.9
Previous Message Thomas Markus 2009-01-12 07:05:20 Re: Data comparison SQL in PG 8.2.9