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