Re: valid use of wildcard

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: valid use of wildcard
Дата
Msg-id dcc563d10810291956pf6c0e7cpc8a8f50c53fd6ae7@mail.gmail.com
обсуждение исходный текст
Ответ на valid use of wildcard  (Irene Barg <ibarg@noao.edu>)
Ответы Re: valid use of wildcard  (Klint Gore <kgore4@une.edu.au>)
Список pgsql-general
On Wed, Oct 29, 2008 at 5:04 PM, Irene Barg <ibarg@noao.edu> wrote:
> Hi,
>
> Is the following query a valid use of the 'wildcard' in (='2008-10-27%')?
>
>> [arcsoft@dsan4 arcsoft]$ psql metadata
>> Password: Welcome to psql 8.1.9, the PostgreSQL interactive terminal.
>>
>> metadata=# SELECT * FROM viewspace.siap AS t WHERE
>> t."startDate"='2008-10-27%' AND t.prop_id LIKE '%' LIMIT 1000;
>
> Causes the %CPU to jump and process lingers for over an hour.

Bad move.  dates aren't strings, and their format can change based on
what you've got set for datestyle.

If you want a start date (that's a date or a timestamp) then use the
proper operators

where startDate='2008-10-27'

If startDate is a text / varchar type then you need to change it to a
date.  storing dates in strings is bad.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Can't restart Postgres
Следующее
От: Eus
Дата:
Сообщение: Why Postgresql Public Schema Is Not Owned By The DB Owner By Default