Re: Problem with fixed length fields.

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Problem with fixed length fields.
Дата
Msg-id 417AC2C2.40605@opencloud.com
обсуждение исходный текст
Ответ на Re: Problem with fixed length fields.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Problem with fixed length fields.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-jdbc
Tom Lane wrote:
> Kris Jurka <books@ejurka.com> writes:
>
>>This is a problem with the driver because it is typing the '  ' values as
>>text, not char, so the comparison doesn't work right because these two
>>types handle trailing spaces differently.
>
>
> Can you refrain from assigning a type at all?  People writing the
> equivalent SQL directly would almost always write 'foo', not
> 'foo'::text or 'foo'::char.  The parser's behavior has been tuned
> so that that usually works nicely.

We've been trying to avoid that as there is currently no statement
Describe issued by the driver, so we'd run the risk that the parser
would infer something completely unexpected from the driver's point of
view. Also, we'd need the Describe to get useful information on when a
named statement can be safely reused (the driver currently gets this
wrong anyway, but it's fixable without needing a Describe as it stands).

Adding the Describe would add a round-trip to every query that involved
an unknown type.

Pushing on blindly with a Bind without knowing the actual type of the
parameters you're sending seems possible but dangerous. It'd preclude
using binary-format parameters for unknown types, at a minimum.

-O

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

Предыдущее
От: "Serguei Mokhov"
Дата:
Сообщение: Translation updates: ru.po
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Problem with fixed length fields.