Re: User defined type with text* field

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ken K <kenmail(at)telocity(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: User defined type with text* field
Date: 2001-06-30 15:02:57
Message-ID: 4603.993913377@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ken K <kenmail(at)telocity(dot)com> writes:
> I am trying to create a user defined type with 2 fields
> in it, a text* and an Oid. I am not sure what size to
> use in the create type command. When I try variable
> the back end core dumps. Are there any examples for
> doing this sort of thing? Is it even doable?

You can't use any kind of pointer in a datatype --- what is it going to
point to? There's nothing it could point at that might live as long as
the datavalue on disk will.

You could embed a TEXT value into a larger varlena value, say

<total length word>
Oid
<text value here, beginning with its own length word>

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-06-30 16:23:20 Re: OIDs
Previous Message Alex Pilosov 2001-06-30 14:58:30 Re: User defined type with text* field