It is possible to extract rows in a table using SELECT name FROM table WHERE name >= 'Bergman'. The problem I have is that I get names like "Berg, Paul" with this query, and I don't want that. Is there documentation on how >= and <= works with varchar fields? Does pg count in the "," character or ignore it? And so on... Version is 7.0.1. /Rolf
Rolf Johansson <rojo@nocrew.org> writes:
> Is there documentation on how >= and <= works with varchar
> fields? Does pg count in the "," character or ignore it?
That depends. If you compiled with --enable-locale then it's
whatever strcoll() says for the locale you are running the
postmaster in. If not, it's whatever strcmp() says, which is
normally plain ASCII collation order.
Note: beware of changing the postmaster's locale on the fly;
this can leave your indexes on textual columns out of order and
hence effectively corrupt. You can fix that by dropping/rebuilding
such indexes, or with REINDEX.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера