Re: Variable length custom data types help - Mailing list pgsql-novice

From Morgan Kita
Subject Re: Variable length custom data types help
Date
Msg-id 08B420FF5BF7BC42A064212C2EB7688017E489@neutron.verseon.com
Whole thread Raw
In response to Variable length custom data types help  ("Morgan Kita" <mkita@verseon.com>)
List 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
begrabbing and storing them as entire blocks. 

Thanks,
Morgan

"Morgan Kita" <mkita@verseon.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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Variable length custom data types help
Next
From: Michael Fuhr
Date:
Subject: Re: plpgsql question - simple I would have thought