Re: Collation rules and multi-lingual databases

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Collation rules and multi-lingual databases
Дата
Msg-id Pine.LNX.4.44.0308230055530.3377-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: Collation rules and multi-lingual databases  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Greg Stark writes:

> This is my first C function so I'm really unsure that I've done the right
> thing. For the most part I pattern-matched off the string_io code in the
> contrib directory.

That was just about the worst example you could have picked.  Please
forget everything you have seen and start by reading the documentation.
In particular, learn about the version 1 call convention and about the
PostgreSQL license.  And read some code under src/backend/utils/adt.

> In particular I'm unsure about the code postgres-interfacing code in
> c_varcharxfrm which makes an extra copy of both parameters that are passed in
> and an extra copy of the result value. Are varchars guaranteed to be
> nul-terminated?

They are guaranteed not to be null-terminated.

> But more generally. Would it make more sense to use text or bytea or something
> else to store these opaque binary strings? At least with glibc they tend to be
> unreadable anyways.

bytea

> If it's deemed a reasonable approach and nobody has any fatal flaws then I
> expect it would be useful to put in the contrib directory?

I'd expect it to be too slow to be useful.  Have you run performance tests?

-- 
Peter Eisentraut   peter_e@gmx.net



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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Single-file DBs WAS: Need concrete "Why Postgres
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Collation rules and multi-lingual databases