appendBinaryStringInfo stuff

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема appendBinaryStringInfo stuff
Дата
Msg-id a0086cfc-ff0f-2827-20fe-52b591d2666c@enterprisedb.com
обсуждение исходный текст
Ответы Re: appendBinaryStringInfo stuff  (Andres Freund <andres@anarazel.de>)
Re: appendBinaryStringInfo stuff  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
I found a couple of adjacent weird things:

There are a bunch of places in the json code that use 
appendBinaryStringInfo() where appendStringInfoString() could be used, e.g.,

     appendBinaryStringInfo(buf, ".size()", 7);

Is there a reason for this?  Are we that stretched for performance?  I 
find this kind of code very fragile.

Also, the argument type of appendBinaryStringInfo() is char *.  There is 
some code that uses this function to assemble some kind of packed binary 
layout, which requires a bunch of casts because of this.  I think 
functions taking binary data plus length should take void * instead, 
like memcpy() for example.

Attached are two patches that illustrate these issues and show proposed 
changes.
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: isolationtester - allow a session specific connection string
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL