Re: Fixing contrib/isn for float8-pass-by-value - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Fixing contrib/isn for float8-pass-by-value
Date
Msg-id 200811290022.29581.peter_e@gmx.net
Whole thread Raw
In response to Re: Fixing contrib/isn for float8-pass-by-value  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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.


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: HEAD build failure on win32 mingw
Next
From: Peter Eisentraut
Date:
Subject: Re: Distinct types