Re: anyelement -> anyrange - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: anyelement -> anyrange
Date
Msg-id CADkLM=fjGje7+UkHEkf2OXPWYnhh04H+LzxzzUDi2B5SAyi9Vw@mail.gmail.com
Whole thread Raw
In response to Re: anyelement -> anyrange  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: anyelement -> anyrange  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
<div dir="ltr"><br /><div class="gmail_extra"><br /><div class="gmail_quote">On Tue, Aug 16, 2016 at 9:29 PM, Tom Lane
<spandir="ltr"><<a href="mailto:tgl@sss.pgh.pa.us" target="_blank">tgl@sss.pgh.pa.us</a>></span> wrote:<br
/><blockquoteclass="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex"><spanclass="">Jim Nasby <<a
href="mailto:Jim.Nasby@bluetreble.com">Jim.Nasby@bluetreble.com</a>>writes:<br /> > I can't think of any reason
you'dwant two different range types on a<br /> > single element type.<br /><br /></span>We would not have built it
thatway if there were not clear use-cases.<br /> An easy example is you might want both a continuous timestamp range<br
/>and one that is quantized to hour boundaries.  Primarily what the<br /> range type brings in besides the element type
isa canonicalization<br /> function; and we can't guess which one you want.<br /><br />                        
regards,tom lane<br /><div class=""><div class="h5"><br /><br /> --<br /> Sent via pgsql-hackers mailing list (<a
href="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a>)<br/> To make changes to your
subscription:<br/><a href="http://www.postgresql.org/mailpref/pgsql-hackers" rel="noreferrer"
target="_blank">http://www.postgresql.org/<wbr/>mailpref/pgsql-hackers</a><br /></div></div></blockquote></div><br
/></div><divclass="gmail_extra"><br />Jim,<br /><br /></div><div class="gmail_extra">I wrote a routine that fishes in
thedictionary for a suitable range type:<br /><a
href="https://github.com/moat/range_partitioning/blob/master/sql/range_partitioning.sql#L459-L485">https://github.com/moat/range_partitioning/blob/master/sql/range_partitioning.sql#L459-L485</a><br
/><br/>Obviously, it has the problems when the number of suitable ranges <> 1 as mentioned by Tom.</div><div
class="gmail_extra"><br/></div><div class="gmail_extra">You might also find some gleanable gems in:<br /><a
href="https://github.com/moat/range_type_functions/blob/master/doc/range_type_functions.md">https://github.com/moat/range_type_functions/blob/master/doc/range_type_functions.md</a><br
/></div><divclass="gmail_extra"><br /></div><div class="gmail_extra"><br /></div><div class="gmail_extra"><br
/></div><divclass="gmail_extra"><br /></div></div> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Making pg_hba.conf case-insensitive
Next
From: Jim Nasby
Date:
Subject: Re: Add -c to rsync commands on SR tutorial wiki page