Re: select statement fails

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: select statement fails
Дата
Msg-id 47FC9489.50204@archonet.com
обсуждение исходный текст
Ответ на select statement fails  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
Andrus Moor wrote:
> Richard,
>
>> It doesn't return rows because you're using a space-padded type (char)
>> to try and store a space.
>>
>> I think you probably want varchar(1) instead.
>
> thank you.
> I have production database whose schema cannot changed easily.

ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It
will require a lock on the table though.

> I is more reasonable to force npgsql driver to generate other code if no
> other solution.
> npgsql driver wants to add explicit casts to parameters.
> Is it reasonable to force driver to generate code
>
> select * from test where tc=' '::char(1);
>
> for char parameter type ?

I'd say so - I presume it just needs to be taught about different types
of text. Presumably it already knows that int8 is different from int4,
so it'll be doing something similar already. Check if there is a
mailing-list for the npgsql project and ask there - someone might
already be working on it.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: "Ashish Sharma"
Дата:
Сообщение: SQL fast in PSQL, very slow using MS.NET driver
Следующее
От: "Peter Geoghegan"
Дата:
Сообщение: Debugging Pl/PgSQL functions with the debug contrib module