Re: Can I create a TYPE (or DOMAIN) with arguments?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Erik Jones <erik(at)myemma(dot)com>, "R(dot)A(dot)" <adeveloper(at)bluebottle(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Can I create a TYPE (or DOMAIN) with arguments?
Date: 2008-01-10 16:19:45
Message-ID: 6734.1199981985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> On Thu, Jan 10, 2008 at 08:58:07AM -0600, Erik Jones wrote:
>> Postgres doesn't support parameterized type declarations directly
>> (that I've ever heard of), but you could probably write a function
>> that uses EXECUTE to do this.

> IIRC 8.3 will include the user-defined typmod which will allow such
> constructs...

That won't help for this particular problem, though --- composite types
don't take typmods, and there'd be no mechanism to pass it down to the
varchar field if they did. I don't think the OP can solve his problem
just with spare parts. In 8.3 he could write a primitive type that
behaves the way he wants, but it'd take an annoyingly large amount
of custom C code :-(

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-01-10 16:21:10 Re: 8.2.4 serious slowdown
Previous Message Raymond O'Donnell 2008-01-10 16:15:13 Re: 8.2.4 serious slowdown