mirror of
https://github.com/postgres/postgres.git
synced 2025-08-18 12:22:09 +03:00
Replace appendPQExpBuffer(..., <constant>) with appendPQExpBufferStr
Arguably makes the code a bit more readable, and might give a small performance gain. David Rowley
This commit is contained in:
@@ -2619,7 +2619,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
|
||||
{
|
||||
PQExpBuffer cmd = createPQExpBuffer();
|
||||
|
||||
appendPQExpBuffer(cmd, "SET SESSION AUTHORIZATION ");
|
||||
appendPQExpBufferStr(cmd, "SET SESSION AUTHORIZATION ");
|
||||
|
||||
/*
|
||||
* SQL requires a string literal here. Might as well be correct.
|
||||
@@ -2627,8 +2627,8 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
|
||||
if (user && *user)
|
||||
appendStringLiteralAHX(cmd, user, AH);
|
||||
else
|
||||
appendPQExpBuffer(cmd, "DEFAULT");
|
||||
appendPQExpBuffer(cmd, ";");
|
||||
appendPQExpBufferStr(cmd, "DEFAULT");
|
||||
appendPQExpBufferChar(cmd, ';');
|
||||
|
||||
if (RestoringToDB(AH))
|
||||
{
|
||||
@@ -2798,7 +2798,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName)
|
||||
appendPQExpBuffer(qry, "SET search_path = %s",
|
||||
fmtId(schemaName));
|
||||
if (strcmp(schemaName, "pg_catalog") != 0)
|
||||
appendPQExpBuffer(qry, ", pg_catalog");
|
||||
appendPQExpBufferStr(qry, ", pg_catalog");
|
||||
|
||||
if (RestoringToDB(AH))
|
||||
{
|
||||
@@ -2853,7 +2853,7 @@ _selectTablespace(ArchiveHandle *AH, const char *tablespace)
|
||||
if (strcmp(want, "") == 0)
|
||||
{
|
||||
/* We want the tablespace to be the database's default */
|
||||
appendPQExpBuffer(qry, "SET default_tablespace = ''");
|
||||
appendPQExpBufferStr(qry, "SET default_tablespace = ''");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3119,7 +3119,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
|
||||
{
|
||||
PQExpBuffer temp = createPQExpBuffer();
|
||||
|
||||
appendPQExpBuffer(temp, "ALTER ");
|
||||
appendPQExpBufferStr(temp, "ALTER ");
|
||||
_getObjectDescription(temp, te, AH);
|
||||
appendPQExpBuffer(temp, " OWNER TO %s;", fmtId(te->owner));
|
||||
ahprintf(AH, "%s\n\n", temp->data);
|
||||
|
Reference in New Issue
Block a user