On Wed, Feb 27, 2008 at 9:26 PM, Florian G. Pflug <[EMAIL PROTECTED]> wrote: > I was thinking more along the line of letting a datatype specify a > function "void* ioprepare(typmod)" which returns some opaque object > specifying all that the input and output function needs to know. > We could than establish the rule that input/output functions may not > access the catalog, and instead pass them a pointer to that opaque object.
Callers of IO functions don't always know which type they're dealing with - we had to go to some lengths to pass type information along with the enum value itself so that it could be looked up in the syscache in the output function. I think the main culprits are the P/Ls, but I think there was a security related concern about passing the type through to the IO function as well. If you want to do something like this, it would certainly be possible to cache the enum info for a particular type, but you might want to have a separate set of io functions just for this case. On the plus side, if such a cache were to be used by IO generally, we could reimplement enums to just store the ordinal on disk and save a couple of bytes, like I wanted but was unable to do the first time around. :) Enums are an easy case, though, as there's very little data to deal with. I don't know about other UDTs out there - do any require more extensive catalog access? Cheers Tom ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings