| From: | Thom Brown <thom(at)linux(dot)com> | 
|---|---|
| To: | Josh Berkus <josh(at)agliodbs(dot)com> | 
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: List of "binary-compatible" data types | 
| Date: | 2013-11-04 23:30:09 | 
| Message-ID: | CAA-aLv4Sqh9hdP=4=wrGHpUaZhGiQ-r0JjHxuoMvJYuwEZ8FNQ@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 4 November 2013 21:58, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> Folks,
>
> From our docs:
>
> "Adding a column with a non-null default or changing the type of an
> existing column will require the entire table and indexes to be
> rewritten. As an exception, if the USING clause does not change the
> column contents and the old type is either binary coercible to the new
> type or an unconstrained domain over the new type, a table rewrite is
> not needed ..."
>
> Which is nice, but nowhere do we present users with a set of
> binary-compatible data types, even among the built-in types.  I'd
> happily write this up, if I knew what the binary-compatible data types
> *were*.
You could try this:
SELECT
  castsource::regtype::text,
  array_agg(casttarget::regtype order by casttarget::regtype::text) casttargets
FROM pg_cast
WHERE castmethod = 'b'
GROUP BY 1
ORDER BY 1;
-- 
Thom
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Craig Ringer | 2013-11-05 01:00:45 | Re: Row-security writer-side checks proposal | 
| Previous Message | Claudio Freire | 2013-11-04 23:22:26 | Re: Fast insertion indexes: why no developments |