Search Postgresql Archives

selfmade datatype in C and server-crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux