diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-09-27 09:15:07 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-09-27 09:15:07 +0900 |
commit | e1e6f8f3dfe141839220875270a81ad3a719e0b6 (patch) | |
tree | d3bed4b143fa09b7499bf5e1eb3fa150b7ceca00 /src/backend/access/transam/xlogfuncs.c | |
parent | 31d2c4716e6b429353bb81cebaa0f2b1267823d6 (diff) | |
download | postgresql-e1e6f8f3dfe141839220875270a81ad3a719e0b6.tar.gz postgresql-e1e6f8f3dfe141839220875270a81ad3a719e0b6.zip |
Remove dependency to StringInfo in xlogbackup.{c.h}
This was used as the returned result type of the generated contents for
the backup_label and backup history files. This is replaced by a simple
string, reducing the cleanup burden of all the callers of
build_backup_content().
Reviewed-by: Bharath Rupireddy
Discussion: https://postgr.es/m/YzERvNPaZivHEKZJ@paquier.xyz
Diffstat (limited to 'src/backend/access/transam/xlogfuncs.c')
-rw-r--r-- | src/backend/access/transam/xlogfuncs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index f724b18733a..a801a94fe85 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -130,7 +130,7 @@ pg_backup_stop(PG_FUNCTION_ARGS) Datum values[PG_BACKUP_STOP_V2_COLS] = {0}; bool nulls[PG_BACKUP_STOP_V2_COLS] = {0}; bool waitforarchive = PG_GETARG_BOOL(0); - StringInfo backup_label; + char *backup_label; SessionBackupState status = get_backup_status(); /* Initialize attributes information in the tuple descriptor */ @@ -153,7 +153,7 @@ pg_backup_stop(PG_FUNCTION_ARGS) backup_label = build_backup_content(backup_state, false); values[0] = LSNGetDatum(backup_state->stoppoint); - values[1] = CStringGetTextDatum(backup_label->data); + values[1] = CStringGetTextDatum(backup_label); values[2] = CStringGetTextDatum(tablespace_map->data); /* Deallocate backup-related variables */ @@ -162,7 +162,6 @@ pg_backup_stop(PG_FUNCTION_ARGS) pfree(tablespace_map->data); pfree(tablespace_map); tablespace_map = NULL; - pfree(backup_label->data); pfree(backup_label); /* Returns the record as Datum */ |