Re: Casting issues with domains

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Reiss <thomas(dot)reiss(at)dalibo(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Casting issues with domains
Date: 2014-12-08 21:43:14
Message-ID: 54861B72.9050804@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/8/14, 9:18 AM, Tom Lane wrote:
> The short answer is that SQL domains are not zero-cost type aliases.
> Perhaps there would be value in having a feature that*is* a a zero-cost
> alias, but it wouldn't be a domain.

Note that you can actually re-use the support functions of one data type to create a new one. So if you wanted a special type called "document" that actually behaved the same as text you could do that fairly easily (though not as easily as creating a domain).

If we were going to expend energy here, I suspect it would be more useful to look at ways of creating new types without requiring C. C isn't an option on many (even most) environments in today's "cloud" world, aside from the intimidation factor. There are comments in the code that hypothesize about making cstring a full type; that might be all that's needed.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-12-08 22:02:41 Re: Compression of full-page-writes
Previous Message Merlin Moncure 2014-12-08 21:40:43 Re: intel s3500 -- hot stuff