From: | Dave Trombley <dtrom(at)bumba(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | User defined types and storage variance |
Date: | 2002-01-15 23:12:52 |
Message-ID: | 3C44B774.4040605@bumba.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Is it correct of me to assume that the concrete storage of a user
defined type, defined in C, must not contain any references to
structures allocated per-object? The documentation does not explicitly
specify this, but there is a lack of a callback in the CREATE TYPE
command to be invoked when the database type instance is no longer
referenced, so I see no way of freeing such storage if it were
allocated. Also, I can't see how the backend would know how to follow
such a reference without some indication that it was a reference, and
also the storage length of the structure. So this seems plain.
What I'd like to do is implement a structure whose concrete storage
length may change when it is operated on (a sparse matrix), but since
realloc() on most systems may change the memory location of the pointer,
I see no way of doing this given the above restriction. Perhaps it
would be possible to have a function somehow tell the back end to
associate the OID of the type instance it is operating on with a
different concrete storage block?
More generally, exactly how /does/ concrete storage allocation and
deallocation behave for user-defined types?
-David J. Trombley
<dtrom(at)bumba(dot)net>
From | Date | Subject | |
---|---|---|---|
Next Message | Paul Tomblin | 2002-01-15 23:51:54 | Re: Is there is shutdown utility for postgresql? |
Previous Message | Harald Armin Massa | 2002-01-15 23:03:25 | Different views with same name for different users |