Use StringInfo to build the result in oidvectortypes()

Replace manual buffer management with StringInfo to avoid repeatedly
scanning the accumulated output when appending type names.  This
removes quadratic scanning for large input vectors and simplifies the
code.

Also check for interrupts in the loop and free temporary type names
after appending them to the result.

Author: Chao Li <[email protected]>
Reviewed-by: Japin Li <[email protected]>
Reviewed-by: David Rowley <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a999971331301a4a2f945220733b11af90cc2962

Modified Files
--------------
src/backend/utils/adt/format_type.c | 36 +++++++++++++-----------------------
1 file changed, 13 insertions(+), 23 deletions(-)

Reply via email to