Custom Base Type in C - Mailing list pgsql-general

From Toby Chavez
Subject Custom Base Type in C
Date
Msg-id a2987f9e0805071606j5727377k7ed03f4128165b0@mail.gmail.com
Whole thread Raw
Responses Re: Custom Base Type in C  ("David Wilson" <david.t.wilson@gmail.com>)
Re: Custom Base Type in C  (Alvaro Herrera <alvherre@commandprompt.com>)
Using a composite SQL type in C  ("Dan \"Heron\" Myers" <heron@xnapid.com>)
Re: Custom Base Type in C  (Dimitri Fontaine <dim@hi-media.com>)
List pgsql-general
I have been trying to created a custom base type in C to use as a state transition variable for some aggregate functions. By following the documentation I haven't been able to do much but crash postgres :) I can compile and run the complex example from the tutorial just fine so I guess that means I am compiling correctly.

My custom type needs to have one biginteger and one text value... pretty straight forward. I guess my first question is if there are any examples out there that do something similar. I have looked extensively through the contrib directory and can't find anything very helpful. If not, could someone help me understand what my c struct would look like and what values I need for INTERNALLENGTH, ALIGNMENT, STORAGE, etc in the CREATE TYPE command?

Thanks a ton,

Toby

pgsql-general by date:

Previous
From: "John Smith"
Date:
Subject: Re: Backup/Restore of single table in multi TB database
Next
From: "David Wilson"
Date:
Subject: Re: Custom Base Type in C