Re: Variable length custom data types help

From: "Morgan Kita" <mkita(at)verseon(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Variable length custom data types help
Date: 2005-04-01 22:26:51
Message-ID: 08B420FF5BF7BC42A064212C2EB7688017E489@neutron.verseon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


I thought about that but I am really not that interested in the individual elements of the array. I am always going to be grabbing and storing them as entire blocks.

Thanks,
Morgan

"Morgan Kita" <mkita(at)verseon(dot)com> writes:
> Just to clarify in the example foo structure below where the first
> member is the length, and then you say /*rest of structure here*/, by
> that do you mean the individual data members of the structure that will
> be in my array of strucs? I guess it can't be a pointer to the array as
> you said postgres will not know that you are storing pointers. If so
> that means you have a bit of wasted overhead right? I think I will just
> try creating the pointer as void*, set the first 4 bytes to the length,
> and then fill in the rest.

BTW, if what you have is actually an *array*, namely N instances of the
same kind of animal, maybe you should define your custom type as just
one of that kind of animal, and let PG provide the array superstructure.
That way you could, for example, subscript the array at the SQL level.

regards, tom lane

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-04-02 00:38:10 Re: plpgsql question - simple I would have thought
Previous Message Tom Lane 2005-04-01 22:00:46 Re: Variable length custom data types help