Re: select statement fails

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: select statement fails
Дата
Msg-id ftkiap$2fco$1@news.hub.org
обсуждение исходный текст
Ответ на select statement fails  ("Andrus" <kobruleht2@hot.ee>)
Ответы Re: select statement fails
Re: select statement fails
Re: select statement fails
Список pgsql-general
Albe,

>> select * from test where tc=' '::text;
>Because the arguments to the operator "=" are of different type,
>implicit type conversion takes place.
>"character(1)" will by converted to "text", during this conversion
>trailing blanks will be ignored, as befits the "character(n)" type.

Thank you.

1. SQL assumes that CHARACTER(n) column is always padded with spaces in
right.
So casting to text should preserve spaces.
Why PostgreSQL cast to text violates SQL ?

2.

create table test ( tc char(1) );
create index tc on test(tc);
select * from test where tc='x'::text;

I'm afraid that if test table has large number of rows, PostgreSQL is not
capable to use index for this query doe to the cast to text.
Is it so ?

Andrus.



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

Предыдущее
От: CMOS
Дата:
Сообщение: how to use postgre sql from inside process
Следующее
От: Dan99
Дата:
Сообщение: Re: slow pgsql tables - need to vacuum?