Re: row_to_json bug with index only scans: empty keys!

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: row_to_json bug with index only scans: empty keys!
Дата
Msg-id 545E31DC.9020009@dunslane.net
обсуждение исходный текст
Ответ на Re: row_to_json bug with index only scans: empty keys!  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: row_to_json bug with index only scans: empty keys!  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 11/08/2014 09:26 AM, Robert Haas wrote:
> On Fri, Nov 7, 2014 at 11:27 PM, Tom Lane <tgl@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: tracking commit timestamps
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Add CREATE support to event triggers