Dario Teixeira <darioteixeira@yahoo.com> writes:
> I doubt there is a clean way around this (barring Postgresql implementing
> option types). Therefore, I'm working on a workaround that involves the
> Postgresql side annotating the nullability of type definitions by issuing
> comments on the type (using COMMENT ON). Yes, it is a hack, but will solve
> my problem as long as I can determine the return type (and thus fetch its
> comment) associated with a query.
Okay, but that has nothing to do with either functions or composite
types.
The reasonable way to handle this in Postgres (IMHO) would be to define
not-null domains over the types you care about, and then lobby us to
have RowDescription return domain OIDs instead of smashing domains to
their base types. I don't recall the exact reasoning for the domain
smashing behavior; perhaps it could be made adjustable.
regards, tom lane