mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
Fix an assortment of improper usages of string functions
In a similar effort tof736e188c
and110d81728
, fixup various usages of string functions where a more appropriate function is available and more fit for purpose. These changes include: 1. Use cstring_to_text_with_len() instead of cstring_to_text() when working with a StringInfoData and the length can easily be obtained. 2. Use appendStringInfoString() instead of appendStringInfo() when no formatting is required. 3. Use pstrdup(...) instead of psprintf("%s", ...) 4. Use pstrdup(...) instead of psprintf(...) (with no formatting) 5. Use appendPQExpBufferChar() instead of appendPQExpBufferStr() when the length of the string being appended is 1. 6. appendStringInfoChar() instead of appendStringInfo() when no formatting is required and string is 1 char long. 7. Use appendPQExpBufferStr(b, .) instead of appendPQExpBuffer(b, "%s", .) 8. Don't use pstrdup when it's fine to just point to the string constant. I (David) did find other cases of #8 but opted to use #4 instead as I wasn't certain enough that applying #8 was ok (e.g in hba.c) Author: Ranier Vilela, David Rowley Discussion: https://postgr.es/m/CAApHDvo2j2+RJBGhNtUz6BxabWWh2Jx16wMUMWKUjv70Ver1vg@mail.gmail.com
This commit is contained in:
@ -1325,7 +1325,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
|
|||||||
}
|
}
|
||||||
appendStringInfoChar(&dst, '}');
|
appendStringInfoChar(&dst, '}');
|
||||||
|
|
||||||
PG_RETURN_TEXT_P(cstring_to_text(dst.data));
|
PG_RETURN_TEXT_P(cstring_to_text_with_len(dst.data, dst.len));
|
||||||
}
|
}
|
||||||
|
|
||||||
PG_FUNCTION_INFO_V1(hstore_to_json);
|
PG_FUNCTION_INFO_V1(hstore_to_json);
|
||||||
@ -1370,7 +1370,7 @@ hstore_to_json(PG_FUNCTION_ARGS)
|
|||||||
}
|
}
|
||||||
appendStringInfoChar(&dst, '}');
|
appendStringInfoChar(&dst, '}');
|
||||||
|
|
||||||
PG_RETURN_TEXT_P(cstring_to_text(dst.data));
|
PG_RETURN_TEXT_P(cstring_to_text_with_len(dst.data, dst.len));
|
||||||
}
|
}
|
||||||
|
|
||||||
PG_FUNCTION_INFO_V1(hstore_to_jsonb);
|
PG_FUNCTION_INFO_V1(hstore_to_jsonb);
|
||||||
|
@ -84,7 +84,7 @@ sepgsql_schema_post_create(Oid namespaceId)
|
|||||||
* check db_schema:{create}
|
* check db_schema:{create}
|
||||||
*/
|
*/
|
||||||
initStringInfo(&audit_name);
|
initStringInfo(&audit_name);
|
||||||
appendStringInfo(&audit_name, "%s", quote_identifier(nsp_name));
|
appendStringInfoString(&audit_name, quote_identifier(nsp_name));
|
||||||
sepgsql_avc_check_perms_label(ncontext,
|
sepgsql_avc_check_perms_label(ncontext,
|
||||||
SEPG_CLASS_DB_SCHEMA,
|
SEPG_CLASS_DB_SCHEMA,
|
||||||
SEPG_DB_SCHEMA__CREATE,
|
SEPG_DB_SCHEMA__CREATE,
|
||||||
|
@ -3063,7 +3063,7 @@ brin_minmax_multi_summary_out(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
appendStringInfo(&str, "%s ... %s", a, b);
|
appendStringInfo(&str, "%s ... %s", a, b);
|
||||||
|
|
||||||
c = cstring_to_text(str.data);
|
c = cstring_to_text_with_len(str.data, str.len);
|
||||||
|
|
||||||
astate_values = accumArrayResult(astate_values,
|
astate_values = accumArrayResult(astate_values,
|
||||||
PointerGetDatum(c),
|
PointerGetDatum(c),
|
||||||
@ -3095,15 +3095,9 @@ brin_minmax_multi_summary_out(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
Datum a;
|
Datum a;
|
||||||
text *b;
|
text *b;
|
||||||
StringInfoData str;
|
|
||||||
|
|
||||||
initStringInfo(&str);
|
|
||||||
|
|
||||||
a = FunctionCall1(&fmgrinfo, ranges_deserialized->values[idx++]);
|
a = FunctionCall1(&fmgrinfo, ranges_deserialized->values[idx++]);
|
||||||
|
b = cstring_to_text(DatumGetCString(a));
|
||||||
appendStringInfoString(&str, DatumGetCString(a));
|
|
||||||
|
|
||||||
b = cstring_to_text(str.data);
|
|
||||||
|
|
||||||
astate_values = accumArrayResult(astate_values,
|
astate_values = accumArrayResult(astate_values,
|
||||||
PointerGetDatum(b),
|
PointerGetDatum(b),
|
||||||
|
@ -319,9 +319,9 @@ XLogRecGetBlockRefInfo(XLogReaderState *record, bool pretty,
|
|||||||
*fpi_len += XLogRecGetBlock(record, block_id)->bimg_len;
|
*fpi_len += XLogRecGetBlock(record, block_id)->bimg_len;
|
||||||
|
|
||||||
if (XLogRecBlockImageApply(record, block_id))
|
if (XLogRecBlockImageApply(record, block_id))
|
||||||
appendStringInfo(buf, " FPW");
|
appendStringInfoString(buf, " FPW");
|
||||||
else
|
else
|
||||||
appendStringInfo(buf, " FPW for WAL verification");
|
appendStringInfoString(buf, " FPW for WAL verification");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ llvm_function_reference(LLVMJitContext *context,
|
|||||||
else if (basename != NULL)
|
else if (basename != NULL)
|
||||||
{
|
{
|
||||||
/* internal function */
|
/* internal function */
|
||||||
funcname = psprintf("%s", basename);
|
funcname = pstrdup(basename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -899,7 +899,7 @@ do { \
|
|||||||
errmsg("missing entry at end of line"), \
|
errmsg("missing entry at end of line"), \
|
||||||
errcontext("line %d of configuration file \"%s\"", \
|
errcontext("line %d of configuration file \"%s\"", \
|
||||||
line_num, IdentFileName))); \
|
line_num, IdentFileName))); \
|
||||||
*err_msg = psprintf("missing entry at end of line"); \
|
*err_msg = pstrdup("missing entry at end of line"); \
|
||||||
return NULL; \
|
return NULL; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -912,7 +912,7 @@ do { \
|
|||||||
errmsg("multiple values in ident field"), \
|
errmsg("multiple values in ident field"), \
|
||||||
errcontext("line %d of configuration file \"%s\"", \
|
errcontext("line %d of configuration file \"%s\"", \
|
||||||
line_num, IdentFileName))); \
|
line_num, IdentFileName))); \
|
||||||
*err_msg = psprintf("multiple values in ident field"); \
|
*err_msg = pstrdup("multiple values in ident field"); \
|
||||||
return NULL; \
|
return NULL; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
@ -4457,7 +4457,7 @@ BackendInitialize(Port *port)
|
|||||||
appendStringInfo(&ps_data, "%s ", port->user_name);
|
appendStringInfo(&ps_data, "%s ", port->user_name);
|
||||||
if (!am_walsender)
|
if (!am_walsender)
|
||||||
appendStringInfo(&ps_data, "%s ", port->database_name);
|
appendStringInfo(&ps_data, "%s ", port->database_name);
|
||||||
appendStringInfo(&ps_data, "%s", port->remote_host);
|
appendStringInfoString(&ps_data, port->remote_host);
|
||||||
if (port->remote_port[0] != '\0')
|
if (port->remote_port[0] != '\0')
|
||||||
appendStringInfo(&ps_data, "(%s)", port->remote_port);
|
appendStringInfo(&ps_data, "(%s)", port->remote_port);
|
||||||
|
|
||||||
|
@ -769,7 +769,7 @@ fetch_remote_table_info(char *nspname, char *relname,
|
|||||||
foreach(lc, MySubscription->publications)
|
foreach(lc, MySubscription->publications)
|
||||||
{
|
{
|
||||||
if (foreach_current_index(lc) > 0)
|
if (foreach_current_index(lc) > 0)
|
||||||
appendStringInfo(&pub_names, ", ");
|
appendStringInfoString(&pub_names, ", ");
|
||||||
appendStringInfoString(&pub_names, quote_literal_cstr(strVal(lfirst(lc))));
|
appendStringInfoString(&pub_names, quote_literal_cstr(strVal(lfirst(lc))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1062,7 +1062,7 @@ copy_table(Relation rel)
|
|||||||
appendStringInfoString(&cmd, quote_identifier(lrel.attnames[i]));
|
appendStringInfoString(&cmd, quote_identifier(lrel.attnames[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
appendStringInfo(&cmd, ") TO STDOUT");
|
appendStringInfoString(&cmd, ") TO STDOUT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ anytime_typmodout(bool istz, int32 typmod)
|
|||||||
if (typmod >= 0)
|
if (typmod >= 0)
|
||||||
return psprintf("(%d)%s", (int) typmod, tz);
|
return psprintf("(%d)%s", (int) typmod, tz);
|
||||||
else
|
else
|
||||||
return psprintf("%s", tz);
|
return pstrdup(tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ pg_tablespace_databases(PG_FUNCTION_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tablespaceOid == DEFAULTTABLESPACE_OID)
|
if (tablespaceOid == DEFAULTTABLESPACE_OID)
|
||||||
location = psprintf("base");
|
location = "base";
|
||||||
else
|
else
|
||||||
location = psprintf("pg_tblspc/%u/%s", tablespaceOid,
|
location = psprintf("pg_tblspc/%u/%s", tablespaceOid,
|
||||||
TABLESPACE_VERSION_DIRECTORY);
|
TABLESPACE_VERSION_DIRECTORY);
|
||||||
|
@ -1453,7 +1453,7 @@ pg_get_indexdef_worker(Oid indexrelid, int colno,
|
|||||||
appendStringInfoChar(&buf, ')');
|
appendStringInfoChar(&buf, ')');
|
||||||
|
|
||||||
if (idxrec->indnullsnotdistinct)
|
if (idxrec->indnullsnotdistinct)
|
||||||
appendStringInfo(&buf, " NULLS NOT DISTINCT");
|
appendStringInfoString(&buf, " NULLS NOT DISTINCT");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If it has options, append "WITH (options)"
|
* If it has options, append "WITH (options)"
|
||||||
@ -2332,9 +2332,9 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
|
|||||||
Anum_pg_constraint_confdelsetcols, &isnull);
|
Anum_pg_constraint_confdelsetcols, &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
{
|
{
|
||||||
appendStringInfo(&buf, " (");
|
appendStringInfoString(&buf, " (");
|
||||||
decompile_column_index_array(val, conForm->conrelid, &buf);
|
decompile_column_index_array(val, conForm->conrelid, &buf);
|
||||||
appendStringInfo(&buf, ")");
|
appendStringInfoChar(&buf, ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -2363,7 +2363,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
|
|||||||
((Form_pg_index) GETSTRUCT(indtup))->indnullsnotdistinct)
|
((Form_pg_index) GETSTRUCT(indtup))->indnullsnotdistinct)
|
||||||
appendStringInfoString(&buf, "NULLS NOT DISTINCT ");
|
appendStringInfoString(&buf, "NULLS NOT DISTINCT ");
|
||||||
|
|
||||||
appendStringInfoString(&buf, "(");
|
appendStringInfoChar(&buf, '(');
|
||||||
|
|
||||||
/* Fetch and build target column list */
|
/* Fetch and build target column list */
|
||||||
val = SysCacheGetAttr(CONSTROID, tup,
|
val = SysCacheGetAttr(CONSTROID, tup,
|
||||||
@ -3583,7 +3583,7 @@ pg_get_function_sqlbody(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
ReleaseSysCache(proctup);
|
ReleaseSysCache(proctup);
|
||||||
|
|
||||||
PG_RETURN_TEXT_P(cstring_to_text(buf.data));
|
PG_RETURN_TEXT_P(cstring_to_text_with_len(buf.data, buf.len));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ anytimestamp_typmodout(bool istz, int32 typmod)
|
|||||||
if (typmod >= 0)
|
if (typmod >= 0)
|
||||||
return psprintf("(%d)%s", (int) typmod, tz);
|
return psprintf("(%d)%s", (int) typmod, tz);
|
||||||
else
|
else
|
||||||
return psprintf("%s", tz);
|
return pstrdup(tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1509,7 +1509,7 @@ append_db_pattern_cte(PQExpBuffer buf, const PatternInfoArray *pia,
|
|||||||
have_values = true;
|
have_values = true;
|
||||||
appendPQExpBuffer(buf, "%s\n(%d, ", comma, pattern_id);
|
appendPQExpBuffer(buf, "%s\n(%d, ", comma, pattern_id);
|
||||||
appendStringLiteralConn(buf, info->db_regex, conn);
|
appendStringLiteralConn(buf, info->db_regex, conn);
|
||||||
appendPQExpBufferStr(buf, ")");
|
appendPQExpBufferChar(buf, ')');
|
||||||
comma = ",";
|
comma = ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1765,7 +1765,7 @@ append_rel_pattern_raw_cte(PQExpBuffer buf, const PatternInfoArray *pia,
|
|||||||
appendPQExpBufferStr(buf, ", true::BOOLEAN");
|
appendPQExpBufferStr(buf, ", true::BOOLEAN");
|
||||||
else
|
else
|
||||||
appendPQExpBufferStr(buf, ", false::BOOLEAN");
|
appendPQExpBufferStr(buf, ", false::BOOLEAN");
|
||||||
appendPQExpBufferStr(buf, ")");
|
appendPQExpBufferChar(buf, ')');
|
||||||
comma = ",";
|
comma = ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1972,7 +1972,7 @@ compile_relation_list_one_db(PGconn *conn, SimplePtrList *relations,
|
|||||||
* selected above, filtering by exclusion patterns (if any) that match
|
* selected above, filtering by exclusion patterns (if any) that match
|
||||||
* btree index names.
|
* btree index names.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(&sql,
|
appendPQExpBufferStr(&sql,
|
||||||
", index (oid, nspname, relname, relpages) AS ("
|
", index (oid, nspname, relname, relpages) AS ("
|
||||||
"\nSELECT c.oid, r.nspname, c.relname, c.relpages "
|
"\nSELECT c.oid, r.nspname, c.relname, c.relpages "
|
||||||
"FROM relation r"
|
"FROM relation r"
|
||||||
@ -2011,7 +2011,7 @@ compile_relation_list_one_db(PGconn *conn, SimplePtrList *relations,
|
|||||||
* primary heap tables selected above, filtering by exclusion patterns
|
* primary heap tables selected above, filtering by exclusion patterns
|
||||||
* (if any) that match the toast index names.
|
* (if any) that match the toast index names.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(&sql,
|
appendPQExpBufferStr(&sql,
|
||||||
", toast_index (oid, nspname, relname, relpages) AS ("
|
", toast_index (oid, nspname, relname, relpages) AS ("
|
||||||
"\nSELECT c.oid, 'pg_toast', c.relname, c.relpages "
|
"\nSELECT c.oid, 'pg_toast', c.relname, c.relpages "
|
||||||
"FROM toast t "
|
"FROM toast t "
|
||||||
@ -2044,7 +2044,7 @@ compile_relation_list_one_db(PGconn *conn, SimplePtrList *relations,
|
|||||||
* matched in their own right, so we rely on UNION to deduplicate the
|
* matched in their own right, so we rely on UNION to deduplicate the
|
||||||
* list.
|
* list.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(&sql,
|
appendPQExpBufferStr(&sql,
|
||||||
"\nSELECT pattern_id, is_heap, is_btree, oid, nspname, relname, relpages "
|
"\nSELECT pattern_id, is_heap, is_btree, oid, nspname, relname, relpages "
|
||||||
"FROM (");
|
"FROM (");
|
||||||
appendPQExpBufferStr(&sql,
|
appendPQExpBufferStr(&sql,
|
||||||
|
@ -2838,21 +2838,21 @@ dumpDatabase(Archive *fout)
|
|||||||
/*
|
/*
|
||||||
* Fetch the database-level properties for this database.
|
* Fetch the database-level properties for this database.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(dbQry, "SELECT tableoid, oid, datname, "
|
appendPQExpBufferStr(dbQry, "SELECT tableoid, oid, datname, "
|
||||||
"datdba, "
|
"datdba, "
|
||||||
"pg_encoding_to_char(encoding) AS encoding, "
|
"pg_encoding_to_char(encoding) AS encoding, "
|
||||||
"datcollate, datctype, datfrozenxid, "
|
"datcollate, datctype, datfrozenxid, "
|
||||||
"datacl, acldefault('d', datdba) AS acldefault, "
|
"datacl, acldefault('d', datdba) AS acldefault, "
|
||||||
"datistemplate, datconnlimit, ");
|
"datistemplate, datconnlimit, ");
|
||||||
if (fout->remoteVersion >= 90300)
|
if (fout->remoteVersion >= 90300)
|
||||||
appendPQExpBuffer(dbQry, "datminmxid, ");
|
appendPQExpBufferStr(dbQry, "datminmxid, ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(dbQry, "0 AS datminmxid, ");
|
appendPQExpBufferStr(dbQry, "0 AS datminmxid, ");
|
||||||
if (fout->remoteVersion >= 150000)
|
if (fout->remoteVersion >= 150000)
|
||||||
appendPQExpBuffer(dbQry, "datlocprovider, daticulocale, datcollversion, ");
|
appendPQExpBufferStr(dbQry, "datlocprovider, daticulocale, datcollversion, ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(dbQry, "'c' AS datlocprovider, NULL AS daticulocale, NULL AS datcollversion, ");
|
appendPQExpBufferStr(dbQry, "'c' AS datlocprovider, NULL AS daticulocale, NULL AS datcollversion, ");
|
||||||
appendPQExpBuffer(dbQry,
|
appendPQExpBufferStr(dbQry,
|
||||||
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = dattablespace) AS tablespace, "
|
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = dattablespace) AS tablespace, "
|
||||||
"shobj_description(oid, 'pg_database') AS description "
|
"shobj_description(oid, 'pg_database') AS description "
|
||||||
"FROM pg_database "
|
"FROM pg_database "
|
||||||
@ -3398,7 +3398,7 @@ getBlobs(Archive *fout)
|
|||||||
pg_log_info("reading large objects");
|
pg_log_info("reading large objects");
|
||||||
|
|
||||||
/* Fetch BLOB OIDs, and owner/ACL data */
|
/* Fetch BLOB OIDs, and owner/ACL data */
|
||||||
appendPQExpBuffer(blobQry,
|
appendPQExpBufferStr(blobQry,
|
||||||
"SELECT oid, lomowner, lomacl, "
|
"SELECT oid, lomowner, lomacl, "
|
||||||
"acldefault('L', lomowner) AS acldefault "
|
"acldefault('L', lomowner) AS acldefault "
|
||||||
"FROM pg_largeobject_metadata");
|
"FROM pg_largeobject_metadata");
|
||||||
@ -3685,9 +3685,9 @@ getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
|
|||||||
printfPQExpBuffer(query,
|
printfPQExpBuffer(query,
|
||||||
"SELECT pol.oid, pol.tableoid, pol.polrelid, pol.polname, pol.polcmd, ");
|
"SELECT pol.oid, pol.tableoid, pol.polrelid, pol.polname, pol.polcmd, ");
|
||||||
if (fout->remoteVersion >= 100000)
|
if (fout->remoteVersion >= 100000)
|
||||||
appendPQExpBuffer(query, "pol.polpermissive, ");
|
appendPQExpBufferStr(query, "pol.polpermissive, ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query, "'t' as polpermissive, ");
|
appendPQExpBufferStr(query, "'t' as polpermissive, ");
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBuffer(query,
|
||||||
"CASE WHEN pol.polroles = '{0}' THEN NULL ELSE "
|
"CASE WHEN pol.polroles = '{0}' THEN NULL ELSE "
|
||||||
" pg_catalog.array_to_string(ARRAY(SELECT pg_catalog.quote_ident(rolname) from pg_catalog.pg_roles WHERE oid = ANY(pol.polroles)), ', ') END AS polroles, "
|
" pg_catalog.array_to_string(ARRAY(SELECT pg_catalog.quote_ident(rolname) from pg_catalog.pg_roles WHERE oid = ANY(pol.polroles)), ', ') END AS polroles, "
|
||||||
@ -3912,19 +3912,19 @@ getPublications(Archive *fout, int *numPublications)
|
|||||||
|
|
||||||
/* Get the publications. */
|
/* Get the publications. */
|
||||||
if (fout->remoteVersion >= 130000)
|
if (fout->remoteVersion >= 130000)
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT p.tableoid, p.oid, p.pubname, "
|
"SELECT p.tableoid, p.oid, p.pubname, "
|
||||||
"p.pubowner, "
|
"p.pubowner, "
|
||||||
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, p.pubviaroot "
|
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, p.pubviaroot "
|
||||||
"FROM pg_publication p");
|
"FROM pg_publication p");
|
||||||
else if (fout->remoteVersion >= 110000)
|
else if (fout->remoteVersion >= 110000)
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT p.tableoid, p.oid, p.pubname, "
|
"SELECT p.tableoid, p.oid, p.pubname, "
|
||||||
"p.pubowner, "
|
"p.pubowner, "
|
||||||
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, false AS pubviaroot "
|
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, false AS pubviaroot "
|
||||||
"FROM pg_publication p");
|
"FROM pg_publication p");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT p.tableoid, p.oid, p.pubname, "
|
"SELECT p.tableoid, p.oid, p.pubname, "
|
||||||
"p.pubowner, "
|
"p.pubowner, "
|
||||||
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, false AS pubtruncate, false AS pubviaroot "
|
"p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, false AS pubtruncate, false AS pubviaroot "
|
||||||
@ -4045,7 +4045,7 @@ dumpPublication(Archive *fout, const PublicationInfo *pubinfo)
|
|||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
appendPQExpBufferStr(query, "'");
|
appendPQExpBufferChar(query, '\'');
|
||||||
|
|
||||||
if (pubinfo->pubviaroot)
|
if (pubinfo->pubviaroot)
|
||||||
appendPQExpBufferStr(query, ", publish_via_partition_root = true");
|
appendPQExpBufferStr(query, ", publish_via_partition_root = true");
|
||||||
@ -4466,7 +4466,7 @@ getSubscriptions(Archive *fout)
|
|||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
/* Get the subscriptions in current database. */
|
/* Get the subscriptions in current database. */
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT s.tableoid, s.oid, s.subname,\n"
|
"SELECT s.tableoid, s.oid, s.subname,\n"
|
||||||
" s.subowner,\n"
|
" s.subowner,\n"
|
||||||
" s.subconninfo, s.subslotname, s.subsynccommit,\n"
|
" s.subconninfo, s.subslotname, s.subsynccommit,\n"
|
||||||
@ -5022,7 +5022,7 @@ getNamespaces(Archive *fout, int *numNamespaces)
|
|||||||
* we fetch all namespaces including system ones, so that every object we
|
* we fetch all namespaces including system ones, so that every object we
|
||||||
* read in can be linked to a containing namespace.
|
* read in can be linked to a containing namespace.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(query, "SELECT n.tableoid, n.oid, n.nspname, "
|
appendPQExpBufferStr(query, "SELECT n.tableoid, n.oid, n.nspname, "
|
||||||
"n.nspowner, "
|
"n.nspowner, "
|
||||||
"n.nspacl, "
|
"n.nspacl, "
|
||||||
"acldefault('n', n.nspowner) AS acldefault "
|
"acldefault('n', n.nspowner) AS acldefault "
|
||||||
@ -5250,7 +5250,7 @@ getTypes(Archive *fout, int *numTypes)
|
|||||||
* cost of the subselect probe for all standard types. This would have to
|
* cost of the subselect probe for all standard types. This would have to
|
||||||
* be revisited if the backend ever allows renaming of array types.
|
* be revisited if the backend ever allows renaming of array types.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, typname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, typname, "
|
||||||
"typnamespace, typacl, "
|
"typnamespace, typacl, "
|
||||||
"acldefault('T', typowner) AS acldefault, "
|
"acldefault('T', typowner) AS acldefault, "
|
||||||
"typowner, "
|
"typowner, "
|
||||||
@ -5403,7 +5403,7 @@ getOperators(Archive *fout, int *numOprs)
|
|||||||
* system-defined operators at dump-out time.
|
* system-defined operators at dump-out time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, oprname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, oprname, "
|
||||||
"oprnamespace, "
|
"oprnamespace, "
|
||||||
"oprowner, "
|
"oprowner, "
|
||||||
"oprkind, "
|
"oprkind, "
|
||||||
@ -5477,7 +5477,7 @@ getCollations(Archive *fout, int *numCollations)
|
|||||||
* system-defined collations at dump-out time.
|
* system-defined collations at dump-out time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, collname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, collname, "
|
||||||
"collnamespace, "
|
"collnamespace, "
|
||||||
"collowner "
|
"collowner "
|
||||||
"FROM pg_collation");
|
"FROM pg_collation");
|
||||||
@ -5545,7 +5545,7 @@ getConversions(Archive *fout, int *numConversions)
|
|||||||
* system-defined conversions at dump-out time.
|
* system-defined conversions at dump-out time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, conname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, conname, "
|
||||||
"connamespace, "
|
"connamespace, "
|
||||||
"conowner "
|
"conowner "
|
||||||
"FROM pg_conversion");
|
"FROM pg_conversion");
|
||||||
@ -5682,7 +5682,7 @@ getOpclasses(Archive *fout, int *numOpclasses)
|
|||||||
* system-defined opclasses at dump-out time.
|
* system-defined opclasses at dump-out time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, opcname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, opcname, "
|
||||||
"opcnamespace, "
|
"opcnamespace, "
|
||||||
"opcowner "
|
"opcowner "
|
||||||
"FROM pg_opclass");
|
"FROM pg_opclass");
|
||||||
@ -5750,7 +5750,7 @@ getOpfamilies(Archive *fout, int *numOpfamilies)
|
|||||||
* system-defined opfamilies at dump-out time.
|
* system-defined opfamilies at dump-out time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, opfname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, opfname, "
|
||||||
"opfnamespace, "
|
"opfnamespace, "
|
||||||
"opfowner "
|
"opfowner "
|
||||||
"FROM pg_opfamily");
|
"FROM pg_opfamily");
|
||||||
@ -5856,7 +5856,7 @@ getAggregates(Archive *fout, int *numAggs)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, proname AS aggname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, proname AS aggname, "
|
||||||
"pronamespace AS aggnamespace, "
|
"pronamespace AS aggnamespace, "
|
||||||
"pronargs, proargtypes, "
|
"pronargs, proargtypes, "
|
||||||
"proowner, "
|
"proowner, "
|
||||||
@ -6205,7 +6205,7 @@ getTables(Archive *fout, int *numTables)
|
|||||||
* wrong answers if any concurrent DDL is happening.
|
* wrong answers if any concurrent DDL is happening.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT c.tableoid, c.oid, c.relname, "
|
"SELECT c.tableoid, c.oid, c.relname, "
|
||||||
"c.relnamespace, c.relkind, c.reltype, "
|
"c.relnamespace, c.relkind, c.reltype, "
|
||||||
"c.relowner, "
|
"c.relowner, "
|
||||||
@ -6732,7 +6732,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
|
|||||||
}
|
}
|
||||||
appendPQExpBufferChar(tbloids, '}');
|
appendPQExpBufferChar(tbloids, '}');
|
||||||
|
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT t.tableoid, t.oid, i.indrelid, "
|
"SELECT t.tableoid, t.oid, i.indrelid, "
|
||||||
"t.relname AS indexname, "
|
"t.relname AS indexname, "
|
||||||
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
|
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
|
||||||
@ -6747,14 +6747,14 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
|
|||||||
|
|
||||||
|
|
||||||
if (fout->remoteVersion >= 90400)
|
if (fout->remoteVersion >= 90400)
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"i.indisreplident, ");
|
"i.indisreplident, ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"false AS indisreplident, ");
|
"false AS indisreplident, ");
|
||||||
|
|
||||||
if (fout->remoteVersion >= 110000)
|
if (fout->remoteVersion >= 110000)
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"inh.inhparent AS parentidx, "
|
"inh.inhparent AS parentidx, "
|
||||||
"i.indnkeyatts AS indnkeyatts, "
|
"i.indnkeyatts AS indnkeyatts, "
|
||||||
"i.indnatts AS indnatts, "
|
"i.indnatts AS indnatts, "
|
||||||
@ -6767,7 +6767,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
|
|||||||
" WHERE attrelid = i.indexrelid AND "
|
" WHERE attrelid = i.indexrelid AND "
|
||||||
" attstattarget >= 0) AS indstatvals, ");
|
" attstattarget >= 0) AS indstatvals, ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"0 AS parentidx, "
|
"0 AS parentidx, "
|
||||||
"i.indnatts AS indnkeyatts, "
|
"i.indnatts AS indnkeyatts, "
|
||||||
"i.indnatts AS indnatts, "
|
"i.indnatts AS indnatts, "
|
||||||
@ -6775,10 +6775,10 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
|
|||||||
"'' AS indstatvals, ");
|
"'' AS indstatvals, ");
|
||||||
|
|
||||||
if (fout->remoteVersion >= 150000)
|
if (fout->remoteVersion >= 150000)
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"i.indnullsnotdistinct ");
|
"i.indnullsnotdistinct ");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"false AS indnullsnotdistinct ");
|
"false AS indnullsnotdistinct ");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -7002,11 +7002,11 @@ getExtendedStatistics(Archive *fout)
|
|||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
if (fout->remoteVersion < 130000)
|
if (fout->remoteVersion < 130000)
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, stxname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, stxname, "
|
||||||
"stxnamespace, stxowner, (-1) AS stxstattarget "
|
"stxnamespace, stxowner, (-1) AS stxstattarget "
|
||||||
"FROM pg_catalog.pg_statistic_ext");
|
"FROM pg_catalog.pg_statistic_ext");
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, stxname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, stxname, "
|
||||||
"stxnamespace, stxowner, stxstattarget "
|
"stxnamespace, stxowner, stxstattarget "
|
||||||
"FROM pg_catalog.pg_statistic_ext");
|
"FROM pg_catalog.pg_statistic_ext");
|
||||||
|
|
||||||
@ -7729,7 +7729,7 @@ getEventTriggers(Archive *fout, int *numEventTriggers)
|
|||||||
|
|
||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT e.tableoid, e.oid, evtname, evtenabled, "
|
"SELECT e.tableoid, e.oid, evtname, evtenabled, "
|
||||||
"evtevent, evtowner, "
|
"evtevent, evtowner, "
|
||||||
"array_to_string(array("
|
"array_to_string(array("
|
||||||
@ -7809,7 +7809,7 @@ getProcLangs(Archive *fout, int *numProcLangs)
|
|||||||
int i_acldefault;
|
int i_acldefault;
|
||||||
int i_lanowner;
|
int i_lanowner;
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, "
|
||||||
"lanname, lanpltrusted, lanplcallfoid, "
|
"lanname, lanpltrusted, lanplcallfoid, "
|
||||||
"laninline, lanvalidator, "
|
"laninline, lanvalidator, "
|
||||||
"lanacl, "
|
"lanacl, "
|
||||||
@ -8768,7 +8768,7 @@ getTSDictionaries(Archive *fout, int *numTSDicts)
|
|||||||
|
|
||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, dictname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, dictname, "
|
||||||
"dictnamespace, dictowner, "
|
"dictnamespace, dictowner, "
|
||||||
"dicttemplate, dictinitoption "
|
"dicttemplate, dictinitoption "
|
||||||
"FROM pg_ts_dict");
|
"FROM pg_ts_dict");
|
||||||
@ -8904,7 +8904,7 @@ getTSConfigurations(Archive *fout, int *numTSConfigs)
|
|||||||
|
|
||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, cfgname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, cfgname, "
|
||||||
"cfgnamespace, cfgowner, cfgparser "
|
"cfgnamespace, cfgowner, cfgparser "
|
||||||
"FROM pg_ts_config");
|
"FROM pg_ts_config");
|
||||||
|
|
||||||
@ -8972,7 +8972,7 @@ getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
|
|||||||
|
|
||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, fdwname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, fdwname, "
|
||||||
"fdwowner, "
|
"fdwowner, "
|
||||||
"fdwhandler::pg_catalog.regproc, "
|
"fdwhandler::pg_catalog.regproc, "
|
||||||
"fdwvalidator::pg_catalog.regproc, "
|
"fdwvalidator::pg_catalog.regproc, "
|
||||||
@ -9063,7 +9063,7 @@ getForeignServers(Archive *fout, int *numForeignServers)
|
|||||||
|
|
||||||
query = createPQExpBuffer();
|
query = createPQExpBuffer();
|
||||||
|
|
||||||
appendPQExpBuffer(query, "SELECT tableoid, oid, srvname, "
|
appendPQExpBufferStr(query, "SELECT tableoid, oid, srvname, "
|
||||||
"srvowner, "
|
"srvowner, "
|
||||||
"srvfdw, srvtype, srvversion, srvacl, "
|
"srvfdw, srvtype, srvversion, srvacl, "
|
||||||
"acldefault('S', srvowner) AS acldefault, "
|
"acldefault('S', srvowner) AS acldefault, "
|
||||||
@ -9167,7 +9167,7 @@ getDefaultACLs(Archive *fout, int *numDefaultACLs)
|
|||||||
* for the case of 'S' (DEFACLOBJ_SEQUENCE) which must be converted to
|
* for the case of 'S' (DEFACLOBJ_SEQUENCE) which must be converted to
|
||||||
* 's'.
|
* 's'.
|
||||||
*/
|
*/
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBufferStr(query,
|
||||||
"SELECT oid, tableoid, "
|
"SELECT oid, tableoid, "
|
||||||
"defaclrole, "
|
"defaclrole, "
|
||||||
"defaclnamespace, "
|
"defaclnamespace, "
|
||||||
@ -15491,7 +15491,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
|
|||||||
appendStringLiteralAH(q, qualrelname, fout);
|
appendStringLiteralAH(q, qualrelname, fout);
|
||||||
appendPQExpBufferStr(q, "::pg_catalog.regclass,");
|
appendPQExpBufferStr(q, "::pg_catalog.regclass,");
|
||||||
appendStringLiteralAH(q, tbinfo->attnames[j], fout);
|
appendStringLiteralAH(q, tbinfo->attnames[j], fout);
|
||||||
appendPQExpBufferStr(q, ",");
|
appendPQExpBufferChar(q, ',');
|
||||||
appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
|
appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
|
||||||
appendPQExpBufferStr(q, ");\n\n");
|
appendPQExpBufferStr(q, ");\n\n");
|
||||||
}
|
}
|
||||||
@ -16361,11 +16361,11 @@ dumpConstraint(Archive *fout, const ConstraintInfo *coninfo)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(q, "%s",
|
appendPQExpBufferStr(q,
|
||||||
coninfo->contype == 'p' ? "PRIMARY KEY" : "UNIQUE");
|
coninfo->contype == 'p' ? "PRIMARY KEY" : "UNIQUE");
|
||||||
if (indxinfo->indnullsnotdistinct)
|
if (indxinfo->indnullsnotdistinct)
|
||||||
appendPQExpBuffer(q, " NULLS NOT DISTINCT");
|
appendPQExpBufferStr(q, " NULLS NOT DISTINCT");
|
||||||
appendPQExpBuffer(q, " (");
|
appendPQExpBufferStr(q, " (");
|
||||||
for (k = 0; k < indxinfo->indnkeyattrs; k++)
|
for (k = 0; k < indxinfo->indnkeyattrs; k++)
|
||||||
{
|
{
|
||||||
int indkey = (int) indxinfo->indkeys[k];
|
int indkey = (int) indxinfo->indkeys[k];
|
||||||
|
@ -978,7 +978,7 @@ dumpRoleMembership(PGconn *conn)
|
|||||||
"ug.rolname AS grantor, "
|
"ug.rolname AS grantor, "
|
||||||
"a.admin_option");
|
"a.admin_option");
|
||||||
if (dump_inherit_option)
|
if (dump_inherit_option)
|
||||||
appendPQExpBuffer(buf, ", a.inherit_option");
|
appendPQExpBufferStr(buf, ", a.inherit_option");
|
||||||
appendPQExpBuffer(buf, " FROM pg_auth_members a "
|
appendPQExpBuffer(buf, " FROM pg_auth_members a "
|
||||||
"LEFT JOIN %s ur on ur.oid = a.roleid "
|
"LEFT JOIN %s ur on ur.oid = a.roleid "
|
||||||
"LEFT JOIN %s um on um.oid = a.member "
|
"LEFT JOIN %s um on um.oid = a.member "
|
||||||
|
@ -3512,8 +3512,7 @@ printVerboseErrorMessages(CState *st, pg_time_usec_t *now, bool is_retry)
|
|||||||
resetPQExpBuffer(buf);
|
resetPQExpBuffer(buf);
|
||||||
|
|
||||||
printfPQExpBuffer(buf, "client %d ", st->id);
|
printfPQExpBuffer(buf, "client %d ", st->id);
|
||||||
appendPQExpBuffer(buf, "%s",
|
appendPQExpBufferStr(buf, (is_retry ?
|
||||||
(is_retry ?
|
|
||||||
"repeats the transaction after the error" :
|
"repeats the transaction after the error" :
|
||||||
"ends the failed transaction"));
|
"ends the failed transaction"));
|
||||||
appendPQExpBuffer(buf, " (try %u", st->tries);
|
appendPQExpBuffer(buf, " (try %u", st->tries);
|
||||||
@ -3532,7 +3531,7 @@ printVerboseErrorMessages(CState *st, pg_time_usec_t *now, bool is_retry)
|
|||||||
appendPQExpBuffer(buf, ", %.3f%% of the maximum time of tries was used",
|
appendPQExpBuffer(buf, ", %.3f%% of the maximum time of tries was used",
|
||||||
(100.0 * (*now - st->txn_scheduled) / latency_limit));
|
(100.0 * (*now - st->txn_scheduled) / latency_limit));
|
||||||
}
|
}
|
||||||
appendPQExpBuffer(buf, ")\n");
|
appendPQExpBufferStr(buf, ")\n");
|
||||||
|
|
||||||
pg_log_info("%s", buf->data);
|
pg_log_info("%s", buf->data);
|
||||||
}
|
}
|
||||||
|
@ -4889,9 +4889,9 @@ pset_value_string(const char *param, printQueryOpt *popt)
|
|||||||
else if (strcmp(param, "footer") == 0)
|
else if (strcmp(param, "footer") == 0)
|
||||||
return pstrdup(pset_bool_string(popt->topt.default_footer));
|
return pstrdup(pset_bool_string(popt->topt.default_footer));
|
||||||
else if (strcmp(param, "format") == 0)
|
else if (strcmp(param, "format") == 0)
|
||||||
return psprintf("%s", _align2string(popt->topt.format));
|
return pstrdup(_align2string(popt->topt.format));
|
||||||
else if (strcmp(param, "linestyle") == 0)
|
else if (strcmp(param, "linestyle") == 0)
|
||||||
return psprintf("%s", get_line_style(&popt->topt)->name);
|
return pstrdup(get_line_style(&popt->topt)->name);
|
||||||
else if (strcmp(param, "null") == 0)
|
else if (strcmp(param, "null") == 0)
|
||||||
return pset_quoted_string(popt->nullPrint
|
return pset_quoted_string(popt->nullPrint
|
||||||
? popt->nullPrint
|
? popt->nullPrint
|
||||||
|
@ -2148,7 +2148,7 @@ describeOneTableDetails(const char *schemaname,
|
|||||||
"SELECT inhparent::pg_catalog.regclass,\n"
|
"SELECT inhparent::pg_catalog.regclass,\n"
|
||||||
" pg_catalog.pg_get_expr(c.relpartbound, c.oid),\n ");
|
" pg_catalog.pg_get_expr(c.relpartbound, c.oid),\n ");
|
||||||
|
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBufferStr(&buf,
|
||||||
pset.sversion >= 140000 ? "inhdetachpending" :
|
pset.sversion >= 140000 ? "inhdetachpending" :
|
||||||
"false as inhdetachpending");
|
"false as inhdetachpending");
|
||||||
|
|
||||||
@ -2311,7 +2311,7 @@ describeOneTableDetails(const char *schemaname,
|
|||||||
printfPQExpBuffer(&tmpbuf, _("unique"));
|
printfPQExpBuffer(&tmpbuf, _("unique"));
|
||||||
if (strcmp(indnullsnotdistinct, "t") == 0)
|
if (strcmp(indnullsnotdistinct, "t") == 0)
|
||||||
appendPQExpBufferStr(&tmpbuf, _(" nulls not distinct"));
|
appendPQExpBufferStr(&tmpbuf, _(" nulls not distinct"));
|
||||||
appendPQExpBuffer(&tmpbuf, _(", "));
|
appendPQExpBufferStr(&tmpbuf, _(", "));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
resetPQExpBuffer(&tmpbuf);
|
resetPQExpBuffer(&tmpbuf);
|
||||||
|
Reference in New Issue
Block a user