On Tue, Feb 12, 2013 at 2:18 PM, David E. Wheeler <david@justatheory.com> wrote:
> Hello Hackers,
>
> If you dislike bike-shedding (and who does?), delete this email and the ensuing thread right now. You have been
warned!
>
> I have been playing with Andrew’s JSON enhancements and really enjoying them. I am already using them in code I’m
developingfor production deployment in a month or two. Kudos!
>
> However, I am not so keen on the function names. They all start with json_! This mostly feels redundant to me, since
thetypes of the parameters are part of the function signature.
>
> Therefore, I would like to propose different names:
>
> Existing Name Proposed Name
> -------------------------- ----------------------------------------
> json_array_length() array_length() or length() or size()
> json_each() each_json()
> json_each_as_text() each_text()
> json_get() get_json()
> json_get_as_text() get_text()
> json_get_path() get_json()
> json_get_path_as_text() get_text()
> json_object_keys() get_keys()
> json_populate_record() record() or row()
> json_populate_recordset() records() or rows()
> json_unnest() get_values()
> json_agg() collect_json()
>
> Note that I have given json_get() and json_get_path() the same names, as it seems to me that the former is the same
asthe latter, with only one parameter. Same for json_get_as_text() and json_get_path_as_text().
I realize I'm in the minority here, but -1 from me on all of this.
Should we also rename xml_is_well_formed() to just is_well_formed()?
string_agg() to agg()? Eventually we will have more data types, and
some of them will have functions that could also be called rows() or
get_values(), but it's unlikely that they'll have exactly the same
behavior, which will start to make things confusing.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company