Re: Changing column types... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Changing column types...
Date
Msg-id 23600.1017934482@sss.pgh.pa.us
Whole thread Raw
In response to Changing column types...  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: Changing column types...  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
"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


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Bidirectional hard joins (fwd)
Next
From: Tom Lane
Date:
Subject: Re: Bidirectional hard joins (fwd)