Re: Custom Base Type in C

Поиск
Список
Период
Сортировка
От David Wilson
Тема Re: Custom Base Type in C
Дата
Msg-id e7f9235d0805071612j5ae043co56fb99287f24ced9@mail.gmail.com
обсуждение исходный текст
Ответ на Custom Base Type in C  ("Toby Chavez" <odnamr@gmail.com>)
Ответы Re: Custom Base Type in C
Список pgsql-general
On Wed, May 7, 2008 at 7:06 PM, Toby Chavez <odnamr@gmail.com> wrote:

> 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?

Is there any particular reason why this needs to be done in C? Why not
just create the type normally as per:

CREATE TYPE my_transition_type AS (a bigint, b text);

And then create your aggregate function using that type?

I can't help you with the C stuff, but you may be making far more work
for yourself than you really need.

--
- David T. Wilson
david.t.wilson@gmail.com

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

Предыдущее
От: "Toby Chavez"
Дата:
Сообщение: Custom Base Type in C
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Custom Base Type in C