postgresql - Do text_pattern_ops comparators understand UTF-8? -
according postgresql 9.2 documentation, if using locale other c locale (en_us.utf-8 in case), btree indexes on text columns supporting queries
select * my_table text_col 'abcd%'
need created using text_pattern_ops
so
create index my_idx on my_table (text_col text_pattern_ops)
now section 11.9 of documentation states results in "character character" comparison. these (non-wide) c characters or comparison understand utf-8?
good question, i'm not totally sure tentative understanding is:
here postgresql means "real characters" (eventually multibyte), not bytes. comparison "understands utf-8" always, or without special index.
the point that, locales have special (non c) collation rules, want follow rules (and call respective locale libraries) when doing comparisons ( <
, >
...) , sorting. don't want use collations posix regular matching , patterns. hence existence of 2 different types of indexes text.
Comments
Post a Comment