Re: [PATCH] hstore_to_json: empty hstores must return empty json objects

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [PATCH] hstore_to_json: empty hstores must return empty json objects
Дата
Msg-id 20131017142320.GE9746@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на [PATCH] hstore_to_json: empty hstores must return empty json objects  (Oskari Saarenmaa <os@ohmu.fi>)
Ответы Re: [PATCH] hstore_to_json: empty hstores must return empty json objects  (Oskari Saarenmaa <os@ohmu.fi>)
Re: [PATCH] hstore_to_json: empty hstores must return empty json objects  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Oskari Saarenmaa wrote:

> @@ -1241,8 +1241,8 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
>  
>      if (count == 0)
>      {
> -        out = palloc(1);
> -        *out = '\0';
> +        out = palloc(3);
> +        memcpy(out, "{}", 3);
>          PG_RETURN_TEXT_P(cstring_to_text(out));
>      }

Can't you just PG_RETURN_TEXT_P(cstring_to_text("{}")) ?

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] pg_sleep(interval)
Следующее
От: Oskari Saarenmaa
Дата:
Сообщение: Re: [PATCH] hstore_to_json: empty hstores must return empty json objects