Container Types

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Container Types
Дата
Msg-id 95f1bdf8-a87e-f02f-7922-bb39627508bf@postgresfriends.org
обсуждение исходный текст
Ответы Re: Container Types  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
The standard has several constructs for creating new types from other 
types.  I don't mean anything like CREATE TYPE here, I mean things like 
this:

- ROW(a, b, c), (<explicit row value constructor>)
- ARRAY[a, b, c], (<array value constructor by enumeration>)
- PERIOD(a, b), (<period predicand>)
- MULTISET[a, b, c], (<multiset value constructor by enumeration>)
- MDARRAY[x(1:3)][a, b, c], (<md-array value constructor by enumeration>)

I am not sure what magic we use for the row value constructor.  We 
handle ARRAY by creating an array type for every non-array type that is 
created.  Periods are very similar to range types and we have to create 
new functions such as int4range(a,b) and int8range(a,b) instead of some 
kind of generic RANGE(a, b, '[)') and not worrying about what the type 
is as long as there is a btree opclass for it.

Obviously there would have to be an actual type in order to store it in 
a table, but what I am most interested in here is being able to create 
them on the fly.  I do not think it is feasible to create N new types 
for every type like we do for arrays on the off-chance you would want to 
put it in a PERIOD for example.

For those who know the code much better than I do, what would be a 
plausible way forward to support these containers?
-- 
Vik Fearing



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hayato Kuroda (Fujitsu)"
Дата:
Сообщение: RE: Force streaming every change in logical decoding
Следующее
От: David Rowley
Дата:
Сообщение: Re: Add enable_presorted_aggregate GUC