Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf736e18

Browse files
committed
Standardize usages of appendStringInfo and appendPQExpBuffer
Fix a few places that were using appendStringInfo() when they should havebeen using appendStringInfoString(). Also some cases ofappendPQExpBuffer() that would have been better suited to useappendPQExpBufferChar(), and finally, some places that usedappendPQExpBuffer() when appendPQExpBufferStr() would have suited better.There are no bugs are being fixed here. The aim is just to make the codeuse the most optimal function for the job.All the code being changed here is new to PG14. It makes sense to fixthese before we branch for PG15. There are a few other places that wecould fix, but those cases are older code so fixing those seems lessworthwhile as it may cause unnecessary back-patching pain in the future.Author: Hou ZhijieDiscussion:https://postgr.es/m/OS0PR01MB5716732158B1C4142C6FE375943D9@OS0PR01MB5716.jpnprd01.prod.outlook.com
1 parent8279f68 commitf736e18

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

‎src/backend/access/brin/brin_minmax_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,7 @@ brin_minmax_multi_summary_out(PG_FUNCTION_ARGS)
30843084

30853085
a=FunctionCall1(&fmgrinfo,ranges_deserialized->values[idx++]);
30863086

3087-
appendStringInfo(&str,"%s",DatumGetPointer(a));
3087+
appendStringInfoString(&str,DatumGetPointer(a));
30883088

30893089
b=cstring_to_text(str.data);
30903090

‎src/backend/access/heap/vacuumlazy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,18 +783,18 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
783783
msgfmt=_(" %u pages from table (%.2f%% of total) had %lld dead item identifiers removed\n");
784784

785785
if (vacrel->nindexes==0||vacrel->num_index_scans==0)
786-
appendStringInfo(&buf,_("index scan not needed:"));
786+
appendStringInfoString(&buf,_("index scan not needed:"));
787787
else
788-
appendStringInfo(&buf,_("index scan needed:"));
788+
appendStringInfoString(&buf,_("index scan needed:"));
789789
}
790790
else
791791
{
792792
msgfmt=_(" %u pages from table (%.2f%% of total) have %lld dead item identifiers\n");
793793

794794
if (!vacrel->do_failsafe)
795-
appendStringInfo(&buf,_("index scan bypassed:"));
795+
appendStringInfoString(&buf,_("index scan bypassed:"));
796796
else
797-
appendStringInfo(&buf,_("index scan bypassed by failsafe:"));
797+
appendStringInfoString(&buf,_("index scan bypassed by failsafe:"));
798798
}
799799
orig_rel_pages=vacrel->rel_pages+vacrel->pages_removed;
800800
appendStringInfo(&buf,msgfmt,

‎src/bin/pg_amcheck/pg_amcheck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ prepare_heap_command(PQExpBuffer sql, RelationInfo *rel, PGconn *conn)
844844
if (opts.endblock >=0)
845845
appendPQExpBuffer(sql,", endblock := "INT64_FORMAT,opts.endblock);
846846

847-
appendPQExpBuffer(sql,")");
847+
appendPQExpBufferChar(sql,')');
848848
}
849849

850850
/*

‎src/bin/psql/describe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,7 +2934,7 @@ describeOneTableDetails(const char *schemaname,
29342934

29352935
if (has_some&& !has_all)
29362936
{
2937-
appendPQExpBuffer(&buf," (");
2937+
appendPQExpBufferStr(&buf," (");
29382938

29392939
/* options */
29402940
if (has_ndistinct)
@@ -2954,7 +2954,7 @@ describeOneTableDetails(const char *schemaname,
29542954
appendPQExpBuffer(&buf,"%smcv",gotone ?", " :"");
29552955
}
29562956

2957-
appendPQExpBuffer(&buf,")");
2957+
appendPQExpBufferChar(&buf,')');
29582958
}
29592959

29602960
appendPQExpBuffer(&buf," ON %s FROM %s",
@@ -3577,7 +3577,7 @@ describeOneTableDetails(const char *schemaname,
35773577
child_relkind==RELKIND_PARTITIONED_INDEX)
35783578
appendPQExpBufferStr(&buf,", PARTITIONED");
35793579
if (strcmp(PQgetvalue(result,i,2),"t")==0)
3580-
appendPQExpBuffer(&buf," (DETACH PENDING)");
3580+
appendPQExpBufferStr(&buf," (DETACH PENDING)");
35813581
if (i<tuples-1)
35823582
appendPQExpBufferChar(&buf,',');
35833583

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp