writing custom data type

From: Arthur Chan <achan(at)comprehend(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: writing custom data type
Date: 2013-02-01 20:27:25
Message-ID: CAAP2MxJ64q1Us3pTGQOA1016tO9pyow07xEMsPaZNmeiJm1WOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hey Guys,

I've been having trouble writing my own custom datatype for PG. when I do
my `CREATE FUNCTION` call, it fails with:

resultsets=# CREATE FUNCTION fuzzytime_in(cstring)
RETURNS fuzzytime
AS 'fuzzytimetype'
LANGUAGE C IMMUTABLE STRICT;
NOTICE: return type fuzzytime is only a shell
ERROR: could not find function "fuzzytime_in" in file
"/usr/lib/postgresql/9.1/lib/fuzzytimetype.so"

--

now I checked my shared lib, and surely enough, it's there

$ objdump -t /usr/lib/postgresql/9.1/lib/fuzzytimetype.so
...
00000000000018b0 g F .text 0000000000000070 fuzzytime_in
...

--

So what gives? The code has PG_MODULE_MAGIC, and I'm
calling PG_FUNCTION_INFO_V1(fuzzytime_in);

I'd really appreciate any help with this.

Cheers,
Arthur Chan

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2013-02-01 20:58:29 Re: writing custom data type
Previous Message Kevin Grittner 2013-02-01 13:54:31 Re: Installation 8.4 > 9.1