Container Types
От
Vik Fearing
Тема
Container Types
Дата
Msg-id
95f1bdf8-a87e-f02f-7922-bb39627508bf@postgresfriends.org
Список
Дерево обсуждения
Container Types Vik Fearing <vik@postgresfriends.org>
Re: Container Types Jeff Davis <pgsql@j-davis.com>
Re: Container Types Andres Freund <andres@anarazel.de>
Re: Container Types Jeff Davis <pgsql@j-davis.com>
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), () - ARRAY[a, b, c], () - PERIOD(a, b), () - MULTISET[a, b, c], () - MDARRAY[x(1:3)][a, b, c], () 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)
Дата: