Re: valid use of wildcard

From: Irene Barg <ibarg(at)noao(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Klint Gore <kgore4(at)une(dot)edu(dot)au>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: valid use of wildcard
Date: 2008-11-03 17:39:32
Message-ID: 490F3754.7030802@noao.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The 'real' problem was the database had not been re-indexed in a long
while (it is a test system). After re-indexing the db, the query below
ran fairly quicky:

>>> metadata=# SELECT * FROM viewspace.siap AS t WHERE
>>> t."startDate"='2008-10-27%' AND t.prop_id LIKE '%' LIMIT 1000;

The 'startDate' is a timestamp. I was just questioning the use of the
'=' operator with '%' instead of LIKE. I would have expected the '=' to
take the '%' as a literal.

Thanks Tom, Klint and Scott. I learned some debugging tips from this post.

--irene

Tom Lane wrote:
> Klint Gore <kgore4(at)une(dot)edu(dot)au> writes:
>> Surprisingly, '2008-10-27%' casts to a date in 8.3.3.
>
> Yeah, the datetime input code is pretty willing to overlook unexpected
> punctuation. There are enough odd formats out there that I'm not sure
> tightening it up would be a good idea.
>
> regards, tom lane

--
---------------------------------------------------------------------
Irene Barg Email: ibarg(at)noao(dot)edu
NOAO/AURA Inc. http://www.noao.edu/noao/staff/ibarg
950 N. Cherry Ave. Voice: 520-318-8273
Tucson, AZ 85726 USA FAX: 520-318-8360
---------------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-03 17:50:14 Re: Error en generar base espacial
Previous Message Eduardo Arévalo 2008-11-03 17:28:24 Error en generar base espacial