Re: Range types - Mailing list pgsql-hackers

From Takahiro Itagaki
Subject Re: Range types
Date
Msg-id 20091214171024.8A94.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Range types  (Scott Bailey <artacus@comcast.net>)
Responses Re: Range types
Re: Range types
List pgsql-hackers
Scott Bailey <artacus@comcast.net> wrote:

> CREATE TYPE periodtz AS RANGE (timestamptz, '1 microsecond'::interval);

What does the second argument mean? Is it a default interval?

> So basically I have a pg_range table to store the base typeid, a text 
> field for the granule value and the granule typeid.

As another approach, what about storing typeid in typmod?
(Oid can be assumed to be stored in int32.)

For example,   CREATE TABLE tbl ( r range(timestamp) );   SELECT '[ 2.0, 3.0 )'::range(float);

There might be some overhead to store typeid for each range instance,
but the typmod approach does not require additinal catalogs and syntax
changes. It can be possible even on 8.4.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Scott Bailey
Date:
Subject: Range types
Next
From: Peter Eisentraut
Date:
Subject: Re: Hot Standby, release candidate?