Re: [PATCH] backend: compare word-at-a-time in bcTruelen

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Дата
Msg-id 6829.1245333597@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: [PATCH] backend: compare word-at-a-time in bcTruelen  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> Why is bcTruelen being called so many *more* times?

I think you have misunderstood the context.  The char(n) code is defined
to store trailing blanks (up to n) but to disregard the trailing blanks
during comparisons.  bcTrueLen is invoked during comparisons (not during
storage) to figure out what the "valid" string length is for comparing.

varchar considers any trailing blanks to be real, comparable data,
so it simply hasn't got any equivalent code.

It would be way nicer if we could strip trailing blanks on storage,
and then figure a way to either reconstitute them on output (problem
here is the output function doesn't have access to typmod) or
language-lawyer our way to deciding we don't have to.
        regards, tom lane


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

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [PATCH] backend: compare word-at-a-time in bcTruelen