aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/foreigncmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-10-25 17:42:26 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2013-10-25 17:42:26 -0400
commit9f9d9b51f068a19ad243fd8fe500c9970999db9b (patch)
treecfdbf94f3b91efbf2fc0d93e6049900f56b9c51a /src/backend/commands/foreigncmds.c
parent43fe90f66a0b200f6c32507428349afb45f661ca (diff)
downloadpostgresql-9f9d9b51f068a19ad243fd8fe500c9970999db9b.tar.gz
postgresql-9f9d9b51f068a19ad243fd8fe500c9970999db9b.zip
Improve pqexpbuffer.c to use modern vsnprintf implementations efficiently.
When using a C99-compliant vsnprintf, we can use its report of the required buffer size to avoid making multiple loops through the formatting logic. This is similar to the changes recently made in stringinfo.c, but we can't use psprintf.c here because in libpq we don't want to exit() on error. (The behavior pqexpbuffer.c has historically used is to mark the PQExpBuffer as "broken", ie empty, if it runs into any fatal problem.) To avoid duplicating code more than necessary, I refactored printfPQExpBuffer and appendPQExpBuffer to share a subroutine that's very similar to psprintf.c's pvsnprintf in spirit.
Diffstat (limited to 'src/backend/commands/foreigncmds.c')
0 files changed, 0 insertions, 0 deletions