PostgreSQL Source Code  git master
pqexpbuffer.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PQExpBufferData
 

Macros

#define PQExpBufferBroken(str)    ((str) == NULL || (str)->maxlen == 0)
 
#define PQExpBufferDataBroken(buf)    ((buf).maxlen == 0)
 
#define INITIAL_EXPBUFFER_SIZE   256
 

Typedefs

typedef struct PQExpBufferData PQExpBufferData
 
typedef PQExpBufferDataPQExpBuffer
 

Functions

PQExpBuffer createPQExpBuffer (void)
 
void initPQExpBuffer (PQExpBuffer str)
 
void destroyPQExpBuffer (PQExpBuffer str)
 
void termPQExpBuffer (PQExpBuffer str)
 
void resetPQExpBuffer (PQExpBuffer str)
 
int enlargePQExpBuffer (PQExpBuffer str, size_t needed)
 
void printfPQExpBuffer (PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2
 
void void appendPQExpBuffer (PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2
 
void void void appendPQExpBufferStr (PQExpBuffer str, const char *data)
 
void appendPQExpBufferChar (PQExpBuffer str, char ch)
 
void appendBinaryPQExpBuffer (PQExpBuffer str, const char *data, size_t datalen)
 

Macro Definition Documentation

◆ INITIAL_EXPBUFFER_SIZE

#define INITIAL_EXPBUFFER_SIZE   256

Definition at line 76 of file pqexpbuffer.h.

◆ PQExpBufferBroken

#define PQExpBufferBroken (   str)     ((str) == NULL || (str)->maxlen == 0)

Definition at line 59 of file pqexpbuffer.h.

◆ PQExpBufferDataBroken

#define PQExpBufferDataBroken (   buf)     ((buf).maxlen == 0)

Definition at line 67 of file pqexpbuffer.h.

Typedef Documentation

◆ PQExpBuffer

Definition at line 51 of file pqexpbuffer.h.

◆ PQExpBufferData

Function Documentation

◆ appendBinaryPQExpBuffer()

void appendBinaryPQExpBuffer ( PQExpBuffer  str,
const char *  data,
size_t  datalen 
)

Definition at line 399 of file pqexpbuffer.c.

400 {
401  /* Make more room if needed */
402  if (!enlargePQExpBuffer(str, datalen))
403  return;
404 
405  /* OK, append the data */
406  memcpy(str->data + str->len, data, datalen);
407  str->len += datalen;
408 
409  /*
410  * Keep a trailing null in place, even though it's probably useless for
411  * binary data...
412  */
413  str->data[str->len] = '\0';
414 }
const void * data
int enlargePQExpBuffer(PQExpBuffer str, size_t needed)
Definition: pqexpbuffer.c:174

References data, enlargePQExpBuffer(), and generate_unaccent_rules::str.

Referenced by appendPQExpBufferStr(), createViewAsClause(), pg_GSS_error_int(), and pqGets_internal().

◆ appendPQExpBuffer()

void void appendPQExpBuffer ( PQExpBuffer  str,
const char *  fmt,
  ... 
)

◆ appendPQExpBufferChar()

void appendPQExpBufferChar ( PQExpBuffer  str,
char  ch 
)

Definition at line 380 of file pqexpbuffer.c.

381 {
382  /* Make more room if needed */
383  if (!enlargePQExpBuffer(str, 1))
384  return;
385 
386  /* OK, append the character */
387  str->data[str->len] = ch;
388  str->len++;
389  str->data[str->len] = '\0';
390 }

References enlargePQExpBuffer(), and generate_unaccent_rules::str.

Referenced by _doSetSessionAuth(), AddAcl(), appendConnStrVal(), appendPGArray(), AppendPlainCommandOption(), appendPsqlMetaConnect(), appendShellStringNoError(), appendStringLiteralConn(), appendStringLiteralDQ(), binary_upgrade_set_pg_class_oids(), build_client_first_message(), cluster_conn_opts(), cluster_one_database(), conninfo_uri_parse_options(), constructConnStr(), createDummyViewAsClause(), createPartitions(), CreateReplicationSlot(), dequoteAclUserName(), describeOneTableDetails(), describeRoles(), do_edit(), dumpCompositeType(), dumpConstraint(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpRule(), dumpTableData_insert(), dumpTableSchema(), dumpUserConfig(), ExecuteSimpleCommands(), fmtCopyColumnList(), fmtId(), format_aggregate_signature(), format_function_signature(), gather_boolean_expression(), GenerateRecoveryConfig(), get_create_object_cmd(), getAggregates(), getConstraints(), getFuncs(), getIndexes(), getNamespaces(), getPolicies(), getTableAttrs(), getTriggers(), indent_lines(), main(), MainLoop(), minimal_error_message(), output_completion_banner(), patternToSQLRegex(), pg_append_history(), pg_GSS_error(), pg_GSS_error_int(), pqBuildErrorMessage3(), PQconnectPoll(), prepare_vacuum_command(), processSQLNamePattern(), quoteAclUserName(), reportErrorPosition(), run_reindex_command(), and StreamLogicalLog().

◆ appendPQExpBufferStr()

void void void appendPQExpBufferStr ( PQExpBuffer  str,
const char *  data 
)

Definition at line 369 of file pqexpbuffer.c.

370 {
372 }
void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen)
Definition: pqexpbuffer.c:399

References appendBinaryPQExpBuffer(), data, and generate_unaccent_rules::str.

Referenced by _doSetSessionAuth(), _getObjectDescription(), _printTocEntry(), _selectOutputSchema(), _selectTablespace(), add_role_attribute(), AddAcl(), append_db_pattern_cte(), append_rel_pattern_filtered_cte(), append_rel_pattern_raw_cte(), appendConnStrVal(), appendPGArray(), AppendPlainCommandOption(), appendPsqlMetaConnect(), appendQualifiedRelation(), appendReloptionsArray(), appendShellStringNoError(), appendStringLiteralDQ(), binary_upgrade_extension_member(), binary_upgrade_set_pg_class_oids(), binary_upgrade_set_type_oids_by_type_oid(), build_client_final_message(), build_client_first_message(), buildACLCommands(), buildMatViewRefreshDependencies(), check_expected_areq(), cluster_conn_opts(), cluster_one_database(), collectComments(), collectSecLabels(), compile_database_list(), compile_relation_list_one_db(), connectDBStart(), connectFailureMessage(), connectOptions2(), conninfo_add_defaults(), conninfo_array_parse(), conninfo_init(), conninfo_parse(), conninfo_storeval(), conninfo_uri_decode(), conninfo_uri_parse_options(), copy_previous_query(), create_sql_command(), createDummyViewAsClause(), createPartitions(), CreateReplicationSlot(), describeAccessMethods(), describeAggregates(), describeConfigurationParameters(), describeFunctions(), describeOneTableDetails(), describeOperators(), describePublications(), DescribeQuery(), describeRoles(), describeSubscriptions(), describeTableDetails(), describeTablespaces(), describeTypes(), do_copy(), do_edit(), dumpAccessMethod(), dumpACL(), dumpAgg(), dumpBaseType(), dumpCast(), dumpCollation(), dumpCommentExtended(), dumpCompositeType(), dumpCompositeTypeColComments(), dumpConstraint(), dumpConversion(), dumpDatabase(), dumpDomain(), dumpEncoding(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpPublicationTable(), dumpRangeType(), dumpRoles(), dumpRule(), dumpSearchPath(), dumpSecLabel(), dumpSequence(), dumpSequenceData(), dumpSubscription(), dumpTable(), dumpTableAttach(), dumpTableComment(), dumpTableData_copy(), dumpTableData_insert(), dumpTableSchema(), dumpTableSecLabel(), dumpTablespaces(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpUserMappings(), emitShSecLabels(), ensureCleanShutdown(), exec_command_ef_ev(), expand_dbname_patterns(), expand_extension_name_patterns(), expand_foreign_server_name_patterns(), expand_schema_name_patterns(), fillPGconn(), fmtCopyColumnList(), fmtId(), fmtQualifiedId(), format_aggregate_signature(), format_function_arguments(), format_function_signature(), gather_boolean_expression(), generate_old_dump(), GenerateRecoveryConfig(), get_create_object_cmd(), get_db_conn(), get_parallel_object_list(), getAccessMethods(), getAdditionalACLs(), getAggregates(), getCasts(), getConstraints(), getDependencies(), getDomainConstraints(), getExtensionMembership(), getExtensions(), getFuncs(), getInherits(), getNamespaces(), getPublicationNamespaces(), getPublicationTables(), getRestoreCommand(), getRules(), gets_fromFile(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTSParsers(), getTSTemplates(), indent_lines(), initCreatePKeys(), initialize_SSL(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensionContents(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listLargeObjects(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSConfigsVerbose(), listTSDictionaries(), listTSParsers(), listTSParsersVerbose(), listTSTemplates(), listUserMappings(), lo_initialize(), lo_read(), lo_truncate(), lo_write(), lookup_object_oid(), main(), makeAlterConfigCommand(), minimal_error_message(), objectDescription(), open_client_SSL(), openssl_verify_peer_name_matches_certificate_ip(), openssl_verify_peer_name_matches_certificate_name(), output_completion_banner(), parseServiceFile(), patternToSQLRegex(), permissionsList(), pg_append_history(), pg_fe_getusername(), pg_fe_sendauth(), pg_GSS_load_servicename(), pg_GSS_read(), pg_GSS_write(), pg_local_sendauth(), pg_password_sendauth(), pg_SASL_continue(), pg_SASL_init(), pgtls_read(), pgtls_write(), pq_verify_peer_name_matches_certificate(), pq_verify_peer_name_matches_certificate_ip(), pq_verify_peer_name_matches_certificate_name(), pqAllocCmdQueueEntry(), pqBuildErrorMessage3(), pqCheckInBufferSpace(), pqCheckOutBufferSpace(), PQconnectPoll(), PQencryptPasswordConn(), pqEndcopy3(), PQenterPipelineMode(), PQescapeByteaInternal(), PQescapeInternal(), PQescapeStringInternal(), PQexecStart(), PQexitPipelineMode(), PQfn(), pqFunctionCall3(), PQgetCopyData(), pqGetCopyData3(), pqGetErrorNotice3(), pqGetline3(), pqParseInput3(), pqPipelineProcessQueue(), PQpipelineSync(), pqPrepareAsyncResult(), PQputCopyData(), PQputCopyEnd(), pqReadData(), pqSaveWriteError(), pqsecure_open_gss(), pqsecure_raw_read(), PQsendFlushRequest(), PQsendPrepare(), PQsendQueryGuts(), PQsendQueryInternal(), PQsendQueryParams(), PQsendQueryPrepared(), PQsendQueryStart(), PQsetdbLogin(), pqSocketCheck(), pqWaitTimed(), prepare_vacuum_command(), processSQLNamePattern(), read_server_final_message(), read_server_first_message(), reportErrorPosition(), RestoreArchive(), run_reindex_command(), runInitSteps(), runPgDump(), scram_exchange(), setup_connection(), StreamLogicalLog(), and vacuum_one_database().

◆ createPQExpBuffer()

PQExpBuffer createPQExpBuffer ( void  )

Definition at line 74 of file pqexpbuffer.c.

75 {
77 
79  if (res != NULL)
81 
82  return res;
83 }
#define malloc(a)
Definition: header.h:50
void initPQExpBuffer(PQExpBuffer str)
Definition: pqexpbuffer.c:92
PQExpBufferData * PQExpBuffer
Definition: pqexpbuffer.h:51

References initPQExpBuffer(), malloc, and res.

Referenced by _doSetSessionAuth(), _printTocEntry(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), _WriteBlobData(), append_depends_on_extension(), appendStringLiteralDQ(), binary_upgrade_set_pg_class_oids(), binary_upgrade_set_type_oids_by_type_oid(), buildACLCommands(), buildDefaultACLCommands(), buildMatViewRefreshDependencies(), buildShSecLabels(), cluster_conn_opts(), collectComments(), collectSecLabels(), constructConnStr(), createDummyViewAsClause(), CreateReplicationSlot(), createViewAsClause(), DropReplicationSlot(), dropRoles(), dump_lo_buf(), dumpAccessMethod(), dumpACL(), dumpAgg(), dumpAttrDef(), dumpBaseType(), dumpBlob(), dumpCast(), dumpCollation(), dumpCommentExtended(), dumpCompositeType(), dumpCompositeTypeColComments(), dumpConstraint(), dumpConversion(), dumpDatabase(), dumpDatabaseConfig(), dumpDefaultACL(), dumpDomain(), dumpEncoding(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpIndex(), dumpIndexAttach(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpPublicationNamespace(), dumpPublicationTable(), dumpRangeType(), dumpRoleGUCPrivs(), dumpRoleMembership(), dumpRoles(), dumpRule(), dumpSearchPath(), dumpSecLabel(), dumpSequence(), dumpSequenceData(), dumpShellType(), dumpStatisticsExt(), dumpStdStrings(), dumpSubscription(), dumpTable(), dumpTableAttach(), dumpTableComment(), dumpTableConstraintComment(), dumpTableData(), dumpTableData_copy(), dumpTableData_insert(), dumpTableSchema(), dumpTableSecLabel(), dumpTablespaces(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), dumpUserConfig(), dumpUserMappings(), ensureCleanShutdown(), exec_command_sf_sv(), ExecuteSimpleCommands(), expand_dbname_patterns(), expand_extension_name_patterns(), expand_foreign_server_name_patterns(), expand_schema_name_patterns(), expand_table_name_patterns(), fmtQualifiedId(), gather_boolean_expression(), GenerateRecoveryConfig(), get_create_object_cmd(), get_language_name(), getAccessMethods(), getAdditionalACLs(), getAggregates(), getBlobs(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDependencies(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFormattedTypeName(), getFuncs(), getIndexes(), getInherits(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublicationNamespaces(), getPublications(), getPublicationTables(), getRestoreCommand(), getRules(), gets_fromFile(), GetSlotInformation(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), lockTableForWorker(), lookup_object_oid(), main(), MainLoop(), minimal_error_message(), printVerboseErrorMessages(), processExtensionTables(), ReceiveArchiveStreamChunk(), refreshMatViewData(), RestoreArchive(), runPgDump(), setup_connection(), and StreamLogicalLog().

◆ destroyPQExpBuffer()

void destroyPQExpBuffer ( PQExpBuffer  str)

Definition at line 116 of file pqexpbuffer.c.

117 {
118  if (str)
119  {
121  free(str);
122  }
123 }
#define free(a)
Definition: header.h:65
void termPQExpBuffer(PQExpBuffer str)
Definition: pqexpbuffer.c:131

References free, generate_unaccent_rules::str, and termPQExpBuffer().

Referenced by _doSetSessionAuth(), _printTocEntry(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), _WriteBlobData(), append_depends_on_extension(), appendStringLiteralDQ(), BaseBackup(), binary_upgrade_set_pg_class_oids(), binary_upgrade_set_type_oids_by_type_oid(), buildACLCommands(), buildDefaultACLCommands(), buildMatViewRefreshDependencies(), buildShSecLabels(), collectComments(), collectSecLabels(), constructConnStr(), CreateReplicationSlot(), createViewAsClause(), DeCloneArchive(), DropReplicationSlot(), dropRoles(), dump_lo_buf(), dumpAccessMethod(), dumpACL(), dumpAgg(), dumpAttrDef(), dumpBaseType(), dumpBlob(), dumpCast(), dumpCollation(), dumpCommentExtended(), dumpCompositeType(), dumpCompositeTypeColComments(), dumpConstraint(), dumpConversion(), dumpDatabase(), dumpDatabaseConfig(), dumpDefaultACL(), dumpDomain(), dumpEncoding(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpIndex(), dumpIndexAttach(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpPublicationNamespace(), dumpPublicationTable(), dumpRangeType(), dumpRoleGUCPrivs(), dumpRoleMembership(), dumpRoles(), dumpRule(), dumpSearchPath(), dumpSecLabel(), dumpSequence(), dumpSequenceData(), dumpShellType(), dumpStatisticsExt(), dumpStdStrings(), dumpSubscription(), dumpTable(), dumpTableAttach(), dumpTableComment(), dumpTableConstraintComment(), dumpTableData(), dumpTableData_copy(), dumpTableData_insert(), dumpTableSchema(), dumpTableSecLabel(), dumpTablespaces(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), dumpUserConfig(), dumpUserMappings(), ensureCleanShutdown(), exec_command_sf_sv(), expand_dbname_patterns(), expand_extension_name_patterns(), expand_foreign_server_name_patterns(), expand_schema_name_patterns(), expand_table_name_patterns(), fmtQualifiedId(), get_create_object_cmd(), get_language_name(), getAccessMethods(), getAdditionalACLs(), getAggregates(), getBlobs(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDependencies(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFormattedTypeName(), getFuncs(), getIndexes(), getInherits(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublicationNamespaces(), getPublications(), getPublicationTables(), getRestoreCommand(), getRules(), GetSlotInformation(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), ignore_boolean_expression(), is_true_boolean_expression(), lockTableForWorker(), lookup_object_oid(), main(), MainLoop(), minimal_error_message(), processExtensionTables(), ReceiveArchiveStream(), refreshMatViewData(), RestoreArchive(), runPgDump(), setup_connection(), and StreamLogicalLog().

◆ enlargePQExpBuffer()

int enlargePQExpBuffer ( PQExpBuffer  str,
size_t  needed 
)

Definition at line 174 of file pqexpbuffer.c.

175 {
176  size_t newlen;
177  char *newdata;
178 
179  if (PQExpBufferBroken(str))
180  return 0; /* already failed */
181 
182  /*
183  * Guard against ridiculous "needed" values, which can occur if we're fed
184  * bogus data. Without this, we can get an overflow or infinite loop in
185  * the following.
186  */
187  if (needed >= ((size_t) INT_MAX - str->len))
188  {
190  return 0;
191  }
192 
193  needed += str->len + 1; /* total space required now */
194 
195  /* Because of the above test, we now have needed <= INT_MAX */
196 
197  if (needed <= str->maxlen)
198  return 1; /* got enough space already */
199 
200  /*
201  * We don't want to allocate just a little more space with each append;
202  * for efficiency, double the buffer size each time it overflows.
203  * Actually, we might need to more than double it if 'needed' is big...
204  */
205  newlen = (str->maxlen > 0) ? (2 * str->maxlen) : 64;
206  while (needed > newlen)
207  newlen = 2 * newlen;
208 
209  /*
210  * Clamp to INT_MAX in case we went past it. Note we are assuming here
211  * that INT_MAX <= UINT_MAX/2, else the above loop could overflow. We
212  * will still have newlen >= needed.
213  */
214  if (newlen > (size_t) INT_MAX)
215  newlen = (size_t) INT_MAX;
216 
217  newdata = (char *) realloc(str->data, newlen);
218  if (newdata != NULL)
219  {
220  str->data = newdata;
221  str->maxlen = newlen;
222  return 1;
223  }
224 
226  return 0;
227 }
#define realloc(a, b)
Definition: header.h:60
static bool static void markPQExpBufferBroken(PQExpBuffer str)
Definition: pqexpbuffer.c:52
#define PQExpBufferBroken(str)
Definition: pqexpbuffer.h:59

References markPQExpBufferBroken(), PQExpBufferBroken, realloc, and generate_unaccent_rules::str.

Referenced by appendBinaryPQExpBuffer(), appendByteaLiteral(), appendPQExpBufferChar(), appendPQExpBufferVA(), appendStringLiteral(), appendStringLiteralConn(), build_client_final_message(), and passwordFromFile().

◆ initPQExpBuffer()

void initPQExpBuffer ( PQExpBuffer  str)

Definition at line 92 of file pqexpbuffer.c.

93 {
94  str->data = (char *) malloc(INITIAL_EXPBUFFER_SIZE);
95  if (str->data == NULL)
96  {
97  str->data = unconstify(char *, oom_buffer_ptr); /* see comment above */
98  str->maxlen = 0;
99  str->len = 0;
100  }
101  else
102  {
103  str->maxlen = INITIAL_EXPBUFFER_SIZE;
104  str->len = 0;
105  str->data[0] = '\0';
106  }
107 }
#define unconstify(underlying_type, expr)
Definition: c.h:1251
static const char * oom_buffer_ptr
Definition: pqexpbuffer.c:41
#define INITIAL_EXPBUFFER_SIZE
Definition: pqexpbuffer.h:76

References INITIAL_EXPBUFFER_SIZE, malloc, oom_buffer_ptr, generate_unaccent_rules::str, and unconstify.

Referenced by _reconnectToDB(), add_tablespace_footer(), append_database_pattern(), append_relation_pattern_helper(), append_schema_pattern(), appendPsqlMetaConnect(), appendQualifiedRelation(), BaseBackup(), build_client_final_message(), build_client_first_message(), check_for_data_types_usage(), cluster_one_database(), compile_database_list(), compile_relation_list_one_db(), conninfo_uri_parse_options(), create_sql_command(), createPartitions(), createPQExpBuffer(), describeAccessMethods(), describeAggregates(), describeConfigurationParameters(), describeFunctions(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), DescribeQuery(), describeRoles(), describeSubscriptions(), describeTableDetails(), describeTablespaces(), describeTypes(), do_copy(), exec_command_password(), ExecQueryUsingCursor(), executeMetaCommand(), expand_schema_name_patterns(), expand_table_name_patterns(), format_aggregate_signature(), format_function_arguments(), format_function_signature(), generate_old_dump(), GenerateRecoveryConfig(), get_db_conn(), get_parallel_object_list(), getCasts(), getParameterStatus(), getTransforms(), helpSQL(), helpVariables(), indent_lines(), initCreatePKeys(), initCreateTables(), initGenerateDataClientSide(), initGenerateDataServerSide(), libpqrcv_get_conninfo(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensionContents(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listLargeObjects(), listOneExtensionContents(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSConfigsVerbose(), listTSDictionaries(), listTSParsers(), listTSParsersVerbose(), listTSTemplates(), listUserMappings(), main(), makeEmptyPGconn(), objectDescription(), old_9_6_invalidate_hash_indexes(), output_completion_banner(), ParseScript(), passwordFromFile(), patternToSQLRegex(), permissionsList(), pg_SASL_init(), PQconndefaults(), PQconninfo(), PQconninfoParse(), pqGetErrorNotice3(), PQresultVerboseErrorMessage(), process_backslash_command(), processSQLNamePattern(), psql_get_variable(), ReceiveTarFile(), report_extension_updates(), resetPQExpBuffer(), run_reindex_command(), runInitSteps(), slashUsage(), syntax_error(), usage(), vacuum_one_database(), and validateSQLNamePattern().

◆ printfPQExpBuffer()

void printfPQExpBuffer ( PQExpBuffer  str,
const char *  fmt,
  ... 
)

◆ resetPQExpBuffer()

void resetPQExpBuffer ( PQExpBuffer  str)

◆ termPQExpBuffer()

void termPQExpBuffer ( PQExpBuffer  str)

Definition at line 131 of file pqexpbuffer.c.

132 {
133  if (str->data != oom_buffer)
134  free(str->data);
135  /* just for luck, make the buffer validly empty. */
136  str->data = unconstify(char *, oom_buffer_ptr); /* see comment above */
137  str->maxlen = 0;
138  str->len = 0;
139 }

References free, oom_buffer, oom_buffer_ptr, generate_unaccent_rules::str, and unconstify.

Referenced by _reconnectToDB(), add_tablespace_footer(), append_database_pattern(), append_relation_pattern_helper(), append_schema_pattern(), appendPsqlMetaConnect(), appendQualifiedRelation(), build_client_final_message(), build_client_first_message(), check_for_data_types_usage(), cluster_one_database(), compile_database_list(), compile_relation_list_one_db(), conninfo_uri_parse_options(), createPartitions(), describeAccessMethods(), describeAggregates(), describeConfigurationParameters(), describeFunctions(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), DescribeQuery(), describeRoles(), describeSubscriptions(), describeTableDetails(), describeTablespaces(), describeTypes(), destroyPQExpBuffer(), do_copy(), exec_command_password(), ExecQueryUsingCursor(), executeMetaCommand(), expand_schema_name_patterns(), expand_table_name_patterns(), free_command(), freePGconn(), generate_old_dump(), GenerateRecoveryConfig(), get_db_conn(), get_parallel_object_list(), getParameterStatus(), helpSQL(), helpVariables(), indent_lines(), initCreatePKeys(), initCreateTables(), initGenerateDataClientSide(), initGenerateDataServerSide(), libpqrcv_get_conninfo(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensionContents(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listLargeObjects(), listOneExtensionContents(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSConfigsVerbose(), listTSDictionaries(), listTSParsers(), listTSParsersVerbose(), listTSTemplates(), listUserMappings(), main(), objectDescription(), old_9_6_invalidate_hash_indexes(), output_completion_banner(), ParseScript(), passwordFromFile(), patternToSQLRegex(), permissionsList(), pg_SASL_init(), PQconndefaults(), PQconninfo(), PQconninfoParse(), pqGetErrorNotice3(), PQresultVerboseErrorMessage(), process_backslash_command(), processSQLNamePattern(), ReceiveTarFile(), report_extension_updates(), run_reindex_command(), runInitSteps(), slashUsage(), syntax_error(), usage(), vacuum_one_database(), and validateSQLNamePattern().