|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <ctype.h>#include "common/keywords.h"#include "fe_utils/string_utils.h"#include "mb/pg_wchar.h"
Go to the source code of this file.
Macros | |
| #define | WHEREAND() |
Variables | |
| int | quote_all_identifiers = 0 |
| PQExpBuffer(* | getLocalPQExpBuffer )(void) |
| #define WHEREAND | ( | ) |
| void appendByteaLiteral | ( | PQExpBuffer | buf, |
| const unsigned char * | str, | ||
| size_t | length, | ||
| bool | std_strings | ||
| ) |
Definition at line 527 of file string_utils.c.
References buf, enlargePQExpBuffer(), hextbl, source, and str.
| void appendConnStrVal | ( | PQExpBuffer | buf, |
| const char * | str | ||
| ) |
Definition at line 698 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, fb(), 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 902 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), PQExpBufferData::data, fb(), PQExpBufferData::len, pg_strcasecmp(), and value.
Referenced by fetchAttributeStats(), and getNamespaces().
| void appendPsqlMetaConnect | ( | PQExpBuffer | buf, |
| const char * | dbname | ||
| ) |
Definition at line 743 of file string_utils.c.
References _, appendConnStrVal(), appendPQExpBufferChar(), appendPQExpBufferStr(), buf, connstr, dbname, EXIT_FAILURE, fb(), fmtIdEnc(), fprintf, initPQExpBuffer(), PG_SQL_ASCII, 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 966 of file string_utils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteral(), encoding, fb(), fmtId(), free, i, name, noptions, parsePGArray(), and value.
Referenced by appendReloptionsArrayAH(), and get_create_object_cmd().
| void appendShellString | ( | PQExpBuffer | buf, |
| const char * | str | ||
| ) |
Definition at line 582 of file string_utils.c.
References _, appendShellStringNoError(), buf, EXIT_FAILURE, fb(), 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 594 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, fb(), and str.
Referenced by appendShellString(), and psql_get_variable().
Definition at line 351 of file string_utils.c.
References buf, encoding, enlargePQExpBuffer(), fb(), i, IS_HIGHBIT_SET, pg_encoding_set_invalid(), pg_encoding_verifymbchar(), PQmblen(), remaining, source, SQL_STR_DOUBLE, and str.
Referenced by appendReloptionsArray(), appendStringLiteralConn(), and escape_append_literal().
| void appendStringLiteralConn | ( | PQExpBuffer | buf, |
| const char * | str, | ||
| PGconn * | conn | ||
| ) |
Definition at line 446 of file string_utils.c.
References appendPQExpBufferChar(), appendStringLiteral(), buf, conn, enlargePQExpBuffer(), ESCAPE_STRING_SYNTAX, fb(), 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_tables_list(), getTables(), lookup_object_oid(), main(), makeAlterConfigCommand(), processSQLNamePattern(), retrieve_objects(), and setup_connection().
Definition at line 484 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, createPQExpBuffer(), destroyPQExpBuffer(), fb(), and str.
Referenced by dumpFunc().
|
static |
Definition at line 248 of file string_utils.c.
References fb(), fmtIdEnc(), and getFmtEncoding().
Referenced by _doSetFixedOutputState(), _getObjectDescription(), _printTableAccessMethodNoStorage(), _printTocEntry(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), append_depends_on_extension(), 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(), escape_fmt_id(), fmtCopyColumnList(), format_aggregate_signature(), format_function_arguments(), format_function_signature(), get_create_object_cmd(), get_language_name(), getFormattedOperatorName(), getPublicationTables(), main(), makeAlterConfigCommand(), and setup_connection().
Definition at line 101 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), encoding, enlargePQExpBuffer(), fb(), getLocalPQExpBuffer, i, IS_HIGHBIT_SET, pg_encoding_mblen(), pg_encoding_set_invalid(), pg_encoding_verifymbchar(), quote_all_identifiers, remaining, ScanKeywordCategories, ScanKeywordLookup(), ScanKeywords, and UNRESERVED_KEYWORD.
Referenced by appendPsqlMetaConnect(), fmtId(), fmtQualifiedIdEnc(), gen_reindex_command(), and main().
Definition at line 296 of file string_utils.c.
References fmtQualifiedIdEnc(), and getFmtEncoding().
Referenced by _disableTriggersIfNecessary(), _enableTriggersIfNecessary(), _printTableAccessMethodNoStorage(), is_load_via_partition_root(), lockTableForWorker(), and restore_toc_entry().
Definition at line 263 of file string_utils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), createPQExpBuffer(), destroyPQExpBuffer(), encoding, fb(), fmtIdEnc(), and getLocalPQExpBuffer.
Referenced by appendQualifiedRelation(), fmtQualifiedId(), get_parallel_tabidx_list(), get_parallel_tables_list(), and retrieve_objects().
Definition at line 313 of file string_utils.c.
References buf, fb(), and snprintf.
Referenced by connection_warnings(), describeAccessMethods(), describeFunctions(), describePublications(), describeSubscriptions(), listEventTriggers(), listExtendedStats(), listPartitionedTables(), listPublications(), printVersion(), and SyncVariables().
Definition at line 78 of file string_utils.c.
References Assert, fb(), and PG_UTF8.
Referenced by fmtId(), and fmtQualifiedId().
Definition at line 819 of file string_utils.c.
References fb(), items, malloc, and nitems.
Referenced by appendReloptionsArray(), buildACLCommands(), dumpFunc(), dumpIndex(), dumpSearchPath(), dumpSubscription(), getIndexes(), 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 1225 of file string_utils.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), Assert, buf, encoding, fb(), 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 1053 of file string_utils.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendStringLiteralConn(), buf, conn, fb(), initPQExpBuffer(), 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().
Definition at line 69 of file string_utils.c.
References encoding, and fb().
Referenced by escape_fmt_id(), exec_command_encoding(), main(), processEncodingEntry(), setup_connection(), and SyncVariables().
|
default |
Definition at line 28 of file string_utils.c.
Referenced by fmtIdEnc(), fmtQualifiedIdEnc(), and ParallelBackupStart().
| int quote_all_identifiers = 0 |
Definition at line 27 of file string_utils.c.
Referenced by fmtIdEnc().