Custom conversion

Started by Yuri Gordienkoabout 18 years ago2 messagesgeneral
Jump to latest
#1Yuri Gordienko
Uriy.Gordienko@software.systema.com.ua

Hi,

How can I make custom conversion? The postgres-documentation can't help
me :(

I'm find this only, but without any examples:

http://www.postgresql.org/docs/8.3/interactive/sql-createconversion.html

CREATE [ DEFAULT ] CONVERSION name
FOR source_encoding TO dest_encoding FROM funcname

The function must have the following signature:
conv_proc(
integer, -- source encoding ID
integer, -- destination encoding ID
cstring, -- source string (null terminated C string)
internal, -- destination (fill with a null terminated C string)
integer -- source string length
) RETURNS void;

How can I make this conv_proc function?

Thank's

--
The best regards
Yuri Gordienko

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Yuri Gordienko (#1)
Re: Custom conversion

Yuri Gordienko <Uriy.Gordienko@software.systema.com.ua> writes:

How can I make custom conversion? The postgres-documentation can't help
me :(

I'd suggest you start by copying-and-pasting one of the existing
conversion functions. Look under src/backend/utils/mb/conversion_procs/
in the source distribution.

regards, tom lane