"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> 3. Is there any way of checking pg_type to check that two types are binary
> compatible and can be substiuted in this way?
Binary compatibility is not represented in pg_type (which is a shortcoming).
You have to use the IsBinaryCompatible() routine provided by
parse_coerce.h.
> 4. Is there any worth in me submitting a patch that will allow rudimentary
> column type changing, so long as the types are binary compatible???
Hmm. Seems like that case, and the various ones involving adjustment of
char/varchar length by hacking atttypmod, would be useful to support via
ALTER COLUMN even if we don't have a full implementation. Essentially
this would be taking the existing folklore about safe ways to hack
pg_attribute and reducing them to code --- why not do it?
regards, tom lane