selfmade datatype in C and server-crash

From: Markus Schulz <msc(at)antzsystem(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: selfmade datatype in C and server-crash
Date: 2005-10-04 20:04:06
Message-ID: 200510042204.07141.msc@antzsystem.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard_D_Levine 2005-10-04 20:04:24 Fw: License question
Previous Message Jeff MacDonald 2005-10-04 19:46:53 a bug, the bugs list, and how to break the website search.