Re: returning CHAR from C function
| От | Joe Conway |
|---|---|
| Тема | Re: returning CHAR from C function |
| Дата | |
| Msg-id | 3DE94DE2.6020903@joeconway.com обсуждение исходный текст |
| Ответ на | returning CHAR from C function (elein <elein@sbcglobal.net>) |
| Ответы |
Re: returning CHAR from C function
|
| Список | pgsql-general |
elein wrote:
> create function retchar(text)
> returns char
> as '$libdir/retchar.so'
> language 'c';
>
I get similar results.
It looks like the cause is that in the create function statement above the
"returns char" is interpreted as returning type 1042 (==bpchar), instead of
type 18 (==char), which is what you need (and intended). I'm not sure what the
proper way to define a function returning type char is, but I did this:
regression=# update pg_proc set prorettype = 18 where proname = 'retchar';
UPDATE 1
regression=# select retchar('abc');
retchar
---------
a
(1 row)
then the function works fine :-)
Joe
В списке pgsql-general по дате отправления: