Problems with output function of new datatype!

Поиск
Список
Период
Сортировка
От subhash@nmsu.edu
Тема Problems with output function of new datatype!
Дата
Msg-id 1100648017.419a8e516a90b@webmail.nmsu.edu
обсуждение исходный текст
Ответы Re: Problems with output function of new datatype!  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
hi,
I have programmed a rational datatype and provided it with an output function
rational_out. 
The output function takes a rational data type as input and returns cstring as
output. 
The postgres is giving an error 

server closed the connection unexpectedly       This probably means the server terminated abnormally       before or
whileprocessing the request.
 
The connection to the server was lost. Attempting reset: Failed.
!>

The real problem starts here: when i use the function as    select rational_out(rational_type) from testtable; 
it works fine and returns a cstring. But when i execute    select rational_type from testtable;
then it dies with the error i mentioned before. Why is it happeneing?
But the input function which takes a cstring as input is working fine.


I have initialised the datatype as:
CREATE OR REPLACE FUNCTION frational_in(cstring) RETURNS frational AS
'/root/pgsql/hier_farey/lib/libfrational.so.1' LANGUAGE C;
CREATE OR REPLACE FUNCTION frational_out(frational) RETURNS cstring AS
'/root/pgsql/hier_farey/lib/libfrational.so.1' LANGUAGE C;
CREATE OR REPLACE FUNCTION frational_in(cstring) RETURNS frational AS
'/root/pgsql/lib/libfrational.so.1' LANGUAGE C;
CREATE OR REPLACE FUNCTION frational_out(frational) RETURNS cstring AS
'/root/pgsql/lib/libfrational.so.1' LANGUAGE C;


Please help me out with this one,
thanks,
subhash.


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Concern about new PL/Perl
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [PATCHES] plperl Safe restrictions