Re: RangeType internal use

Поиск
Список
Период
Сортировка
Искать
От
Kyotaro HORIGUCHI
Тема
Re: RangeType internal use
Дата
Msg-id
20150206.163445.146207935.horiguchi.kyotaro@lab.ntt.co.jp
Ответ на
RangeType internal use (Amit Langote)
Список
Дерево обсуждения
RangeType internal use Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: RangeType internal use Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: RangeType internal use Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: RangeType internal use Tom Lane <tgl@sss.pgh.pa.us>
Re: RangeType internal use Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: RangeType internal use Tom Lane <tgl@sss.pgh.pa.us>
Re: RangeType internal use Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: RangeType internal use Tom Lane <tgl@sss.pgh.pa.us>
Re: RangeType internal use Heikki Linnakangas <hlinnakangas@vmware.com>
Re: RangeType internal use Tom Lane <tgl@sss.pgh.pa.us>
Re: RangeType internal use Robert Haas <robertmhaas@gmail.com>
Re: RangeType internal use Tom Lane <tgl@sss.pgh.pa.us>
Re: RangeType internal use Noah Misch <noah@leadboat.com>
Re: RangeType internal use David Fetter <david@fetter.org>
Re: RangeType internal use Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: RangeType internal use David Fetter <david@fetter.org>
Re: RangeType internal use Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: RangeType internal use Mike Blackwell <mike.blackwell@rrd.com>
Re: RangeType internal use Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: RangeType internal use Robert Haas <robertmhaas@gmail.com>
Re: RangeType internal use Robert Haas <robertmhaas@gmail.com>
Hi, from nearby:)

> I wonder why I cannot find a way to get a range type for a given (sub-)
> type. I would like to build a RangeType from Datum's of lower and upper
> bounds. Much like how construct_array() builds an ArrayType from a Datum
> array of elements given elements' type info.
> 
> Is there some way I do not seem to know? If not, would it be worthwhile
> to make something like construct_range() that returns a RangeType given
> Datum's of lower and upper bounds and subtype info?

make_range needs the range type itself.

On SQL interfalce, you can get range type coresponds to a base
type by looking up the pg_range catalog.

SELECT rngtypid::regtype, rngsubtype::regtypeFROM pg_range WHERE rngsubtype = 'int'::regtype;
rngtypid  | rngsubtype 
-----------+------------int4range | integer

But there's only one syscache for this catalog which takes range
type id. So the reverse resolution rngsubtype->rngtype seems not
available. TypeCahce has only comparison function info as surely
available element related to range types but this wouldn't
help. I think scanning the entire cache is not allowable even if
possible.

Perhaps what is needed is adding RANGESUBTYPE syscache but I
don't know whether it is allowable or not.

Thoughts?

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: Amit Langote
Дата:
Сообщение: Re: RangeType internal use
FAQ