Re: Possible marginally-incompatible change to array subscripting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Possible marginally-incompatible change to array subscripting
Date
Msg-id 6483.1450841103@sss.pgh.pa.us
Whole thread Raw
In response to Re: Possible marginally-incompatible change to array subscripting  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PROPOSAL] Backup and recovery of pg_statistic
Next
From: Ashutosh Bapat
Date:
Subject: Re: Getting sorted data from foreign server for merge join