On Friday 28 November 2008 22:02:52 Tom Lane wrote:
> I had a better but more invasive idea: invent a new attribute for
> CREATE TYPE
>
>       LIKE   =  typename
>
> which means "copy any unspecified representational details from the
> given pre-existing type".  This would allow the .sql file to know
> less instead of more about what's happening, so it seems more
> future-proof.  It's a bit more work than the makefile hack I was
> thinking about, but seems like a good investment.  (I wouldn't
> propose this if I thought contrib/isn was the only user --- I expect
> there are other third-party modules with similar needs.)

Well, this is basically what I had planned with distinct types, at least in a 
future phase.  You will notice that the existing distinct type patch already 
pretty much has the effect of copying another types represenation.  From 
there the difference is essentially only the casting behavior: distinct types 
per SQL have fewer casts, domains have more casts.  I was also planning to 
devise some in-between cases for various use cases, such as creating 
compatibility types.

I'm going to try to write up a wiki page collecting various use cases and 
requirements so the bigger picture becomes clearer.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to