Re: User defined data type

From: Don Y <pgsql(at)DakotaCom(dot)Net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: User defined data type
Date: 2006-04-05 16:01:56
Message-ID: 4433E9F4.50303@DakotaCom.Net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Don Y <pgsql(at)DakotaCom(dot)Net> writes:
>> Yeah, I was hoping someone would have built a template for
>> new types that trimmed everything down to a single page/file
>> instead of having to snoop the source tree. :-(
>
> The various new types in contrib/ are there in part to serve as models.

Yes, but they don't appear to be maintained. E.g., I had to stumble
on the proper usage of:

PG_FUNCTION_INFO_V1(foo)
Datum foo(PG_FUNCTION_ARGS)
PG_GETARG_*(#)
PG_RETURN_*(baz)
errdetail
ERRCODE_INVALID_TEXT_REPRESENTATION (vs. the error code used in
the contributed code)

In addition to requiring clarification of the questions posed
previously.

No big deal. But, it would have saved a little time and
gone a long way towards improving my confidence that my
first implementation would work "as is"...

Obviously, the goal is (should be?) to produce code that can
be contributed back "as is" without having someone spend time
tweeking it to fit the "right" way of doing things. :-/

I'll see what else I can learn in the remaining data types
that I have to build and then cobble together a template
or an article to hopefully make this a bit more straightforward
(at least so that it tells folks what information they need
to ferret out of man pages, etc.)

> You could also look on pgfoundry and gborg to see other examples.

Ah, haven't even poked around in those areas! Thnks!
--don

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2006-04-05 16:05:34 Re: Oracle outer join syntax
Previous Message Csaba Nagy 2006-04-05 16:00:58 Re: Oracle outer join syntax