Skip site navigation (1) Skip section navigation (2)

Re: Range Types

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types
Date: 2011-02-09 05:31:50
Message-ID: 1297229510.27157.360.camel@jdavis (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, 2011-02-08 at 09:10 -0800, Jeff Davis wrote:
> On Mon, 2011-02-07 at 18:23 +0100, Dimitri Fontaine wrote:
> > I would think
> > 
> >   CREATE TYPE foo AS RANGE (bar) USING (btree_ops);
> > 
> > The USING clause is optional, because you generally have a default btree
> > opclass for the datatype.
> 
> There are other options, like "CANONICAL", so where do those fit?
> 
> If CREATE TYPE already has an options list, it seems a little strange to
> add grammar to support this feature. "USING" doesn't seem to mean a lot,
> except that we happen to use it in other contexts to mean "operator
> class".

For the user-facing part, how about just passing it as a parameter
called "SUBTYPE_OPCLASS"? It sounds a little on the "internal detail"
side, but so do some other type definition parameters.

As for the catalog, I'm inclined to leave the compare function in there
directly and just add a dependency on the opclass. That way, it's only
one syscache lookup rather than two, to get the compare function oid.
Then again, perhaps that doesn't matter anyway. Thoughts?

Regards,
	Jeff Davis



In response to

pgsql-hackers by date

Next:From: Jeff DavisDate: 2011-02-09 05:50:50
Subject: Range Type constructors
Previous:From: Dan PortsDate: 2011-02-09 05:24:19
Subject: Re: SSI patch version 14

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group