PostgreSQL Source Code
git master
|
Go to the source code of this file.
Functions | |
const char * | fmtId (const char *rawid) |
const char * | fmtQualifiedId (const char *schema, const char *id) |
char * | formatPGVersionNumber (int version_number, bool include_minor, char *buf, size_t buflen) |
void | appendStringLiteral (PQExpBuffer buf, const char *str, int encoding, bool std_strings) |
void | appendStringLiteralConn (PQExpBuffer buf, const char *str, PGconn *conn) |
void | appendStringLiteralDQ (PQExpBuffer buf, const char *str, const char *dqprefix) |
void | appendByteaLiteral (PQExpBuffer buf, const unsigned char *str, size_t length, bool std_strings) |
void | appendShellString (PQExpBuffer buf, const char *str) |
bool | appendShellStringNoError (PQExpBuffer buf, const char *str) |
void | appendConnStrVal (PQExpBuffer buf, const char *str) |
void | appendPsqlMetaConnect (PQExpBuffer buf, const char *dbname) |
bool | parsePGArray (const char *atext, char ***itemarray, int *nitems) |
void | appendPGArray (PQExpBuffer buffer, const char *value) |
bool | appendReloptionsArray (PQExpBuffer buffer, const char *reloptions, const char *prefix, int encoding, bool std_strings) |
bool | processSQLNamePattern (PGconn *conn, PQExpBuffer buf, const char *pattern, bool have_where, bool force_escape, const char *schemavar, const char *namevar, const char *altnamevar, const char *visibilityrule, PQExpBuffer dbnamebuf, int *dotcnt) |
void | patternToSQLRegex (int encoding, PQExpBuffer dbnamebuf, PQExpBuffer schemabuf, PQExpBuffer namebuf, const char *pattern, bool force_escape, bool want_literal_dbname, int *dotcnt) |
Variables | |
PGDLLIMPORT int | quote_all_identifiers |
PQExpBuffer(* | getLocalPQExpBuffer )(void) |
void appendByteaLiteral | ( | PQExpBuffer | buf, |
const unsigned char * | str, | ||
size_t | length, | ||
bool | std_strings | ||
) |
Definition at line 374 of file string_utils.c.
References buf, enlargePQExpBuffer(), hextbl, source, and str.
void appendConnStrVal | ( | PQExpBuffer | buf, |
const char * | str | ||
) |
Definition at line 545 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, and str.
Referenced by appendConnStrItem(), appendPsqlMetaConnect(), constructConnStr(), generate_old_dump(), GenerateRecoveryConfig(), get_db_conn(), runPgDump(), and start_conn().
void appendPGArray | ( | PQExpBuffer | buffer, |
const char * | value | ||
) |
Definition at line 740 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), PQExpBufferData::data, PQExpBufferData::len, pg_strcasecmp(), and value.
Referenced by getNamespaces().
void appendPsqlMetaConnect | ( | PQExpBuffer | buf, |
const char * | dbname | ||
) |
Definition at line 590 of file string_utils.c.
References _, appendConnStrVal(), appendPQExpBufferChar(), appendPQExpBufferStr(), buf, connstr, dbname, exit(), EXIT_FAILURE, fmtId(), fprintf, initPQExpBuffer(), and termPQExpBuffer().
Referenced by _reconnectToDB(), old_9_6_invalidate_hash_indexes(), and process_extension_updates().
bool appendReloptionsArray | ( | PQExpBuffer | buffer, |
const char * | reloptions, | ||
const char * | prefix, | ||
int | encoding, | ||
bool | std_strings | ||
) |
Definition at line 804 of file string_utils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteral(), encoding, fmtId(), free, i, name, noptions, options, parsePGArray(), and value.
Referenced by appendReloptionsArrayAH(), and get_create_object_cmd().
void appendShellString | ( | PQExpBuffer | buf, |
const char * | str | ||
) |
Definition at line 429 of file string_utils.c.
References _, appendShellStringNoError(), buf, exit(), EXIT_FAILURE, fprintf, and str.
Referenced by cluster_conn_opts(), ensureCleanShutdown(), generate_old_dump(), getRestoreCommand(), main(), output_completion_banner(), runPgDump(), start_standby_server(), and test_specific_config_settings().
bool appendShellStringNoError | ( | PQExpBuffer | buf, |
const char * | str | ||
) |
Definition at line 441 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, and str.
Referenced by appendShellString(), and psql_get_variable().
void appendStringLiteral | ( | PQExpBuffer | buf, |
const char * | str, | ||
int | encoding, | ||
bool | std_strings | ||
) |
Definition at line 215 of file string_utils.c.
References buf, encoding, enlargePQExpBuffer(), i, IS_HIGHBIT_SET, len, PQmblen(), source, SQL_STR_DOUBLE, and str.
Referenced by appendReloptionsArray(), and appendStringLiteralConn().
void appendStringLiteralConn | ( | PQExpBuffer | buf, |
const char * | str, | ||
PGconn * | conn | ||
) |
Definition at line 293 of file string_utils.c.
References appendPQExpBufferChar(), appendStringLiteral(), buf, conn, enlargePQExpBuffer(), ESCAPE_STRING_SYNTAX, PQclientEncoding(), PQescapeStringConn(), PQserverVersion(), and str.
Referenced by append_db_pattern_cte(), append_rel_pattern_filtered_cte(), append_rel_pattern_raw_cte(), appendQualifiedRelation(), create_logical_replication_slots(), dumpRoles(), dumpTablespaces(), dumpUserConfig(), emitShSecLabels(), get_parallel_object_list(), getTables(), lookup_object_oid(), main(), makeAlterConfigCommand(), processSQLNamePattern(), setup_connection(), and vacuum_one_database().
void appendStringLiteralDQ | ( | PQExpBuffer | buf, |
const char * | str, | ||
const char * | dqprefix | ||
) |
Definition at line 331 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), and str.
Referenced by dumpFunc().
const char* fmtId | ( | const char * | rawid | ) |
Definition at line 64 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), PQExpBufferData::data, getLocalPQExpBuffer, quote_all_identifiers, ScanKeywordCategories, ScanKeywordLookup(), ScanKeywords, and UNRESERVED_KEYWORD.
Referenced by _doSetFixedOutputState(), _getObjectDescription(), _printTableAccessMethodNoStorage(), _printTocEntry(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), append_depends_on_extension(), appendPsqlMetaConnect(), appendReloptionsArray(), binary_upgrade_extension_member(), buildACLCommands(), buildDefaultACLCommands(), createDummyViewAsClause(), describeOneTableDetails(), dropDBs(), dropRoles(), dropTablespaces(), dumpAccessMethod(), dumpAgg(), dumpAttrDef(), dumpBaseType(), dumpCast(), dumpCollation(), dumpCommentExtended(), dumpCompositeType(), dumpCompositeTypeColComments(), dumpConstraint(), dumpConversion(), dumpDatabase(), dumpDomain(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpIndex(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpPublicationNamespace(), dumpPublicationTable(), dumpRangeType(), dumpRoleGUCPrivs(), dumpRoleMembership(), dumpRoles(), dumpRule(), dumpSearchPath(), dumpSecLabel(), dumpSequence(), dumpStatisticsExt(), dumpSubscription(), dumpTable(), dumpTableComment(), dumpTableConstraintComment(), dumpTableData_insert(), dumpTableSchema(), dumpTableSecLabel(), dumpTablespaces(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), dumpUserMappings(), emitShSecLabels(), fmtCopyColumnList(), fmtQualifiedId(), format_aggregate_signature(), format_function_arguments(), format_function_signature(), get_create_object_cmd(), get_language_name(), getFormattedOperatorName(), getPublicationTables(), main(), makeAlterConfigCommand(), run_reindex_command(), and setup_connection().
const char* fmtQualifiedId | ( | const char * | schema, |
const char * | id | ||
) |
Definition at line 145 of file string_utils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), fmtId(), and getLocalPQExpBuffer.
Referenced by _disableTriggersIfNecessary(), _enableTriggersIfNecessary(), _printTableAccessMethodNoStorage(), appendQualifiedRelation(), get_parallel_object_list(), is_load_via_partition_root(), lockTableForWorker(), restore_toc_entry(), and vacuum_one_database().
char* formatPGVersionNumber | ( | int | version_number, |
bool | include_minor, | ||
char * | buf, | ||
size_t | buflen | ||
) |
Definition at line 177 of file string_utils.c.
Referenced by connection_warnings(), describeAccessMethods(), describeFunctions(), describePublications(), describeSubscriptions(), listEventTriggers(), listExtendedStats(), listPartitionedTables(), listPublications(), printVersion(), and SyncVariables().
bool parsePGArray | ( | const char * | atext, |
char *** | itemarray, | ||
int * | nitems | ||
) |
Definition at line 657 of file string_utils.c.
References items, malloc, and nitems.
Referenced by appendReloptionsArray(), buildACLCommands(), dumpFunc(), dumpIndex(), dumpSearchPath(), dumpSubscription(), getPublicationTables(), and processExtensionTables().
void patternToSQLRegex | ( | int | encoding, |
PQExpBuffer | dbnamebuf, | ||
PQExpBuffer | schemabuf, | ||
PQExpBuffer | namebuf, | ||
const char * | pattern, | ||
bool | force_escape, | ||
bool | want_literal_dbname, | ||
int * | dotcnt | ||
) |
Definition at line 1063 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), Assert, buf, PQExpBufferData::data, encoding, i, initPQExpBuffer(), pg_tolower(), PQmblenBounded(), and termPQExpBuffer().
Referenced by append_database_pattern(), append_relation_pattern_helper(), append_schema_pattern(), and processSQLNamePattern().
bool processSQLNamePattern | ( | PGconn * | conn, |
PQExpBuffer | buf, | ||
const char * | pattern, | ||
bool | have_where, | ||
bool | force_escape, | ||
const char * | schemavar, | ||
const char * | namevar, | ||
const char * | altnamevar, | ||
const char * | visibilityrule, | ||
PQExpBuffer | dbnamebuf, | ||
int * | dotcnt | ||
) |
Definition at line 891 of file string_utils.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendStringLiteralConn(), buf, conn, PQExpBufferData::data, initPQExpBuffer(), PQExpBufferData::len, patternToSQLRegex(), PQclientEncoding(), PQserverVersion(), termPQExpBuffer(), and WHEREAND.
Referenced by describeConfigurationParameters(), expand_dbname_patterns(), expand_extension_name_patterns(), expand_foreign_server_name_patterns(), expand_schema_name_patterns(), expand_table_name_patterns(), and validateSQLNamePattern().
|
externdefault |
Definition at line 27 of file string_utils.c.
Referenced by fmtId(), fmtQualifiedId(), and ParallelBackupStart().
|
extern |
Definition at line 337 of file ruleutils.c.