pgsql: Avoid unnecessary allocation for tablesync.c COPY buffer
Avoid unnecessary allocation for tablesync.c COPY buffer
copybuf serves only as a read-only parse buffer and is never
appended-to, enlarged or reset. Previously it was a file-level static
StringInfoData, allocated via makeStringInfo(), but that was abusing the
StringInfo interface.
A function-level static read-only StringInfo, as introduced by commit
f0efa5aec193, works just as well, and is less notionally bogus.
There are no functional changes here: unconsumed leftover bytes are
still consumed in the next call to this function, just like in the
previous coding.
Author: Chao Li <lic@highgo.com>
Reviewed-by: Denis Smirnov <darthunix@gmail.com>
Reviewed-by: ZizhuanLiu (X-MAN) <44973863@qq.com>
Commitfest: https://commitfest.postgresql.org/patch/6757/
Discussion: /messages/by-id/5B2C9B4C-EAE6-4F21-AF99-613A561D26DC@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7720f61b7d6f5b1f702ecc1d46dd87d25808a785
Modified Files
--------------
src/backend/replication/logical/tablesync.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)