selfmade datatype in C and server-crash

Поиск
Список
Период
Сортировка
От Markus Schulz
Тема selfmade datatype in C and server-crash
Дата
Msg-id 200510042204.07141.msc@antzsystem.de
обсуждение исходный текст
Ответы Re: selfmade datatype in C and server-crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,
i'm trying to develop a selfmade pg-datatype derived from type text (at
first) with postgresql 7.4.7.
At first i have taken the original code from textin and textout
($SRC/backend/utils/adt/varlena.c) and compiled them renamed to etextin
and etextout into new .so file.
This works fine and then i've created the new Type like:

CREATE OR REPLACE FUNCTION etextin(cstring)
  RETURNS etext AS
'$libdir/new_types.so', 'etextin'
  LANGUAGE 'c' VOLATILE;

CREATE OR REPLACE FUNCTION etextout(etext)
  RETURNS cstring AS
'$libdir/new_types.so', 'etextout'
  LANGUAGE 'c' VOLATILE;

CREATE TYPE etext (
    INPUT = etextin,
    OUTPUT = etextout,
    INTERNALLENGTH = -1,
    ALIGNMENT=int4,
    STORAGE=EXTENDED
    );

this works also.

But if i'm trying to use the type in a table (for instance table with
only one etext column) the server crashed after inserting the second
(first insert works) tuple or on every select.

What i've missed or doing wrong? Are there any HowTo's on this topic?



--
Markus Schulz

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

Предыдущее
От: Richard_D_Levine@raytheon.com
Дата:
Сообщение: Fw: License question
Следующее
От: "Welty, Richard"
Дата:
Сообщение: Re: License question[VASCL:A1077160A86]