Re: [PATCH] Generic type subscription
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>,
Artur Zakirov <a.zakirov@postgrespro.ru>, Aleksander Alekseev <a.alekseev@postgrespro.ru>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Victor Wagner <vitus@wagner.pp.ru>, Haribabu Kommi <kommi.haribabu@gmail.com>
Date: 2017-01-26T18:21:44Z
Lists: pgsql-hackers
On Mon, Jan 23, 2017 at 2:07 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Can we arrange to do that differently? I'd prefer something in which the > argument and result types are visibly connected to the actual datatypes > at hand, for instance > array_subscript(anyarray, internal) returns anyelement > array_assign(anyarray, internal, anyelement) returns anyarray What about having no internal arguments here at all? Like if you want to support foo[4] define a subscript function that takes (mytype, int) and returns whatever. You might have to allow for multiple subscripting functions with different argument types for this to really work, though. /me ducks -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Throw error when assigning jsonb scalar instead of a composite object
- aa6e46daf530 14.0 landed
-
Filling array gaps during jsonb subscripting
- 81fcc72e6622 14.0 landed
-
Implementation of subscripting for jsonb
- 676887a3b0b8 14.0 landed
-
Support subscripting of arbitrary types, not only arrays.
- c7aba7c14efd 14.0 landed
-
Remove obsoleted code relating to targetlist SRF evaluation.
- ea15e18677fc 10.0 cited
-
Include <sys/select.h> where needed
- 51c3e9fade76 10.0 cited