Re: Possible marginally-incompatible change to array subscripting

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Possible marginally-incompatible change to array subscripting
Дата
Msg-id 6483.1450841103@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Possible marginally-incompatible change to array subscripting  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> One could theoretically construct a custom "type" that followed more 
> traditional semantics, but then you'd lose all the syntax... which I 
> suspect would make any such "type" all but unusable. The other problem 
> would be having it deal with any other data type, but at least there's 
> ways you can work around that for the most part.

Yeah.  We've speculated a bit about allowing other datatypes to have
access to the subscript syntax, which could be modeled as allowing
'a[b]' to be an overloadable operator.  That seems possibly doable if
someone wanted to put time into it.  However, that still leaves a
heck of a lot of functionality on the table, such as automatic creation of
array types corresponding to new scalar types, not to mention the parser's
understanding of "anyarray" vs "anyelement" polymorphism.  I have no idea
how we might make those things extensible.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PROPOSAL] Backup and recovery of pg_statistic
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Getting sorted data from foreign server for merge join