From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | "David E(dot) Wheeler" <david(at)justatheory(dot)com> |
Cc: | PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: JSON Function Bike Shedding |
Date: | 2013-02-15 17:25:45 |
Message-ID: | CA+TgmoaVY=37tVorUUD5KO2_DecRKsBRt8iPBbMyXevU2RA=GQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Feb 12, 2013 at 2:18 PM, David E. Wheeler <david(at)justatheory(dot)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 developing for 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 the types 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 as the 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
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2013-02-15 17:29:11 | Re: Unarchived WALs deleted after crash |
Previous Message | Fujii Masao | 2013-02-15 17:16:45 | Re: Unarchived WALs deleted after crash |