On 11/08/2014 09:26 AM, Robert Haas wrote:
On Fri, Nov 7, 2014 at 11:27 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
Thoughts?
I'm not sure whether this is safe enough to back-patch, but it seems
like we should probably plan to back-patch *something*, because the
status quo isn't great either.



I confirm that Tom's patch does indeed fix my test case that produces empty field names.

We should probably not backpatch it, as it is a behaviour change. However, I do think we should add checks in composite_to_json and hstore_from_record for empty field names, and error out if they are found. That seems like an outright bug which we should defend against, including in the back branches. Giving back json or hstore objects with made up names like f1 is one thing, giving them back with empty names (which, in the hstore case will collapse everything to a single field) is far worse.

cheers

andrew


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to