Making C function declaration parameter names consistent with corresponding definition names
I applied clang-tidy's
readability-inconsistent-declaration-parameter-name check with
"readability-inconsistent-declaration-parameter-name.Strict:true" [1]https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.html -- Peter Geoghegan
to write the attached refactoring patch series. The patch series makes
parameter names consistent between each function's definition and
declaration. The check made the whole process of getting everything to
match straightforward.
The total number of lines changed worked out at less than you might
guess it would, since we mostly tend to do this already:
178 files changed, 593 insertions(+), 582 deletions(-)
I have to admit that these inconsistencies are a pet peeve of mine. I
find them distracting, and have a history of fixing them on an ad-hoc
basis. But there are real practical arguments in favor of being strict
about it as a matter of policy -- it's not *just* neatnikism.
First there is a non-zero potential for bugs by allowing
inconsistencies. Consider the example of the function check_usermap(),
from hba.c. The bool argument named "case_insensitive" is inverted in
the declaration, where it is spelled "case_sensitive". At first I
thought that this might be a security bug, and reported it to
-security as such. It's harmless, but is still arguably something that
might have led to a real bug.
Then there is the "automated refactoring" argument. It would be nice
to make automated refactoring tools work a little better by always (or
almost always) having a clean slate to start with.
In general refactoring work might involve writing a patch that starts
with the declarations that appear in a some .h file of interest in one
pass, and work backwards from there. It might be necessary to switch
dozens of functions over to some new naming convention or parameter
order, so you really want to start with the high level interface in
such a scenario. It's rather nice to be able to use clang-tidy to make
sure that there are no newly introduced inconsistencies -- which have
the potential to be live bugs. It's possible to use clang-tidy for
this process right now, but it's not as easy as it could be because
you have to ignore any preexisting minor inconsistencies. We don't
quite have a clean slate to start from, which makes it more error
prone.
IMV there is a lot to be said for making this a largely mechanical
process, with built in guard rails. Why not lean on the tooling that's
widely available already?
Introducing a project policy around consistent parameter names would
make this easy. I believe that it would be practical and unobtrusive
-- we almost do this already, without any policy in place (it only
took me a few hours to come up with the patch series). I don't think
that we need to create new work for committers to do this.
[1]: https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.html -- Peter Geoghegan
--
Peter Geoghegan
Attachments:
v1-0002-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchapplication/octet-stream; name=v1-0002-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchDownload
From 561aada39731f008bd364e81db4b882d79679f89 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 22:19:51 -0700
Subject: [PATCH v1 2/2] Harmonize parameter names in pg_dump/pg_dumpall
---
src/bin/pg_dump/common.c | 2 +-
src/bin/pg_dump/parallel.c | 4 +-
src/bin/pg_dump/pg_backup.h | 28 +++----
src/bin/pg_dump/pg_backup_archiver.c | 53 ++++++------
src/bin/pg_dump/pg_backup_archiver.h | 6 +-
src/bin/pg_dump/pg_dump.c | 120 +++++++++++++--------------
src/bin/pg_dump/pg_dump.h | 6 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
8 files changed, 113 insertions(+), 112 deletions(-)
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 395f817fa..44fa52cc5 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -79,7 +79,7 @@ typedef struct _catalogIdMapEntry
static catalogid_hash *catalogIdHash = NULL;
-static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables,
+static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables);
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c8a70d9bc..1c194ceb4 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -325,9 +325,9 @@ getThreadLocalPQExpBuffer(void)
* as soon as they've created the ArchiveHandle.
*/
void
-on_exit_close_archive(Archive *AHX)
+on_exit_close_archive(Archive *A)
{
- shutdown_info.AHX = AHX;
+ shutdown_info.AHX = A;
on_exit_nicely(archive_close_connection, &shutdown_info);
}
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fcc5f6bd0..e234ec216 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -270,33 +270,33 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods.
*/
-typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+typedef int (*DataDumperPtr) (Archive *A, const void *userArg);
-typedef void (*SetupWorkerPtrType) (Archive *AH);
+typedef void (*SetupWorkerPtrType) (Archive *A);
/*
* Main archiver interface.
*/
-extern void ConnectDatabase(Archive *AHX,
+extern void ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect);
-extern void DisconnectDatabase(Archive *AHX);
-extern PGconn *GetConnection(Archive *AHX);
+extern void DisconnectDatabase(Archive *A);
+extern PGconn *GetConnection(Archive *A);
/* Called to write *data* to the archive */
-extern void WriteData(Archive *AH, const void *data, size_t dLen);
+extern void WriteData(Archive *A, const void *data, size_t dLen);
-extern int StartBlob(Archive *AH, Oid oid);
-extern int EndBlob(Archive *AH, Oid oid);
+extern int StartBlob(Archive *A, Oid oid);
+extern int EndBlob(Archive *A, Oid oid);
-extern void CloseArchive(Archive *AH);
+extern void CloseArchive(Archive *A);
-extern void SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt);
+extern void SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt);
-extern void ProcessArchiveRestoreOptions(Archive *AH);
+extern void ProcessArchiveRestoreOptions(Archive *A);
-extern void RestoreArchive(Archive *AH);
+extern void RestoreArchive(Archive *A);
/* Open an existing archive */
extern Archive *OpenArchive(const char *FileSpec, const ArchiveFormat fmt);
@@ -307,7 +307,7 @@ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt,
SetupWorkerPtrType setupDumpWorker);
/* The --list option */
-extern void PrintTOCSummary(Archive *AH);
+extern void PrintTOCSummary(Archive *A);
extern RestoreOptions *NewRestoreOptions(void);
@@ -316,7 +316,7 @@ extern void InitDumpOptions(DumpOptions *opts);
extern DumpOptions *dumpOptionsFromRestoreOptions(RestoreOptions *ropt);
/* Rearrange and filter TOC entries */
-extern void SortTocFromFile(Archive *AHX);
+extern void SortTocFromFile(Archive *A);
/* Convenience functions used only when writing DATA */
extern void archputs(const char *s, Archive *AH);
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 233198afc..0f3f90bf2 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -261,10 +261,10 @@ OpenArchive(const char *FileSpec, const ArchiveFormat fmt)
/* Public */
void
-CloseArchive(Archive *AHX)
+CloseArchive(Archive *A)
{
int res = 0;
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ClosePtr(AH);
@@ -281,22 +281,22 @@ CloseArchive(Archive *AHX)
/* Public */
void
-SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt)
+SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt)
{
/* Caller can omit dump options, in which case we synthesize them */
if (dopt == NULL && ropt != NULL)
dopt = dumpOptionsFromRestoreOptions(ropt);
/* Save options for later access */
- AH->dopt = dopt;
- AH->ropt = ropt;
+ A->dopt = dopt;
+ A->ropt = ropt;
}
/* Public */
void
-ProcessArchiveRestoreOptions(Archive *AHX)
+ProcessArchiveRestoreOptions(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -349,9 +349,9 @@ ProcessArchiveRestoreOptions(Archive *AHX)
/* Public */
void
-RestoreArchive(Archive *AHX)
+RestoreArchive(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
bool parallel_mode;
TocEntry *te;
@@ -415,10 +415,10 @@ RestoreArchive(Archive *AHX)
* restore; allow the attempt regardless of the version of the restore
* target.
*/
- AHX->minRemoteVersion = 0;
- AHX->maxRemoteVersion = 9999999;
+ A->minRemoteVersion = 0;
+ A->maxRemoteVersion = 9999999;
- ConnectDatabase(AHX, &ropt->cparams, false);
+ ConnectDatabase(A, &ropt->cparams, false);
/*
* If we're talking to the DB directly, don't send comments since they
@@ -479,7 +479,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- StartTransaction(AHX);
+ StartTransaction(A);
else
ahprintf(AH, "BEGIN;\n\n");
}
@@ -724,7 +724,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- CommitTransaction(AHX);
+ CommitTransaction(A);
else
ahprintf(AH, "COMMIT;\n\n");
}
@@ -1031,9 +1031,9 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te)
/* Public */
void
-WriteData(Archive *AHX, const void *data, size_t dLen)
+WriteData(Archive *A, const void *data, size_t dLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->currToc)
pg_fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
@@ -1052,10 +1052,9 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
/* Public */
TocEntry *
-ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
- ArchiveOpts *opts)
+ArchiveEntry(Archive *A, CatalogId catalogId, DumpId dumpId, ArchiveOpts *opts)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
TocEntry *newToc;
newToc = (TocEntry *) pg_malloc0(sizeof(TocEntry));
@@ -1110,9 +1109,9 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
/* Public */
void
-PrintTOCSummary(Archive *AHX)
+PrintTOCSummary(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -1214,9 +1213,9 @@ PrintTOCSummary(Archive *AHX)
/* Called by a dumper to signal start of a BLOB */
int
-StartBlob(Archive *AHX, Oid oid)
+StartBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->StartBlobPtr)
pg_fatal("large-object output not supported in chosen format");
@@ -1228,9 +1227,9 @@ StartBlob(Archive *AHX, Oid oid)
/* Called by a dumper to signal end of a BLOB */
int
-EndBlob(Archive *AHX, Oid oid)
+EndBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->EndBlobPtr)
AH->EndBlobPtr(AH, AH->currToc, oid);
@@ -1358,9 +1357,9 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
***********/
void
-SortTocFromFile(Archive *AHX)
+SortTocFromFile(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
FILE *fh;
StringInfoData linebuf;
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 084cd87e8..12b84e2e6 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -404,7 +404,7 @@ struct _tocEntry
};
extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
-extern void on_exit_close_archive(Archive *AHX);
+extern void on_exit_close_archive(Archive *A);
extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
@@ -428,7 +428,7 @@ typedef struct _archiveOpts
} ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */
-extern TocEntry *ArchiveEntry(Archive *AHX, CatalogId catalogId,
+extern TocEntry *ArchiveEntry(Archive *A, CatalogId catalogId,
DumpId dumpId, ArchiveOpts *opts);
extern void WriteHead(ArchiveHandle *AH);
@@ -457,7 +457,7 @@ extern bool checkSeek(FILE *fp);
extern size_t WriteInt(ArchiveHandle *AH, int i);
extern int ReadInt(ArchiveHandle *AH);
extern char *ReadStr(ArchiveHandle *AH);
-extern size_t WriteStr(ArchiveHandle *AH, const char *s);
+extern size_t WriteStr(ArchiveHandle *AH, const char *c);
int ReadOffset(ArchiveHandle *, pgoff_t *);
size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 67b6d9079..dbed4ebc4 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -159,7 +159,7 @@ static int nseclabels = 0;
(obj)->dobj.name)
static void help(const char *progname);
-static void setup_connection(Archive *AH,
+static void setup_connection(Archive *A,
const char *dumpencoding, const char *dumpsnapshot,
char *use_role);
static ArchiveFormat parseArchiveFormat(const char *format, ArchiveMode *mode);
@@ -221,7 +221,7 @@ static void dumpFunc(Archive *fout, const FuncInfo *finfo);
static void dumpCast(Archive *fout, const CastInfo *cast);
static void dumpTransform(Archive *fout, const TransformInfo *transform);
static void dumpOpr(Archive *fout, const OprInfo *oprinfo);
-static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *oprinfo);
+static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *aminfo);
static void dumpOpclass(Archive *fout, const OpclassInfo *opcinfo);
static void dumpOpfamily(Archive *fout, const OpfamilyInfo *opfinfo);
static void dumpCollation(Archive *fout, const CollInfo *collinfo);
@@ -232,7 +232,7 @@ static void dumpTrigger(Archive *fout, const TriggerInfo *tginfo);
static void dumpEventTrigger(Archive *fout, const EventTriggerInfo *evtinfo);
static void dumpTable(Archive *fout, const TableInfo *tbinfo);
static void dumpTableSchema(Archive *fout, const TableInfo *tbinfo);
-static void dumpTableAttach(Archive *fout, const TableAttachInfo *tbinfo);
+static void dumpTableAttach(Archive *fout, const TableAttachInfo *attachinfo);
static void dumpAttrDef(Archive *fout, const AttrDefInfo *adinfo);
static void dumpSequence(Archive *fout, const TableInfo *tbinfo);
static void dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo);
@@ -287,12 +287,12 @@ static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
static void dumpPublicationTable(Archive *fout, const PublicationRelInfo *pubrinfo);
static void dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo);
-static void dumpDatabase(Archive *AH);
+static void dumpDatabase(Archive *fout);
static void dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
const char *dbname, Oid dboid);
-static void dumpEncoding(Archive *AH);
-static void dumpStdStrings(Archive *AH);
-static void dumpSearchPath(Archive *AH);
+static void dumpEncoding(Archive *A);
+static void dumpStdStrings(Archive *A);
+static void dumpSearchPath(Archive *A);
static void binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
PQExpBuffer upgrade_buffer,
Oid pg_type_oid,
@@ -315,7 +315,7 @@ static bool nonemptyReloptions(const char *reloptions);
static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
const char *prefix, Archive *fout);
static char *get_synchronized_snapshot(Archive *fout);
-static void setupDumpWorker(Archive *AHX);
+static void setupDumpWorker(Archive *A);
static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
@@ -1069,14 +1069,14 @@ help(const char *progname)
}
static void
-setup_connection(Archive *AH, const char *dumpencoding,
+setup_connection(Archive *A, const char *dumpencoding,
const char *dumpsnapshot, char *use_role)
{
- DumpOptions *dopt = AH->dopt;
- PGconn *conn = GetConnection(AH);
+ DumpOptions *dopt = A->dopt;
+ PGconn *conn = GetConnection(A);
const char *std_strings;
- PQclear(ExecuteSqlQueryForSingleRow(AH, ALWAYS_SECURE_SEARCH_PATH_SQL));
+ PQclear(ExecuteSqlQueryForSingleRow(A, ALWAYS_SECURE_SEARCH_PATH_SQL));
/*
* Set the client encoding if requested.
@@ -1092,18 +1092,18 @@ setup_connection(Archive *AH, const char *dumpencoding,
* Get the active encoding and the standard_conforming_strings setting, so
* we know how to escape strings.
*/
- AH->encoding = PQclientEncoding(conn);
+ A->encoding = PQclientEncoding(conn);
std_strings = PQparameterStatus(conn, "standard_conforming_strings");
- AH->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
+ A->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
/*
* Set the role if requested. In a parallel dump worker, we'll be passed
* use_role == NULL, but AH->use_role is already set (if user specified it
* originally) and we should use that.
*/
- if (!use_role && AH->use_role)
- use_role = AH->use_role;
+ if (!use_role && A->use_role)
+ use_role = A->use_role;
/* Set the role if requested */
if (use_role)
@@ -1111,19 +1111,19 @@ setup_connection(Archive *AH, const char *dumpencoding,
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query, "SET ROLE %s", fmtId(use_role));
- ExecuteSqlStatement(AH, query->data);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
/* save it for possible later use by parallel workers */
- if (!AH->use_role)
- AH->use_role = pg_strdup(use_role);
+ if (!A->use_role)
+ A->use_role = pg_strdup(use_role);
}
/* Set the datestyle to ISO to ensure the dump's portability */
- ExecuteSqlStatement(AH, "SET DATESTYLE = ISO");
+ ExecuteSqlStatement(A, "SET DATESTYLE = ISO");
/* Likewise, avoid using sql_standard intervalstyle */
- ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
+ ExecuteSqlStatement(A, "SET INTERVALSTYLE = POSTGRES");
/*
* Use an explicitly specified extra_float_digits if it has been provided.
@@ -1136,54 +1136,54 @@ setup_connection(Archive *AH, const char *dumpencoding,
appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits);
- ExecuteSqlStatement(AH, q->data);
+ ExecuteSqlStatement(A, q->data);
destroyPQExpBuffer(q);
}
else
- ExecuteSqlStatement(AH, "SET extra_float_digits TO 3");
+ ExecuteSqlStatement(A, "SET extra_float_digits TO 3");
/*
* Disable synchronized scanning, to prevent unpredictable changes in row
* ordering across a dump and reload.
*/
- ExecuteSqlStatement(AH, "SET synchronize_seqscans TO off");
+ ExecuteSqlStatement(A, "SET synchronize_seqscans TO off");
/*
* Disable timeouts if supported.
*/
- ExecuteSqlStatement(AH, "SET statement_timeout = 0");
- if (AH->remoteVersion >= 90300)
- ExecuteSqlStatement(AH, "SET lock_timeout = 0");
- if (AH->remoteVersion >= 90600)
- ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
+ ExecuteSqlStatement(A, "SET statement_timeout = 0");
+ if (A->remoteVersion >= 90300)
+ ExecuteSqlStatement(A, "SET lock_timeout = 0");
+ if (A->remoteVersion >= 90600)
+ ExecuteSqlStatement(A, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.
*/
if (quote_all_identifiers)
- ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ ExecuteSqlStatement(A, "SET quote_all_identifiers = true");
/*
* Adjust row-security mode, if supported.
*/
- if (AH->remoteVersion >= 90500)
+ if (A->remoteVersion >= 90500)
{
if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security = on");
+ ExecuteSqlStatement(A, "SET row_security = on");
else
- ExecuteSqlStatement(AH, "SET row_security = off");
+ ExecuteSqlStatement(A, "SET row_security = off");
}
/*
* Initialize prepared-query state to "nothing prepared". We do this here
* so that a parallel dump worker will have its own state.
*/
- AH->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
+ A->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
- ExecuteSqlStatement(AH, "BEGIN");
+ ExecuteSqlStatement(A, "BEGIN");
/*
* To support the combination of serializable_deferrable with the jobs
@@ -1193,12 +1193,12 @@ setup_connection(Archive *AH, const char *dumpencoding,
* REPEATABLE READ transaction provides the appropriate integrity
* guarantees. This is a kluge, but safe for back-patching.
*/
- if (dopt->serializable_deferrable && AH->sync_snapshot_id == NULL)
- ExecuteSqlStatement(AH,
+ if (dopt->serializable_deferrable && A->sync_snapshot_id == NULL)
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
- ExecuteSqlStatement(AH,
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ, READ ONLY");
@@ -1208,28 +1208,28 @@ setup_connection(Archive *AH, const char *dumpencoding,
* is already set (if the server can handle it) and we should use that.
*/
if (dumpsnapshot)
- AH->sync_snapshot_id = pg_strdup(dumpsnapshot);
+ A->sync_snapshot_id = pg_strdup(dumpsnapshot);
- if (AH->sync_snapshot_id)
+ if (A->sync_snapshot_id)
{
PQExpBuffer query = createPQExpBuffer();
appendPQExpBufferStr(query, "SET TRANSACTION SNAPSHOT ");
- appendStringLiteralConn(query, AH->sync_snapshot_id, conn);
- ExecuteSqlStatement(AH, query->data);
+ appendStringLiteralConn(query, A->sync_snapshot_id, conn);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
}
- else if (AH->numWorkers > 1)
+ else if (A->numWorkers > 1)
{
- if (AH->isStandby && AH->remoteVersion < 100000)
+ if (A->isStandby && A->remoteVersion < 100000)
pg_fatal("parallel dumps from standby servers are not supported by this server version");
- AH->sync_snapshot_id = get_synchronized_snapshot(AH);
+ A->sync_snapshot_id = get_synchronized_snapshot(A);
}
}
/* Set up connection for a parallel worker process */
static void
-setupDumpWorker(Archive *AH)
+setupDumpWorker(Archive *A)
{
/*
* We want to re-select all the same values the leader connection is
@@ -1237,8 +1237,8 @@ setupDumpWorker(Archive *AH)
* AH->sync_snapshot_id and AH->use_role, but we need to translate the
* inherited encoding value back to a string to pass to setup_connection.
*/
- setup_connection(AH,
- pg_encoding_to_char(AH->encoding),
+ setup_connection(A,
+ pg_encoding_to_char(A->encoding),
NULL,
NULL);
}
@@ -3270,18 +3270,18 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
* dumpEncoding: put the correct encoding into the archive
*/
static void
-dumpEncoding(Archive *AH)
+dumpEncoding(Archive *A)
{
- const char *encname = pg_encoding_to_char(AH->encoding);
+ const char *encname = pg_encoding_to_char(A->encoding);
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving encoding = %s", encname);
appendPQExpBufferStr(qry, "SET client_encoding = ");
- appendStringLiteralAH(qry, encname, AH);
+ appendStringLiteralAH(qry, encname, A);
appendPQExpBufferStr(qry, ";\n");
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "ENCODING",
.description = "ENCODING",
.section = SECTION_PRE_DATA,
@@ -3295,9 +3295,9 @@ dumpEncoding(Archive *AH)
* dumpStdStrings: put the correct escape string behavior into the archive
*/
static void
-dumpStdStrings(Archive *AH)
+dumpStdStrings(Archive *A)
{
- const char *stdstrings = AH->std_strings ? "on" : "off";
+ const char *stdstrings = A->std_strings ? "on" : "off";
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving standard_conforming_strings = %s",
@@ -3306,7 +3306,7 @@ dumpStdStrings(Archive *AH)
appendPQExpBuffer(qry, "SET standard_conforming_strings = '%s';\n",
stdstrings);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "STDSTRINGS",
.description = "STDSTRINGS",
.section = SECTION_PRE_DATA,
@@ -3319,7 +3319,7 @@ dumpStdStrings(Archive *AH)
* dumpSearchPath: record the active search_path in the archive
*/
static void
-dumpSearchPath(Archive *AH)
+dumpSearchPath(Archive *A)
{
PQExpBuffer qry = createPQExpBuffer();
PQExpBuffer path = createPQExpBuffer();
@@ -3335,7 +3335,7 @@ dumpSearchPath(Archive *AH)
* listing schemas that may appear in search_path but not actually exist,
* which seems like a prudent exclusion.
*/
- res = ExecuteSqlQueryForSingleRow(AH,
+ res = ExecuteSqlQueryForSingleRow(A,
"SELECT pg_catalog.current_schemas(false)");
if (!parsePGArray(PQgetvalue(res, 0, 0), &schemanames, &nschemanames))
@@ -3355,19 +3355,19 @@ dumpSearchPath(Archive *AH)
}
appendPQExpBufferStr(qry, "SELECT pg_catalog.set_config('search_path', ");
- appendStringLiteralAH(qry, path->data, AH);
+ appendStringLiteralAH(qry, path->data, A);
appendPQExpBufferStr(qry, ", false);\n");
pg_log_info("saving search_path = %s", path->data);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "SEARCHPATH",
.description = "SEARCHPATH",
.section = SECTION_PRE_DATA,
.createStmt = qry->data));
/* Also save it in AH->searchpath, in case we're doing plain text dump */
- AH->searchpath = pg_strdup(qry->data);
+ A->searchpath = pg_strdup(qry->data);
free(schemanames);
PQclear(res);
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 69ee939d4..427f5d45f 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -705,8 +705,8 @@ extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
extern TypeInfo *getTypes(Archive *fout, int *numTypes);
extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
-extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
-extern OprInfo *getOperators(Archive *fout, int *numOperators);
+extern AggInfo *getAggregates(Archive *fout, int *numAggs);
+extern OprInfo *getOperators(Archive *fout, int *numOprs);
extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
@@ -723,7 +723,7 @@ extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
-extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
+extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 69ae027bd..083012ca3 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -72,8 +72,10 @@ static void buildShSecLabels(PGconn *conn,
const char *catalog_name, Oid objectId,
const char *objtype, const char *objname,
PQExpBuffer buffer);
-static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
- const char *pguser, trivalue prompt_password, bool fail_on_error);
+static PGconn *connectDatabase(const char *dbname,
+ const char *connection_string, const char *pghost,
+ const char *pgport, const char *pguser,
+ trivalue prompt_password, bool fail_on_error);
static char *constructConnStr(const char **keywords, const char **values);
static PGresult *executeQuery(PGconn *conn, const char *query);
static void executeCommand(PGconn *conn, const char *query);
--
2.34.1
v1-0001-Harmonize-parameter-names.patchapplication/octet-stream; name=v1-0001-Harmonize-parameter-names.patchDownload
From e93c583772b0c9ef25397703e2ae79f147f4b4c8 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 16:48:24 -0700
Subject: [PATCH v1 1/2] Harmonize parameter names
---
src/include/access/genam.h | 9 ++-
src/include/access/generic_xlog.h | 2 +-
src/include/access/gin_private.h | 8 +-
src/include/access/gist_private.h | 18 ++---
src/include/access/heapam.h | 26 +++----
src/include/access/heapam_xlog.h | 4 +-
src/include/access/htup_details.h | 2 +-
src/include/access/multixact.h | 7 +-
src/include/access/rewriteheap.h | 12 +--
src/include/access/tableam.h | 8 +-
src/include/access/tupconvert.h | 2 +-
src/include/access/twophase.h | 2 +-
src/include/access/xact.h | 8 +-
src/include/access/xlog.h | 8 +-
src/include/access/xlogreader.h | 2 +-
src/include/access/xlogrecovery.h | 4 +-
src/include/access/xlogutils.h | 4 +-
src/include/catalog/dependency.h | 6 +-
src/include/catalog/objectaccess.h | 12 +--
src/include/catalog/objectaddress.h | 4 +-
src/include/catalog/pg_conversion.h | 2 +-
src/include/catalog/pg_inherits.h | 5 +-
src/include/catalog/pg_publication.h | 2 +-
src/include/commands/alter.h | 2 +-
src/include/commands/cluster.h | 2 +-
src/include/commands/conversioncmds.h | 2 +-
src/include/commands/copy.h | 4 +-
src/include/commands/dbcommands_xlog.h | 4 +-
src/include/commands/policy.h | 2 +-
src/include/commands/publicationcmds.h | 2 +-
src/include/commands/schemacmds.h | 2 +-
src/include/commands/sequence.h | 8 +-
src/include/commands/tablecmds.h | 2 +-
src/include/commands/tablespace.h | 4 +-
src/include/commands/trigger.h | 8 +-
src/include/commands/typecmds.h | 2 +-
src/include/common/fe_memutils.h | 4 +-
src/include/common/kwlookup.h | 2 +-
src/include/common/scram-common.h | 2 +-
src/include/executor/execParallel.h | 4 +-
src/include/executor/executor.h | 2 +-
src/include/executor/spi.h | 2 +-
src/include/fe_utils/parallel_slot.h | 2 +-
src/include/fe_utils/simple_list.h | 2 +-
src/include/fe_utils/string_utils.h | 2 +-
src/include/funcapi.h | 2 +-
src/include/libpq/hba.h | 2 +-
src/include/libpq/pqmq.h | 2 +-
src/include/mb/pg_wchar.h | 4 +-
src/include/miscadmin.h | 2 +-
src/include/nodes/nodes.h | 2 +-
src/include/nodes/params.h | 4 +-
src/include/nodes/value.h | 2 +-
src/include/optimizer/appendinfo.h | 2 +-
src/include/optimizer/clauses.h | 4 +-
src/include/optimizer/paths.h | 4 +-
src/include/optimizer/planmain.h | 2 +-
src/include/parser/analyze.h | 2 +-
src/include/parser/parse_agg.h | 2 +-
src/include/parser/parse_oper.h | 4 +-
src/include/parser/parse_relation.h | 2 +-
src/include/partitioning/partbounds.h | 4 +-
src/include/pgstat.h | 10 +--
src/include/port.h | 6 +-
src/include/replication/logicalproto.h | 6 +-
src/include/replication/reorderbuffer.h | 12 +--
src/include/replication/slot.h | 2 +-
src/include/replication/snapbuild.h | 13 ++--
src/include/replication/walsender.h | 2 +-
src/include/rewrite/rewriteManip.h | 2 +-
src/include/snowball/libstemmer/header.h | 2 +-
src/include/statistics/statistics.h | 4 +-
src/include/storage/barrier.h | 2 +-
src/include/storage/bufpage.h | 4 +-
src/include/storage/fd.h | 14 ++--
src/include/storage/fsm_internals.h | 2 +-
src/include/storage/indexfsm.h | 4 +-
src/include/storage/predicate.h | 2 +-
src/include/storage/standby.h | 2 +-
src/include/tcop/cmdtag.h | 2 +-
src/include/tsearch/ts_utils.h | 4 +-
src/include/utils/acl.h | 6 +-
src/include/utils/attoptcache.h | 2 +-
src/include/utils/builtins.h | 8 +-
src/include/utils/datetime.h | 2 +-
src/include/utils/jsonb.h | 4 +-
src/include/utils/multirangetypes.h | 6 +-
src/include/utils/numeric.h | 2 +-
src/include/utils/pgstat_internal.h | 4 +-
src/include/utils/rangetypes.h | 4 +-
src/include/utils/regproc.h | 2 +-
src/include/utils/relcache.h | 2 +-
src/include/utils/relmapper.h | 2 +-
src/include/utils/selfuncs.h | 4 +-
src/include/utils/snapmgr.h | 2 +-
src/include/utils/timestamp.h | 4 +-
src/backend/access/brin/brin_minmax_multi.c | 3 +-
src/backend/access/common/heaptuple.c | 14 ++--
src/backend/access/gist/gistbuildbuffers.c | 4 +-
src/backend/access/heap/heapam.c | 2 +-
src/backend/access/heap/visibilitymap.c | 50 ++++++------
src/backend/access/table/tableam.c | 11 ++-
src/backend/access/transam/generic_xlog.c | 2 +-
src/backend/access/transam/multixact.c | 6 +-
src/backend/access/transam/xact.c | 2 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/access/transam/xlogreader.c | 2 +-
src/backend/catalog/aclchk.c | 22 +++---
src/backend/commands/dbcommands.c | 8 +-
src/backend/commands/event_trigger.c | 2 +-
src/backend/commands/explain.c | 2 +-
src/backend/commands/lockcmds.c | 2 +-
src/backend/commands/schemacmds.c | 6 +-
src/backend/commands/tablecmds.c | 6 +-
src/backend/commands/trigger.c | 8 +-
src/backend/executor/execIndexing.c | 2 +-
src/backend/executor/execParallel.c | 4 +-
src/backend/executor/nodeAgg.c | 11 ++-
src/backend/executor/nodeHash.c | 6 +-
src/backend/executor/nodeHashjoin.c | 6 +-
src/backend/executor/nodeIncrementalSort.c | 4 +-
src/backend/executor/nodeMemoize.c | 4 +-
src/backend/lib/bloomfilter.c | 2 +-
src/backend/lib/integerset.c | 4 +-
src/backend/optimizer/geqo/geqo_selection.c | 2 +-
src/backend/optimizer/util/plancat.c | 3 +-
src/backend/parser/gram.y | 3 +-
src/backend/parser/parse_clause.c | 2 +-
src/backend/parser/parse_utilcmd.c | 2 +-
src/backend/partitioning/partbounds.c | 6 +-
src/backend/postmaster/postmaster.c | 6 +-
.../replication/logical/reorderbuffer.c | 2 +-
src/backend/replication/pgoutput/pgoutput.c | 4 +-
src/backend/replication/slot.c | 2 +-
src/backend/statistics/extended_stats.c | 4 +-
src/backend/storage/buffer/bufmgr.c | 4 +-
src/backend/storage/lmgr/predicate.c | 2 +-
src/backend/storage/smgr/md.c | 42 +++++-----
src/backend/utils/adt/datetime.c | 22 +++---
src/backend/utils/adt/geo_ops.c | 8 +-
src/backend/utils/adt/jsonb_util.c | 77 ++++++++++---------
src/backend/utils/adt/jsonpath_exec.c | 4 +-
src/backend/utils/adt/numeric.c | 6 +-
src/backend/utils/adt/rangetypes.c | 4 +-
src/backend/utils/adt/ri_triggers.c | 2 +-
src/backend/utils/adt/timestamp.c | 4 +-
src/backend/utils/cache/relmapper.c | 2 +-
.../euc_jp_and_sjis/euc_jp_and_sjis.c | 4 +-
.../euc_tw_and_big5/euc_tw_and_big5.c | 2 +-
src/backend/utils/misc/queryjumble.c | 3 +-
src/backend/utils/time/snapmgr.c | 29 +++----
src/bin/initdb/initdb.c | 2 +-
src/bin/pg_basebackup/pg_receivewal.c | 2 +-
src/bin/pg_basebackup/streamutil.h | 2 +-
src/bin/pg_rewind/file_ops.h | 4 +-
src/bin/pg_rewind/pg_rewind.h | 2 +-
src/bin/pg_upgrade/info.c | 2 +-
src/bin/pg_verifybackup/pg_verifybackup.c | 2 +-
src/bin/pgbench/pgbench.h | 8 +-
src/bin/psql/describe.h | 6 +-
src/bin/scripts/common.h | 2 +-
src/interfaces/libpq/fe-connect.c | 2 +-
src/interfaces/libpq/fe-exec.c | 14 ++--
src/interfaces/libpq/fe-secure-common.h | 4 +-
src/interfaces/libpq/libpq-fe.h | 4 +-
src/pl/plpgsql/src/pl_exec.c | 2 +-
src/interfaces/ecpg/preproc/c_keywords.c | 8 +-
src/interfaces/ecpg/preproc/output.c | 2 +-
src/interfaces/ecpg/preproc/preproc_extern.h | 4 +-
src/timezone/zic.c | 12 +--
170 files changed, 480 insertions(+), 470 deletions(-)
diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index 134b20f1e..e1c4fdbd0 100644
--- a/src/include/access/genam.h
+++ b/src/include/access/genam.h
@@ -161,9 +161,10 @@ extern void index_rescan(IndexScanDesc scan,
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
-extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot);
-extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel,
- Snapshot snapshot, ParallelIndexScanDesc target);
+extern Size index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot);
+extern void index_parallelscan_initialize(Relation heapRelation,
+ Relation indexRelation, Snapshot snapshot,
+ ParallelIndexScanDesc target);
extern void index_parallelrescan(IndexScanDesc scan);
extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
Relation indexrel, int nkeys, int norderbys,
@@ -191,7 +192,7 @@ extern void index_store_float8_orderby_distances(IndexScanDesc scan,
Oid *orderByTypes,
IndexOrderByDistance *distances,
bool recheckOrderBy);
-extern bytea *index_opclass_options(Relation relation, AttrNumber attnum,
+extern bytea *index_opclass_options(Relation indrel, AttrNumber attnum,
Datum attoptions, bool validate);
diff --git a/src/include/access/generic_xlog.h b/src/include/access/generic_xlog.h
index c8363a476..da4565642 100644
--- a/src/include/access/generic_xlog.h
+++ b/src/include/access/generic_xlog.h
@@ -40,6 +40,6 @@ extern void GenericXLogAbort(GenericXLogState *state);
extern void generic_redo(XLogReaderState *record);
extern const char *generic_identify(uint8 info);
extern void generic_desc(StringInfo buf, XLogReaderState *record);
-extern void generic_mask(char *pagedata, BlockNumber blkno);
+extern void generic_mask(char *page, BlockNumber blkno);
#endif /* GENERIC_XLOG_H */
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index 2935d2f35..39b51573d 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -240,7 +240,7 @@ extern void ginDataFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page
*/
typedef struct GinVacuumState GinVacuumState;
-extern void ginVacuumPostingTreeLeaf(Relation rel, Buffer buf, GinVacuumState *gvs);
+extern void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer, GinVacuumState *gvs);
/* ginscan.c */
@@ -469,10 +469,10 @@ extern void ginInsertCleanup(GinState *ginstate, bool full_clean,
extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd,
int maxsize, int *nwritten);
-extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int totalsize, TIDBitmap *tbm);
+extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int len, TIDBitmap *tbm);
-extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *ptr, int len, int *ndecoded);
-extern ItemPointer ginPostingListDecode(GinPostingList *ptr, int *ndecoded);
+extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *segment, int len, int *ndecoded_out);
+extern ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded);
extern ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na,
ItemPointerData *b, uint32 nb,
int *nmerged);
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 240131ef7..093bf2344 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -445,16 +445,16 @@ extern void gistXLogPageReuse(Relation rel, BlockNumber blkno,
extern XLogRecPtr gistXLogUpdate(Buffer buffer,
OffsetNumber *todelete, int ntodelete,
- IndexTuple *itup, int ntup,
- Buffer leftchild);
+ IndexTuple *itup, int ituplen,
+ Buffer leftchildbuf);
extern XLogRecPtr gistXLogDelete(Buffer buffer, OffsetNumber *todelete,
int ntodelete, TransactionId latestRemovedXid);
extern XLogRecPtr gistXLogSplit(bool page_is_leaf,
SplitedPageLayout *dist,
- BlockNumber origrlink, GistNSN oldnsn,
- Buffer leftchild, bool markfollowright);
+ BlockNumber origrlink, GistNSN orignsn,
+ Buffer leftchildbuf, bool markfollowright);
extern XLogRecPtr gistXLogAssignLSN(void);
@@ -516,8 +516,8 @@ extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
bool l, bool isNull);
extern float gistpenalty(GISTSTATE *giststate, int attno,
- GISTENTRY *key1, bool isNull1,
- GISTENTRY *key2, bool isNull2);
+ GISTENTRY *orig, bool isNullOrig,
+ GISTENTRY *add, bool isNullAdd);
extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len,
Datum *attr, bool *isnull);
extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b);
@@ -556,11 +556,11 @@ extern GISTBuildBuffers *gistInitBuildBuffers(int pagesPerBuffer, int levelStep,
int maxLevel);
extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb,
GISTSTATE *giststate,
- BlockNumber blkno, int level);
+ BlockNumber nodeBlocknum, int level);
extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple itup);
extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple *item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple *itup);
extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb);
extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb,
GISTSTATE *giststate, Relation r,
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index abf62d9df..9dab35551 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -118,13 +118,13 @@ extern TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot,
int nkeys, ScanKey key,
ParallelTableScanDesc parallel_scan,
uint32 flags);
-extern void heap_setscanlimits(TableScanDesc scan, BlockNumber startBlk,
+extern void heap_setscanlimits(TableScanDesc sscan, BlockNumber startBlk,
BlockNumber numBlks);
-extern void heapgetpage(TableScanDesc scan, BlockNumber page);
-extern void heap_rescan(TableScanDesc scan, ScanKey key, bool set_params,
+extern void heapgetpage(TableScanDesc sscan, BlockNumber page);
+extern void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params,
bool allow_strat, bool allow_sync, bool allow_pagemode);
-extern void heap_endscan(TableScanDesc scan);
-extern HeapTuple heap_getnext(TableScanDesc scan, ScanDirection direction);
+extern void heap_endscan(TableScanDesc sscan);
+extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
extern bool heap_getnextslot(TableScanDesc sscan,
ScanDirection direction, struct TupleTableSlot *slot);
extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
@@ -138,7 +138,7 @@ extern bool heap_hot_search_buffer(ItemPointer tid, Relation relation,
Buffer buffer, Snapshot snapshot, HeapTuple heapTuple,
bool *all_dead, bool first_call);
-extern void heap_get_latest_tid(TableScanDesc scan, ItemPointer tid);
+extern void heap_get_latest_tid(TableScanDesc sscan, ItemPointer tid);
extern BulkInsertState GetBulkInsertState(void);
extern void FreeBulkInsertState(BulkInsertState);
@@ -160,7 +160,7 @@ extern TM_Result heap_update(Relation relation, ItemPointer otid,
struct TM_FailureData *tmfd, LockTupleMode *lockmode);
extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
- bool follow_update,
+ bool follow_updates,
Buffer *buffer, struct TM_FailureData *tmfd);
extern void heap_inplace_update(Relation relation, HeapTuple tuple);
@@ -187,7 +187,7 @@ extern void heap_page_prune_opt(Relation relation, Buffer buffer);
extern int heap_page_prune(Relation relation, Buffer buffer,
struct GlobalVisState *vistest,
TransactionId old_snap_xmin,
- TimestampTz old_snap_ts_ts,
+ TimestampTz old_snap_ts,
int *nnewlpdead,
OffsetNumber *off_loc);
extern void heap_page_prune_execute(Buffer buffer,
@@ -202,13 +202,13 @@ extern void heap_vacuum_rel(Relation rel,
struct VacuumParams *params, BufferAccessStrategy bstrategy);
/* in heap/heapam_visibility.c */
-extern bool HeapTupleSatisfiesVisibility(HeapTuple stup, Snapshot snapshot,
+extern bool HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot,
Buffer buffer);
-extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple stup, CommandId curcid,
+extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple stup, TransactionId OldestXmin,
+extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple stup, Buffer buffer,
+extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple htup, Buffer buffer,
TransactionId *dead_after);
extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
uint16 infomask, TransactionId xid);
@@ -227,7 +227,7 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
HeapTuple htup,
Buffer buffer,
CommandId *cmin, CommandId *cmax);
-extern void HeapCheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple,
+extern void HeapCheckForSerializableConflictOut(bool visible, Relation relation, HeapTuple tuple,
Buffer buffer, Snapshot snapshot);
#endif /* HEAPAM_H */
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index 1705e736b..34220d93c 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -414,8 +414,8 @@ extern bool heap_prepare_freeze_tuple(HeapTupleHeader tuple,
TransactionId *relfrozenxid_out,
MultiXactId *relminmxid_out);
extern void heap_execute_freeze_tuple(HeapTupleHeader tuple,
- xl_heap_freeze_tuple *xlrec_tp);
+ xl_heap_freeze_tuple *frz);
extern XLogRecPtr log_heap_visible(RelFileLocator rlocator, Buffer heap_buffer,
- Buffer vm_buffer, TransactionId cutoff_xid, uint8 flags);
+ Buffer vm_buffer, TransactionId cutoff_xid, uint8 vmflags);
#endif /* HEAPAM_XLOG_H */
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h
index 51a60eda0..9561c835f 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -699,7 +699,7 @@ extern void heap_fill_tuple(TupleDesc tupleDesc,
uint16 *infomask, bits8 *bit);
extern bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc);
extern Datum nocachegetattr(HeapTuple tup, int attnum,
- TupleDesc att);
+ TupleDesc tupleDesc);
extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
bool *isnull);
extern Datum getmissingattr(TupleDesc tupleDesc,
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index a5600a320..4cbe17de7 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -112,8 +112,8 @@ extern MultiXactId ReadNextMultiXactId(void);
extern void ReadMultiXactIdRange(MultiXactId *oldest, MultiXactId *next);
extern bool MultiXactIdIsRunning(MultiXactId multi, bool isLockOnly);
extern void MultiXactIdSetOldestMember(void);
-extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **xids,
- bool allow_old, bool isLockOnly);
+extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
+ bool from_pgupgrade, bool isLockOnly);
extern bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2);
extern bool MultiXactIdPrecedesOrEquals(MultiXactId multi1,
MultiXactId multi2);
@@ -140,7 +140,8 @@ extern void MultiXactGetCheckptMulti(bool is_shutdown,
Oid *oldestMultiDB);
extern void CheckPointMultiXact(void);
extern MultiXactId GetOldestMultiXactId(void);
-extern void TruncateMultiXact(MultiXactId oldestMulti, Oid oldestMultiDB);
+extern void TruncateMultiXact(MultiXactId newOldestMulti,
+ Oid newOldestMultiDB);
extern void MultiXactSetNextMXact(MultiXactId nextMulti,
MultiXactOffset nextMultiOffset);
extern void MultiXactAdvanceNextMXact(MultiXactId minMulti,
diff --git a/src/include/access/rewriteheap.h b/src/include/access/rewriteheap.h
index 353cbb292..5cc04756a 100644
--- a/src/include/access/rewriteheap.h
+++ b/src/include/access/rewriteheap.h
@@ -21,13 +21,13 @@
/* struct definition is private to rewriteheap.c */
typedef struct RewriteStateData *RewriteState;
-extern RewriteState begin_heap_rewrite(Relation OldHeap, Relation NewHeap,
- TransactionId OldestXmin, TransactionId FreezeXid,
- MultiXactId MultiXactCutoff);
+extern RewriteState begin_heap_rewrite(Relation old_heap, Relation new_heap,
+ TransactionId oldest_xmin, TransactionId freeze_xid,
+ MultiXactId cutoff_multi);
extern void end_heap_rewrite(RewriteState state);
-extern void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple,
- HeapTuple newTuple);
-extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple);
+extern void rewrite_heap_tuple(RewriteState state, HeapTuple old_tuple,
+ HeapTuple new_tuple);
+extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple);
/*
* On-Disk data format for an individual logical rewrite mapping.
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index ffe265d2a..e45d73eae 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -863,13 +863,13 @@ typedef struct TableAmRoutine
* for the relation. Works for tables, views, foreign tables and partitioned
* tables.
*/
-extern const TupleTableSlotOps *table_slot_callbacks(Relation rel);
+extern const TupleTableSlotOps *table_slot_callbacks(Relation relation);
/*
* Returns slot using the callbacks returned by table_slot_callbacks(), and
* registers it on *reglist.
*/
-extern TupleTableSlot *table_slot_create(Relation rel, List **reglist);
+extern TupleTableSlot *table_slot_create(Relation relation, List **reglist);
/* ----------------------------------------------------------------------------
@@ -895,7 +895,7 @@ table_beginscan(Relation rel, Snapshot snapshot,
* Like table_beginscan(), but for scanning catalog. It'll automatically use a
* snapshot appropriate for scanning catalog relations.
*/
-extern TableScanDesc table_beginscan_catalog(Relation rel, int nkeys,
+extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
struct ScanKeyData *key);
/*
@@ -1133,7 +1133,7 @@ extern void table_parallelscan_initialize(Relation rel,
*
* Caller must hold a suitable lock on the relation.
*/
-extern TableScanDesc table_beginscan_parallel(Relation rel,
+extern TableScanDesc table_beginscan_parallel(Relation relation,
ParallelTableScanDesc pscan);
/*
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h
index f5a5fd826..a37dafc66 100644
--- a/src/include/access/tupconvert.h
+++ b/src/include/access/tupconvert.h
@@ -44,7 +44,7 @@ extern HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map
extern TupleTableSlot *execute_attr_map_slot(AttrMap *attrMap,
TupleTableSlot *in_slot,
TupleTableSlot *out_slot);
-extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *inbitmap);
+extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols);
extern void free_conversion_map(TupleConversionMap *map);
diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h
index 5d6544e26..f94fded10 100644
--- a/src/include/access/twophase.h
+++ b/src/include/access/twophase.h
@@ -60,6 +60,6 @@ extern void PrepareRedoAdd(char *buf, XLogRecPtr start_lsn,
XLogRecPtr end_lsn, RepOriginId origin_id);
extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
extern void restoreTwoPhaseData(void);
-extern bool LookupGXact(const char *gid, XLogRecPtr prepare_at_lsn,
+extern bool LookupGXact(const char *gid, XLogRecPtr prepare_end_lsn,
TimestampTz origin_prepare_timestamp);
#endif /* TWOPHASE_H */
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index 300baae12..c604ee11f 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -490,8 +490,8 @@ extern int xactGetCommittedChildren(TransactionId **ptr);
extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval,
int xactflags,
@@ -501,8 +501,8 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int xactflags, TransactionId twophase_xid,
const char *twophase_gid);
extern void xact_redo(XLogReaderState *record);
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 9ebd321ba..3dbfa6b59 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -197,15 +197,15 @@ extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
uint8 flags,
int num_fpi,
bool topxid_included);
-extern void XLogFlush(XLogRecPtr RecPtr);
+extern void XLogFlush(XLogRecPtr record);
extern bool XLogBackgroundFlush(void);
-extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
-extern int XLogFileInit(XLogSegNo segno, TimeLineID tli);
+extern bool XLogNeedsFlush(XLogRecPtr record);
+extern int XLogFileInit(XLogSegNo logsegno, TimeLineID logtli);
extern int XLogFileOpen(XLogSegNo segno, TimeLineID tli);
extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli);
extern XLogSegNo XLogGetLastRemovedSegno(void);
-extern void XLogSetAsyncXactLSN(XLogRecPtr record);
+extern void XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN);
extern void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn);
extern void xlog_redo(XLogReaderState *record);
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 6afec33d4..6dcde2523 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -400,7 +400,7 @@ extern bool DecodeXLogRecord(XLogReaderState *state,
DecodedXLogRecord *decoded,
XLogRecord *record,
XLogRecPtr lsn,
- char **errmsg);
+ char **errormsg);
/*
* Macros that provide access to parts of the record most recently returned by
diff --git a/src/include/access/xlogrecovery.h b/src/include/access/xlogrecovery.h
index 0aa85d90e..0e3e246bd 100644
--- a/src/include/access/xlogrecovery.h
+++ b/src/include/access/xlogrecovery.h
@@ -80,7 +80,9 @@ extern PGDLLIMPORT bool StandbyMode;
extern Size XLogRecoveryShmemSize(void);
extern void XLogRecoveryShmemInit(void);
-extern void InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdownPtr, bool *haveBackupLabel, bool *haveTblspcMap);
+extern void InitWalRecovery(ControlFileData *ControlFile,
+ bool *wasShutdown_ptr, bool *haveBackupLabel_ptr,
+ bool *haveTblspcMap_ptr);
extern void PerformWalRecovery(void);
/*
diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h
index ef182977b..18dc5f99a 100644
--- a/src/include/access/xlogutils.h
+++ b/src/include/access/xlogutils.h
@@ -82,10 +82,10 @@ typedef struct ReadLocalXLogPageNoWaitPrivate
} ReadLocalXLogPageNoWaitPrivate;
extern XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record,
- uint8 buffer_id, Buffer *buf);
+ uint8 block_id, Buffer *buf);
extern Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id);
extern XLogRedoAction XLogReadBufferForRedoExtended(XLogReaderState *record,
- uint8 buffer_id,
+ uint8 block_id,
ReadBufferMode mode, bool get_cleanup_lock,
Buffer *buf);
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index 729c4c46c..98a1a8428 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -249,7 +249,7 @@ extern void recordDependencyOnTablespace(Oid classId, Oid objectId,
extern void changeDependencyOnTablespace(Oid classId, Oid objectId,
Oid newTablespaceId);
-extern void updateAclDependencies(Oid classId, Oid objectId, int32 objectSubId,
+extern void updateAclDependencies(Oid classId, Oid objectId, int32 objsubId,
Oid ownerId,
int noldmembers, Oid *oldmembers,
int nnewmembers, Oid *newmembers);
@@ -263,8 +263,8 @@ extern void copyTemplateDependencies(Oid templateDbId, Oid newDbId);
extern void dropDatabaseDependencies(Oid databaseId);
-extern void shdepDropOwned(List *relids, DropBehavior behavior);
+extern void shdepDropOwned(List *roleids, DropBehavior behavior);
-extern void shdepReassignOwned(List *relids, Oid newrole);
+extern void shdepReassignOwned(List *roleids, Oid newrole);
#endif /* DEPENDENCY_H */
diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h
index 567ab63e8..d754f4120 100644
--- a/src/include/catalog/objectaccess.h
+++ b/src/include/catalog/objectaccess.h
@@ -151,15 +151,15 @@ extern bool RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation);
extern void RunFunctionExecuteHook(Oid objectId);
/* String versions */
-extern void RunObjectPostCreateHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId,
bool is_internal);
-extern void RunObjectDropHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectDropHookStr(Oid classId, const char *objectName, int subId,
int dropflags);
-extern void RunObjectTruncateHookStr(const char *objectStr);
-extern void RunObjectPostAlterHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectTruncateHookStr(const char *objectName);
+extern void RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId,
Oid auxiliaryId, bool is_internal);
-extern bool RunNamespaceSearchHookStr(const char *objectStr, bool ereport_on_violation);
-extern void RunFunctionExecuteHookStr(const char *objectStr);
+extern bool RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation);
+extern void RunFunctionExecuteHookStr(const char *objectName);
/*
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
index cf4d8b310..340ffc95a 100644
--- a/src/include/catalog/objectaddress.h
+++ b/src/include/catalog/objectaddress.h
@@ -77,9 +77,9 @@ extern char *getObjectDescriptionOids(Oid classid, Oid objid);
extern int read_objtype_from_string(const char *objtype);
extern char *getObjectTypeDescription(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentity(const ObjectAddress *address,
+extern char *getObjectIdentity(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentityParts(const ObjectAddress *address,
+extern char *getObjectIdentityParts(const ObjectAddress *object,
List **objname, List **objargs,
bool missing_ok);
extern struct ArrayType *strlist_to_textarray(List *list);
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index fb26123aa..e59ed94ed 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -69,7 +69,7 @@ extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
Oid conowner,
int32 conforencoding, int32 contoencoding,
Oid conproc, bool def);
-extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding,
+extern Oid FindDefaultConversion(Oid name_space, int32 for_encoding,
int32 to_encoding);
#endif /* PG_CONVERSION_H */
diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h
index b5a32755a..9221c2ea5 100644
--- a/src/include/catalog/pg_inherits.h
+++ b/src/include/catalog/pg_inherits.h
@@ -53,13 +53,14 @@ extern List *find_inheritance_children_extended(Oid parentrelId, bool omit_detac
LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin);
extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode,
- List **parents);
+ List **numparents);
extern bool has_subclass(Oid relationId);
extern bool has_superclass(Oid relationId);
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
extern void StoreSingleInheritance(Oid relationId, Oid parentOid,
int32 seqNumber);
-extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool allow_detached,
+extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent,
+ bool expect_detach_pending,
const char *childname);
extern bool PartitionHasPendingDetach(Oid partoid);
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
index c298327f5..ecf5a28e0 100644
--- a/src/include/catalog/pg_publication.h
+++ b/src/include/catalog/pg_publication.h
@@ -137,7 +137,7 @@ extern List *GetPublicationSchemas(Oid pubid);
extern List *GetSchemaPublications(Oid schemaid);
extern List *GetSchemaPublicationRelations(Oid schemaid,
PublicationPartOpt pub_partopt);
-extern List *GetAllSchemaPublicationRelations(Oid puboid,
+extern List *GetAllSchemaPublicationRelations(Oid pubid,
PublicationPartOpt pub_partopt);
extern List *GetPubPartitionOptionRelations(List *result,
PublicationPartOpt pub_partopt,
diff --git a/src/include/commands/alter.h b/src/include/commands/alter.h
index 52f5e6f6d..fddfa3b85 100644
--- a/src/include/commands/alter.h
+++ b/src/include/commands/alter.h
@@ -29,7 +29,7 @@ extern Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid,
ObjectAddresses *objsMoved);
extern ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
-extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
+extern void AlterObjectOwner_internal(Relation rel, Oid objectId,
Oid new_ownerId);
#endif /* ALTER_H */
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h
index df8e73af4..de9040c4b 100644
--- a/src/include/commands/cluster.h
+++ b/src/include/commands/cluster.h
@@ -45,7 +45,7 @@ extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
bool check_constraints,
bool is_internal,
TransactionId frozenXid,
- MultiXactId minMulti,
+ MultiXactId cutoffMulti,
char newrelpersistence);
#endif /* CLUSTER_H */
diff --git a/src/include/commands/conversioncmds.h b/src/include/commands/conversioncmds.h
index ab736fb62..da3136527 100644
--- a/src/include/commands/conversioncmds.h
+++ b/src/include/commands/conversioncmds.h
@@ -18,6 +18,6 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
+extern ObjectAddress CreateConversionCommand(CreateConversionStmt *stmt);
#endif /* CONVERSIONCMDS_H */
diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h
index cb0096aeb..d7efec6f2 100644
--- a/src/include/commands/copy.h
+++ b/src/include/commands/copy.h
@@ -67,11 +67,11 @@ typedef struct CopyToStateData *CopyToState;
typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread);
-extern void DoCopy(ParseState *state, const CopyStmt *stmt,
+extern void DoCopy(ParseState *pstate, const CopyStmt *stmt,
int stmt_location, int stmt_len,
uint64 *processed);
-extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *ops_out, bool is_from, List *options);
+extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *opts_out, bool is_from, List *options);
extern CopyFromState BeginCopyFrom(ParseState *pstate, Relation rel, Node *whereClause,
const char *filename,
bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options);
diff --git a/src/include/commands/dbcommands_xlog.h b/src/include/commands/dbcommands_xlog.h
index 0ee2452fe..545e5430c 100644
--- a/src/include/commands/dbcommands_xlog.h
+++ b/src/include/commands/dbcommands_xlog.h
@@ -53,8 +53,8 @@ typedef struct xl_dbase_drop_rec
} xl_dbase_drop_rec;
#define MinSizeOfDbaseDropRec offsetof(xl_dbase_drop_rec, tablespace_ids)
-extern void dbase_redo(XLogReaderState *rptr);
-extern void dbase_desc(StringInfo buf, XLogReaderState *rptr);
+extern void dbase_redo(XLogReaderState *record);
+extern void dbase_desc(StringInfo buf, XLogReaderState *record);
extern const char *dbase_identify(uint8 info);
#endif /* DBCOMMANDS_XLOG_H */
diff --git a/src/include/commands/policy.h b/src/include/commands/policy.h
index c5f3753da..f05bb66c6 100644
--- a/src/include/commands/policy.h
+++ b/src/include/commands/policy.h
@@ -23,7 +23,7 @@ extern void RelationBuildRowSecurity(Relation relation);
extern void RemovePolicyById(Oid policy_id);
-extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid objid);
+extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid policy_id);
extern ObjectAddress CreatePolicy(CreatePolicyStmt *stmt);
extern ObjectAddress AlterPolicy(AlterPolicyStmt *stmt);
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
index 57df3fc1e..249119657 100644
--- a/src/include/commands/publicationcmds.h
+++ b/src/include/commands/publicationcmds.h
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
extern void RemovePublicationSchemaById(Oid psoid);
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
-extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
extern void InvalidatePublicationRels(List *relids);
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
List *ancestors, bool pubviaroot);
diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h
index 8c21f2a2c..3076bb891 100644
--- a/src/include/commands/schemacmds.h
+++ b/src/include/commands/schemacmds.h
@@ -18,7 +18,7 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
+extern Oid CreateSchemaCommand(CreateSchemaStmt *stmt,
const char *queryString,
int stmt_location, int stmt_len);
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index d38c0e238..b3b04ccfa 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -55,16 +55,16 @@ extern int64 nextval_internal(Oid relid, bool check_permissions);
extern Datum nextval(PG_FUNCTION_ARGS);
extern List *sequence_options(Oid relid);
-extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
+extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq);
extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
extern void DeleteSequenceTuple(Oid relid);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
-extern void seq_redo(XLogReaderState *rptr);
-extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
+extern void seq_redo(XLogReaderState *record);
+extern void seq_desc(StringInfo buf, XLogReaderState *record);
extern const char *seq_identify(uint8 info);
-extern void seq_mask(char *pagedata, BlockNumber blkno);
+extern void seq_mask(char *page, BlockNumber blkno);
#endif /* SEQUENCE_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 0c48654b9..03f14d6be 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -66,7 +66,7 @@ extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
extern bool CheckRelationTableSpaceMove(Relation rel, Oid newTableSpaceId);
extern void SetRelationTableSpace(Relation rel, Oid newTableSpaceId,
- RelFileNumber newRelFileNumber);
+ RelFileNumber newRelFilenumber);
extern ObjectAddress renameatt(RenameStmt *stmt);
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 1f8090711..a11c9e947 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -62,8 +62,8 @@ extern char *get_tablespace_name(Oid spc_oid);
extern bool directory_is_empty(const char *path);
extern void remove_tablespace_symlink(const char *linkloc);
-extern void tblspc_redo(XLogReaderState *rptr);
-extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
+extern void tblspc_redo(XLogReaderState *record);
+extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
extern const char *tblspc_identify(uint8 info);
#endif /* TABLESPACE_H */
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index b7b6bd600..7615519a8 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -166,7 +166,7 @@ extern void TriggerSetParentTrigger(Relation trigRel,
Oid parentTrigId,
Oid childTableId);
extern void RemoveTriggerById(Oid trigOid);
-extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);
+extern Oid get_trigger_oid(Oid relid, const char *trigname, bool missing_ok);
extern ObjectAddress renametrig(RenameStmt *stmt);
@@ -239,7 +239,7 @@ extern void ExecARUpdateTriggers(EState *estate,
ResultRelInfo *dst_partinfo,
ItemPointer tupleid,
HeapTuple fdw_trigtuple,
- TupleTableSlot *slot,
+ TupleTableSlot *newslot,
List *recheckIndexes,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
@@ -267,9 +267,9 @@ extern bool AfterTriggerPendingOnRel(Oid relid);
* in utils/adt/ri_triggers.c
*/
extern bool RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_Initial_Check(Trigger *trigger,
Relation fk_rel, Relation pk_rel);
extern void RI_PartitionRemove_Check(Trigger *trigger, Relation fk_rel,
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h
index a17bedb85..532bc49c3 100644
--- a/src/include/commands/typecmds.h
+++ b/src/include/commands/typecmds.h
@@ -34,7 +34,7 @@ extern Oid AssignTypeMultirangeArrayOid(void);
extern ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw);
extern ObjectAddress AlterDomainNotNull(List *names, bool notNull);
-extern ObjectAddress AlterDomainAddConstraint(List *names, Node *constr,
+extern ObjectAddress AlterDomainAddConstraint(List *names, Node *newConstraint,
ObjectAddress *constrAddr);
extern ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName);
extern ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName,
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index 63f2b6a80..a1751b370 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -26,8 +26,8 @@ extern char *pg_strdup(const char *in);
extern void *pg_malloc(size_t size);
extern void *pg_malloc0(size_t size);
extern void *pg_malloc_extended(size_t size, int flags);
-extern void *pg_realloc(void *pointer, size_t size);
-extern void pg_free(void *pointer);
+extern void *pg_realloc(void *ptr, size_t size);
+extern void pg_free(void *ptr);
/*
* Variants with easier notation and more type safety
diff --git a/src/include/common/kwlookup.h b/src/include/common/kwlookup.h
index 48d7f08b8..8384e33a5 100644
--- a/src/include/common/kwlookup.h
+++ b/src/include/common/kwlookup.h
@@ -32,7 +32,7 @@ typedef struct ScanKeywordList
} ScanKeywordList;
-extern int ScanKeywordLookup(const char *text, const ScanKeywordList *keywords);
+extern int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords);
/* Code that wants to retrieve the text of the N'th keyword should use this. */
static inline const char *
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
index d1f840c11..e1f5e786e 100644
--- a/src/include/common/scram-common.h
+++ b/src/include/common/scram-common.h
@@ -49,7 +49,7 @@
extern int scram_SaltedPassword(const char *password, const char *salt,
int saltlen, int iterations, uint8 *result,
const char **errstr);
-extern int scram_H(const uint8 *str, int len, uint8 *result,
+extern int scram_H(const uint8 *input, int len, uint8 *result,
const char **errstr);
extern int scram_ClientKey(const uint8 *salted_password, uint8 *result,
const char **errstr);
diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h
index 3a1b11326..955d0bd64 100644
--- a/src/include/executor/execParallel.h
+++ b/src/include/executor/execParallel.h
@@ -38,13 +38,13 @@ typedef struct ParallelExecutorInfo
} ParallelExecutorInfo;
extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate,
- EState *estate, Bitmapset *sendParam, int nworkers,
+ EState *estate, Bitmapset *sendParams, int nworkers,
int64 tuples_needed);
extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei);
extern void ExecParallelFinish(ParallelExecutorInfo *pei);
extern void ExecParallelCleanup(ParallelExecutorInfo *pei);
extern void ExecParallelReinitialize(PlanState *planstate,
- ParallelExecutorInfo *pei, Bitmapset *sendParam);
+ ParallelExecutorInfo *pei, Bitmapset *sendParams);
extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 82925b4b6..fc8a469f2 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -218,7 +218,7 @@ extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
- Index rti, TupleTableSlot *testslot);
+ Index rti, TupleTableSlot *inputslot);
extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
Plan *subplan, List *auxrowmarks, int epqParam);
extern void EvalPlanQualSetPlan(EPQState *epqstate,
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index b2c0c7486..697abe5fc 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -174,7 +174,7 @@ extern void *SPI_palloc(Size size);
extern void *SPI_repalloc(void *pointer, Size size);
extern void SPI_pfree(void *pointer);
extern Datum SPI_datumTransfer(Datum value, bool typByVal, int typLen);
-extern void SPI_freetuple(HeapTuple pointer);
+extern void SPI_freetuple(HeapTuple tuple);
extern void SPI_freetuptable(SPITupleTable *tuptable);
extern Portal SPI_cursor_open(const char *name, SPIPlanPtr plan,
diff --git a/src/include/fe_utils/parallel_slot.h b/src/include/fe_utils/parallel_slot.h
index 8ce63c937..199df9bb0 100644
--- a/src/include/fe_utils/parallel_slot.h
+++ b/src/include/fe_utils/parallel_slot.h
@@ -58,7 +58,7 @@ ParallelSlotClearHandler(ParallelSlot *slot)
slot->handler_context = NULL;
}
-extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *slots,
+extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *sa,
const char *dbname);
extern ParallelSlotArray *ParallelSlotsSetup(int numslots, ConnParams *cparams,
diff --git a/src/include/fe_utils/simple_list.h b/src/include/fe_utils/simple_list.h
index 9261a7b0a..757fd6ac5 100644
--- a/src/include/fe_utils/simple_list.h
+++ b/src/include/fe_utils/simple_list.h
@@ -65,6 +65,6 @@ extern void simple_string_list_destroy(SimpleStringList *list);
extern const char *simple_string_list_not_touched(SimpleStringList *list);
-extern void simple_ptr_list_append(SimplePtrList *list, void *val);
+extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
#endif /* SIMPLE_LIST_H */
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index fa4deb249..0927cb19b 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -24,7 +24,7 @@ extern PGDLLIMPORT int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);
/* Functions */
-extern const char *fmtId(const char *identifier);
+extern const char *fmtId(const char *rawid);
extern const char *fmtQualifiedId(const char *schema, const char *id);
extern char *formatPGVersionNumber(int version_number, bool include_minor,
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index dc3d819a1..10dbe3981 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -348,7 +348,7 @@ extern void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx);
* "VARIADIC NULL".
*/
extern int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start,
- bool convert_unknown, Datum **values,
+ bool convert_unknown, Datum **args,
Oid **types, bool **nulls);
#endif /* FUNCAPI_H */
diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h
index 90036f7bc..d06da8180 100644
--- a/src/include/libpq/hba.h
+++ b/src/include/libpq/hba.h
@@ -169,7 +169,7 @@ extern const char *hba_authname(UserAuth auth_method);
extern void hba_getauthmethod(hbaPort *port);
extern int check_usermap(const char *usermap_name,
const char *pg_role, const char *auth_user,
- bool case_sensitive);
+ bool case_insensitive);
extern HbaLine *parse_hba_line(TokenizedAuthLine *tok_line, int elevel);
extern IdentLine *parse_ident_line(TokenizedAuthLine *tok_line, int elevel);
extern bool pg_isblank(const char c);
diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h
index 6687c8f4c..0d7b43d83 100644
--- a/src/include/libpq/pqmq.h
+++ b/src/include/libpq/pqmq.h
@@ -19,6 +19,6 @@
extern void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh);
extern void pq_set_parallel_leader(pid_t pid, BackendId backend_id);
-extern void pq_parse_errornotice(StringInfo str, ErrorData *edata);
+extern void pq_parse_errornotice(StringInfo msg, ErrorData *edata);
#endif /* PQMQ_H */
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 1e8c3af36..284b86525 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -610,7 +610,7 @@ extern size_t pg_wchar_strlen(const pg_wchar *wstr);
extern int pg_mblen(const char *mbstr);
extern int pg_dsplen(const char *mbstr);
extern int pg_mbstrlen(const char *mbstr);
-extern int pg_mbstrlen_with_len(const char *mbstr, int len);
+extern int pg_mbstrlen_with_len(const char *mbstr, int limit);
extern int pg_mbcliplen(const char *mbstr, int len, int limit);
extern int pg_encoding_mbcliplen(int encoding, const char *mbstr,
int len, int limit);
@@ -641,7 +641,7 @@ extern int pg_do_encoding_conversion_buf(Oid proc,
int src_encoding,
int dest_encoding,
unsigned char *src, int srclen,
- unsigned char *dst, int dstlen,
+ unsigned char *dest, int destlen,
bool noError);
extern char *pg_client_to_server(const char *s, int len);
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 65cf4ba50..ee48e392e 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -352,7 +352,7 @@ extern bool InSecurityRestrictedOperation(void);
extern bool InNoForceRLSOperation(void);
extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
-extern void InitializeSessionUserId(const char *rolename, Oid useroid);
+extern void InitializeSessionUserId(const char *rolename, Oid roleid);
extern void InitializeSessionUserIdStandalone(void);
extern void SetSessionAuthorization(Oid userid, bool is_superuser);
extern Oid GetCurrentRoleId(void);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index cdd6debfa..a80f43e54 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -218,7 +218,7 @@ extern int16 *readAttrNumberCols(int numCols);
/*
* nodes/copyfuncs.c
*/
-extern void *copyObjectImpl(const void *obj);
+extern void *copyObjectImpl(const void *from);
/* cast result back to argument type, if supported by compiler */
#ifdef HAVE_TYPEOF
diff --git a/src/include/nodes/params.h b/src/include/nodes/params.h
index de2dd907e..543543d68 100644
--- a/src/include/nodes/params.h
+++ b/src/include/nodes/params.h
@@ -163,8 +163,8 @@ extern ParamListInfo copyParamList(ParamListInfo from);
extern Size EstimateParamListSpace(ParamListInfo paramLI);
extern void SerializeParamList(ParamListInfo paramLI, char **start_address);
extern ParamListInfo RestoreParamList(char **start_address);
-extern char *BuildParamLogString(ParamListInfo params, char **paramTextValues,
- int valueLen);
+extern char *BuildParamLogString(ParamListInfo params, char **knownTextValues,
+ int maxlen);
extern void ParamsErrorCallback(void *arg);
#endif /* PARAMS_H */
diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h
index 5e83b843d..91878e8b9 100644
--- a/src/include/nodes/value.h
+++ b/src/include/nodes/value.h
@@ -83,7 +83,7 @@ typedef struct BitString
extern Integer *makeInteger(int i);
extern Float *makeFloat(char *numericStr);
-extern Boolean *makeBoolean(bool var);
+extern Boolean *makeBoolean(bool val);
extern String *makeString(char *str);
extern BitString *makeBitString(char *str);
diff --git a/src/include/optimizer/appendinfo.h b/src/include/optimizer/appendinfo.h
index 5e80a741a..28568fab5 100644
--- a/src/include/optimizer/appendinfo.h
+++ b/src/include/optimizer/appendinfo.h
@@ -40,7 +40,7 @@ extern void get_translated_update_targetlist(PlannerInfo *root, Index relid,
List **update_colnos);
extern AppendRelInfo **find_appinfos_by_relids(PlannerInfo *root,
Relids relids, int *nappinfos);
-extern void add_row_identity_var(PlannerInfo *root, Var *rowid_var,
+extern void add_row_identity_var(PlannerInfo *root, Var *orig_var,
Index rtindex, const char *rowid_name);
extern void add_row_identity_columns(PlannerInfo *root, Index rtindex,
RangeTblEntry *target_rte,
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index 6c5203dc4..ff242d1b6 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -40,8 +40,8 @@ extern bool contain_leaked_vars(Node *clause);
extern Relids find_nonnullable_rels(Node *clause);
extern List *find_nonnullable_vars(Node *clause);
-extern List *find_forced_null_vars(Node *clause);
-extern Var *find_forced_null_var(Node *clause);
+extern List *find_forced_null_vars(Node *node);
+extern Var *find_forced_null_var(Node *node);
extern bool is_pseudo_constant_clause(Node *clause);
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index d11cdac7f..881386997 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -170,8 +170,8 @@ extern void add_child_rel_equivalences(PlannerInfo *root,
extern void add_child_join_rel_equivalences(PlannerInfo *root,
int nappinfos,
AppendRelInfo **appinfos,
- RelOptInfo *parent_rel,
- RelOptInfo *child_rel);
+ RelOptInfo *parent_joinrel,
+ RelOptInfo *child_joinrel);
extern List *generate_implied_equalities_for_column(PlannerInfo *root,
RelOptInfo *rel,
ec_matches_callback_type callback,
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 1566f435b..9dffdcfd1 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -115,6 +115,6 @@ extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
extern bool trivial_subqueryscan(SubqueryScan *plan);
extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
extern void record_plan_type_dependency(PlannerInfo *root, Oid typid);
-extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *root);
+extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *context);
#endif /* PLANMAIN_H */
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index dc379547c..3d3a5918c 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -43,7 +43,7 @@ extern List *transformInsertRow(ParseState *pstate, List *exprlist,
List *stmtcols, List *icolumns, List *attrnos,
bool strip_indirection);
extern List *transformUpdateTargetList(ParseState *pstate,
- List *targetList);
+ List *origTlist);
extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
extern Query *transformStmt(ParseState *pstate, Node *parseTree);
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index c56822f64..0856af5b4 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -19,7 +19,7 @@ extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
List *args, List *aggorder,
bool agg_distinct);
-extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *g);
+extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *p);
extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
WindowDef *windef);
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h
index e15b62290..7a57b199b 100644
--- a/src/include/parser/parse_oper.h
+++ b/src/include/parser/parse_oper.h
@@ -29,8 +29,8 @@ extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
/* Routines to find operators matching a name and given input types */
/* NB: the selected operator may require coercion of the input types! */
-extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2,
- bool noError, int location);
+extern Operator oper(ParseState *pstate, List *opname, Oid ltypeId,
+ Oid rtypeId, bool noError, int location);
extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
bool noError, int location);
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index de21c3c64..484db165d 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -88,7 +88,7 @@ extern ParseNamespaceItem *addRangeTableEntryForJoin(ParseState *pstate,
List *aliasvars,
List *leftcols,
List *rightcols,
- Alias *joinalias,
+ Alias *join_using_alias,
Alias *alias,
bool inFromCl);
extern ParseNamespaceItem *addRangeTableEntryForCTE(ParseState *pstate,
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index b1e3f1b84..1f5b706d8 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -98,7 +98,7 @@ typedef struct PartitionBoundInfoData
#define partition_bound_accepts_nulls(bi) ((bi)->null_index != -1)
#define partition_bound_has_default(bi) ((bi)->default_index != -1)
-extern int get_hash_partition_greatest_modulus(PartitionBoundInfo b);
+extern int get_hash_partition_greatest_modulus(PartitionBoundInfo bound);
extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
Oid *partcollation,
Datum *values, bool *isnull);
@@ -125,7 +125,7 @@ extern void check_new_partition_bound(char *relname, Relation parent,
PartitionBoundSpec *spec,
ParseState *pstate);
extern void check_default_partition_contents(Relation parent,
- Relation defaultRel,
+ Relation default_rel,
PartitionBoundSpec *new_spec);
extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc,
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index ac28f813b..ad7334a0d 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -417,7 +417,7 @@ extern long pgstat_report_stat(bool force);
extern void pgstat_force_next_flush(void);
extern void pgstat_reset_counters(void);
-extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objectid);
+extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objoid);
extern void pgstat_reset_of_kind(PgStat_Kind kind);
/* stats accessors */
@@ -474,7 +474,7 @@ extern void pgstat_report_connect(Oid dboid);
#define pgstat_count_conn_txn_idle_time(n) \
(pgStatTransactionIdleTime += (n))
-extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dbid);
+extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dboid);
/*
* Functions in pgstat_function.c
@@ -489,7 +489,7 @@ extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo,
extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu,
bool finalize);
-extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid funcid);
+extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid func_id);
extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
@@ -499,7 +499,7 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
extern void pgstat_create_relation(Relation rel);
extern void pgstat_drop_relation(Relation rel);
-extern void pgstat_copy_relation_stats(Relation dstrel, Relation srcrel);
+extern void pgstat_copy_relation_stats(Relation dst, Relation src);
extern void pgstat_init_relation(Relation rel);
extern void pgstat_assoc_relation(Relation rel);
@@ -571,7 +571,7 @@ extern void pgstat_twophase_postabort(TransactionId xid, uint16 info,
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry(Oid relid);
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry_ext(bool shared,
- Oid relid);
+ Oid reloid);
extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
diff --git a/src/include/port.h b/src/include/port.h
index cec41eae7..7ee75994d 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -46,14 +46,14 @@ extern bool pg_set_block(pgsocket sock);
/* Portable path handling for Unix/Win32 (in path.c) */
-extern bool has_drive_prefix(const char *filename);
+extern bool has_drive_prefix(const char *path);
extern char *first_dir_separator(const char *filename);
extern char *last_dir_separator(const char *filename);
extern char *first_path_var_separator(const char *pathlist);
extern void join_path_components(char *ret_path,
const char *head, const char *tail);
extern void canonicalize_path(char *path);
-extern void make_native_path(char *path);
+extern void make_native_path(char *filename);
extern void cleanup_path(char *path);
extern bool path_contains_parent_reference(const char *path);
extern bool path_is_relative_and_below_cwd(const char *path);
@@ -479,7 +479,7 @@ extern pqsigfunc pqsignal(int signo, pqsigfunc func);
extern char *escape_single_quotes_ascii(const char *src);
/* common/wait_error.c */
-extern char *wait_result_to_str(int exit_status);
+extern char *wait_result_to_str(int exitstatus);
extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index a771ab8ff..7eaa4c97e 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -219,7 +219,7 @@ extern LogicalRepRelId logicalrep_read_update(StringInfo in,
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, TransactionId xid,
- Relation rel, TupleTableSlot *oldtuple,
+ Relation rel, TupleTableSlot *oldslot,
bool binary);
extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
@@ -235,7 +235,7 @@ extern void logicalrep_write_rel(StringInfo out, TransactionId xid,
extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
extern void logicalrep_write_typ(StringInfo out, TransactionId xid,
Oid typoid);
-extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
+extern void logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp);
extern void logicalrep_write_stream_start(StringInfo out, TransactionId xid,
bool first_segment);
extern TransactionId logicalrep_read_stream_start(StringInfo in,
@@ -243,7 +243,7 @@ extern TransactionId logicalrep_read_stream_start(StringInfo in,
extern void logicalrep_write_stream_stop(StringInfo out);
extern void logicalrep_write_stream_commit(StringInfo out, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn);
-extern TransactionId logicalrep_read_stream_commit(StringInfo out,
+extern TransactionId logicalrep_read_stream_commit(StringInfo in,
LogicalRepCommitData *commit_data);
extern void logicalrep_write_stream_abort(StringInfo out, TransactionId xid,
TransactionId subxid);
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index 8695901ba..d7902666b 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -655,11 +655,12 @@ extern void ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
TimestampTz commit_time,
RepOriginId origin_id, XLogRecPtr origin_lsn,
char *gid, bool is_commit);
-extern void ReorderBufferAssignChild(ReorderBuffer *, TransactionId, TransactionId, XLogRecPtr commit_lsn);
+extern void ReorderBufferAssignChild(ReorderBuffer *rb, TransactionId xid,
+ TransactionId subxid, XLogRecPtr lsn);
extern void ReorderBufferCommitChild(ReorderBuffer *, TransactionId, TransactionId,
XLogRecPtr commit_lsn, XLogRecPtr end_lsn);
extern void ReorderBufferAbort(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
-extern void ReorderBufferAbortOld(ReorderBuffer *, TransactionId xid);
+extern void ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid);
extern void ReorderBufferForget(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
extern void ReorderBufferInvalidate(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
@@ -667,9 +668,10 @@ extern void ReorderBufferSetBaseSnapshot(ReorderBuffer *, TransactionId, XLogRec
extern void ReorderBufferAddSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap);
extern void ReorderBufferAddNewCommandId(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
CommandId cid);
-extern void ReorderBufferAddNewTupleCids(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
- RelFileLocator locator, ItemPointerData pt,
- CommandId cmin, CommandId cmax, CommandId combocid);
+extern void ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
+ RelFileLocator locator, ItemPointerData tid,
+ CommandId cmin, CommandId cmax,
+ CommandId combocid);
extern void ReorderBufferAddInvalidations(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
Size nmsgs, SharedInvalidationMessage *msgs);
extern void ReorderBufferImmediateInvalidation(ReorderBuffer *, uint32 ninvalidations,
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index 8c9f3321d..9d68bfa64 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -195,7 +195,7 @@ extern void ReplicationSlotsShmemInit(void);
/* management of individual slots */
extern void ReplicationSlotCreate(const char *name, bool db_specific,
- ReplicationSlotPersistency p, bool two_phase);
+ ReplicationSlotPersistency persistency, bool two_phase);
extern void ReplicationSlotPersist(void);
extern void ReplicationSlotDrop(const char *name, bool nowait);
diff --git a/src/include/replication/snapbuild.h b/src/include/replication/snapbuild.h
index e6adea24f..f126ff2e0 100644
--- a/src/include/replication/snapbuild.h
+++ b/src/include/replication/snapbuild.h
@@ -59,24 +59,24 @@ struct xl_running_xacts;
extern void CheckPointSnapBuild(void);
-extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *cache,
+extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *reorder,
TransactionId xmin_horizon, XLogRecPtr start_lsn,
bool need_full_snapshot,
XLogRecPtr two_phase_at);
-extern void FreeSnapshotBuilder(SnapBuild *cache);
+extern void FreeSnapshotBuilder(SnapBuild *builder);
extern void SnapBuildSnapDecRefcount(Snapshot snap);
extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
-extern const char *SnapBuildExportSnapshot(SnapBuild *snapstate);
+extern const char *SnapBuildExportSnapshot(SnapBuild *builder);
extern void SnapBuildClearExportedSnapshot(void);
extern void SnapBuildResetExportedSnapshotState(void);
-extern SnapBuildState SnapBuildCurrentState(SnapBuild *snapstate);
+extern SnapBuildState SnapBuildCurrentState(SnapBuild *builder);
extern Snapshot SnapBuildGetOrBuildSnapshot(SnapBuild *builder,
TransactionId xid);
-extern bool SnapBuildXactNeedsSkip(SnapBuild *snapstate, XLogRecPtr ptr);
+extern bool SnapBuildXactNeedsSkip(SnapBuild *builder, XLogRecPtr ptr);
extern XLogRecPtr SnapBuildGetTwoPhaseAt(SnapBuild *builder);
extern void SnapBuildSetTwoPhaseAt(SnapBuild *builder, XLogRecPtr ptr);
@@ -86,7 +86,8 @@ extern void SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn,
extern bool SnapBuildProcessChange(SnapBuild *builder, TransactionId xid,
XLogRecPtr lsn);
extern void SnapBuildProcessNewCid(SnapBuild *builder, TransactionId xid,
- XLogRecPtr lsn, struct xl_heap_new_cid *cid);
+ XLogRecPtr lsn,
+ struct xl_heap_new_cid *xlrec);
extern void SnapBuildProcessRunningXacts(SnapBuild *builder, XLogRecPtr lsn,
struct xl_running_xacts *running);
extern void SnapBuildSerializationPoint(SnapBuild *builder, XLogRecPtr lsn);
diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h
index d99a21b07..8336a6e71 100644
--- a/src/include/replication/walsender.h
+++ b/src/include/replication/walsender.h
@@ -36,7 +36,7 @@ extern PGDLLIMPORT int wal_sender_timeout;
extern PGDLLIMPORT bool log_replication_commands;
extern void InitWalSender(void);
-extern bool exec_replication_command(const char *query_string);
+extern bool exec_replication_command(const char *cmd_string);
extern void WalSndErrorCleanup(void);
extern void WalSndResourceCleanup(bool isCommit);
extern void WalSndSignals(void);
diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index 98b9b3a28..f001ca41b 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -42,7 +42,7 @@ typedef enum ReplaceVarsNoMatchOption
extern void OffsetVarNodes(Node *node, int offset, int sublevels_up);
-extern void ChangeVarNodes(Node *node, int old_varno, int new_varno,
+extern void ChangeVarNodes(Node *node, int rt_index, int new_index,
int sublevels_up);
extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up,
int min_sublevels_up);
diff --git a/src/include/snowball/libstemmer/header.h b/src/include/snowball/libstemmer/header.h
index bf172d5b9..ef5a54640 100644
--- a/src/include/snowball/libstemmer/header.h
+++ b/src/include/snowball/libstemmer/header.h
@@ -45,7 +45,7 @@ extern int eq_v_b(struct SN_env * z, const symbol * p);
extern int find_among(struct SN_env * z, const struct among * v, int v_size);
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
-extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
+extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr);
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
extern int slice_from_v(struct SN_env * z, const symbol * p);
extern int slice_del(struct SN_env * z);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index bb7ef1240..0351927a2 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -102,8 +102,8 @@ extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalro
int numrows, HeapTuple *rows,
int natts, VacAttrStats **vacattrstats);
extern int ComputeExtStatisticsRows(Relation onerel,
- int natts, VacAttrStats **stats);
-extern bool statext_is_kind_built(HeapTuple htup, char kind);
+ int natts, VacAttrStats **vacattrstats);
+extern bool statext_is_kind_built(HeapTuple htup, char type);
extern Selectivity dependencies_clauselist_selectivity(PlannerInfo *root,
List *clauses,
int varRelid,
diff --git a/src/include/storage/barrier.h b/src/include/storage/barrier.h
index 57d2c52e7..4b16ab812 100644
--- a/src/include/storage/barrier.h
+++ b/src/include/storage/barrier.h
@@ -34,7 +34,7 @@ typedef struct Barrier
ConditionVariable condition_variable;
} Barrier;
-extern void BarrierInit(Barrier *barrier, int num_workers);
+extern void BarrierInit(Barrier *barrier, int participants);
extern bool BarrierArriveAndWait(Barrier *barrier, uint32 wait_event_info);
extern bool BarrierArriveAndDetach(Barrier *barrier);
extern bool BarrierArriveAndDetachExceptLast(Barrier *barrier);
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 6a947021a..2708c4b68 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -499,9 +499,9 @@ extern Size PageGetFreeSpace(Page page);
extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups);
extern Size PageGetExactFreeSpace(Page page);
extern Size PageGetHeapFreeSpace(Page page);
-extern void PageIndexTupleDelete(Page page, OffsetNumber offset);
+extern void PageIndexTupleDelete(Page page, OffsetNumber offnum);
extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems);
-extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offset);
+extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum);
extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
Item newtup, Size newsize);
extern char *PageSetChecksumCopy(Page page, BlockNumber blkno);
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index 2b4a8e0ff..5a48fccd9 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -117,11 +117,11 @@ extern int FileGetRawFlags(File file);
extern mode_t FileGetRawMode(File file);
/* Operations used for sharing named temporary files */
-extern File PathNameCreateTemporaryFile(const char *name, bool error_on_failure);
+extern File PathNameCreateTemporaryFile(const char *path, bool error_on_failure);
extern File PathNameOpenTemporaryFile(const char *path, int mode);
-extern bool PathNameDeleteTemporaryFile(const char *name, bool error_on_failure);
-extern void PathNameCreateTemporaryDir(const char *base, const char *name);
-extern void PathNameDeleteTemporaryDir(const char *name);
+extern bool PathNameDeleteTemporaryFile(const char *path, bool error_on_failure);
+extern void PathNameCreateTemporaryDir(const char *basedir, const char *directory);
+extern void PathNameDeleteTemporaryDir(const char *dirname);
extern void TempTablespacePath(char *path, Oid tablespace);
/* Operations that allow use of regular stdio --- USE WITH CAUTION */
@@ -177,7 +177,7 @@ extern int pg_fsync(int fd);
extern int pg_fsync_no_writethrough(int fd);
extern int pg_fsync_writethrough(int fd);
extern int pg_fdatasync(int fd);
-extern void pg_flush_data(int fd, off_t offset, off_t amount);
+extern void pg_flush_data(int fd, off_t offset, off_t nbytes);
extern ssize_t pg_pwritev_with_retry(int fd,
const struct iovec *iov,
int iovcnt,
@@ -185,8 +185,8 @@ extern ssize_t pg_pwritev_with_retry(int fd,
extern int pg_truncate(const char *path, off_t length);
extern void fsync_fname(const char *fname, bool isdir);
extern int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel);
-extern int durable_rename(const char *oldfile, const char *newfile, int loglevel);
-extern int durable_unlink(const char *fname, int loglevel);
+extern int durable_rename(const char *oldfile, const char *newfile, int elevel);
+extern int durable_unlink(const char *fname, int elevel);
extern void SyncDataDirectory(void);
extern int data_sync_elevel(int elevel);
diff --git a/src/include/storage/fsm_internals.h b/src/include/storage/fsm_internals.h
index a6f837217..819160c78 100644
--- a/src/include/storage/fsm_internals.h
+++ b/src/include/storage/fsm_internals.h
@@ -61,7 +61,7 @@ typedef FSMPageData *FSMPage;
#define SlotsPerFSMPage LeafNodesPerPage
/* Prototypes for functions in fsmpage.c */
-extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext,
+extern int fsm_search_avail(Buffer buf, uint8 minvalue, bool advancenext,
bool exclusive_lock_held);
extern uint8 fsm_get_avail(Page page, int slot);
extern uint8 fsm_get_max_avail(Page page);
diff --git a/src/include/storage/indexfsm.h b/src/include/storage/indexfsm.h
index 04c1a051b..129590863 100644
--- a/src/include/storage/indexfsm.h
+++ b/src/include/storage/indexfsm.h
@@ -18,8 +18,8 @@
#include "utils/relcache.h"
extern BlockNumber GetFreeIndexPage(Relation rel);
-extern void RecordFreeIndexPage(Relation rel, BlockNumber page);
-extern void RecordUsedIndexPage(Relation rel, BlockNumber page);
+extern void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock);
+extern void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock);
extern void IndexFreeSpaceMapVacuum(Relation rel);
diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h
index 8dfcb3944..dbef2ffb0 100644
--- a/src/include/storage/predicate.h
+++ b/src/include/storage/predicate.h
@@ -58,7 +58,7 @@ extern void RegisterPredicateLockingXid(TransactionId xid);
extern void PredicateLockRelation(Relation relation, Snapshot snapshot);
extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot);
extern void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot,
- TransactionId insert_xid);
+ TransactionId tuple_xid);
extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void TransferPredicateLocksToHeapRelation(Relation relation);
diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h
index dacef92f4..f5da98dc7 100644
--- a/src/include/storage/standby.h
+++ b/src/include/storage/standby.h
@@ -43,7 +43,7 @@ extern void StandbyDeadLockHandler(void);
extern void StandbyTimeoutHandler(void);
extern void StandbyLockTimeoutHandler(void);
extern void LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
- TimestampTz cur_ts, VirtualTransactionId *wait_list,
+ TimestampTz now, VirtualTransactionId *wait_list,
bool still_waiting);
/*
diff --git a/src/include/tcop/cmdtag.h b/src/include/tcop/cmdtag.h
index b9e8992a4..60e3179c7 100644
--- a/src/include/tcop/cmdtag.h
+++ b/src/include/tcop/cmdtag.h
@@ -53,6 +53,6 @@ extern const char *GetCommandTagName(CommandTag commandTag);
extern bool command_tag_display_rowcount(CommandTag commandTag);
extern bool command_tag_event_trigger_ok(CommandTag commandTag);
extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
-extern CommandTag GetCommandTagEnum(const char *tagname);
+extern CommandTag GetCommandTagEnum(const char *commandname);
#endif /* CMDTAG_H */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index c36c711da..fd73b3844 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -32,8 +32,8 @@ typedef struct TSVectorParseStateData *TSVectorParseState;
extern TSVectorParseState init_tsvector_parser(char *input, int flags);
extern void reset_tsvector_parser(TSVectorParseState state, char *input);
extern bool gettoken_tsvector(TSVectorParseState state,
- char **token, int *len,
- WordEntryPos **pos, int *poslen,
+ char **strval, int *lenval,
+ WordEntryPos **pos_ptr, int *poslen,
char **endptr);
extern void close_tsvector_parser(TSVectorParseState state);
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 3d6411197..9a4df3a5d 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -214,8 +214,8 @@ extern bool is_member_of_role_nosuper(Oid member, Oid role);
extern bool is_admin_of_role(Oid member, Oid role);
extern Oid select_best_admin(Oid member, Oid role);
extern void check_is_member_of_role(Oid member, Oid role);
-extern Oid get_role_oid(const char *rolename, bool missing_ok);
-extern Oid get_role_oid_or_public(const char *rolename);
+extern Oid get_role_oid(const char *rolname, bool missing_ok);
+extern Oid get_role_oid_or_public(const char *rolname);
extern Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok);
extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
@@ -285,7 +285,7 @@ extern AclResult pg_parameter_acl_aclcheck(Oid acl_oid, Oid roleid,
AclMode mode);
extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
-extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
+extern AclResult pg_largeobject_aclcheck_snapshot(Oid lobj_oid, Oid roleid,
AclMode mode, Snapshot snapshot);
extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
diff --git a/src/include/utils/attoptcache.h b/src/include/utils/attoptcache.h
index ee37af950..49ae64721 100644
--- a/src/include/utils/attoptcache.h
+++ b/src/include/utils/attoptcache.h
@@ -23,6 +23,6 @@ typedef struct AttributeOpts
float8 n_distinct_inherited;
} AttributeOpts;
-extern AttributeOpts *get_attribute_options(Oid spcid, int attnum);
+extern AttributeOpts *get_attribute_options(Oid attrelid, int attnum);
#endif /* ATTOPTCACHE_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 221c3e6c3..81631f164 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -47,10 +47,10 @@ extern int16 pg_strtoint16(const char *s);
extern int32 pg_strtoint32(const char *s);
extern int64 pg_strtoint64(const char *s);
extern int pg_itoa(int16 i, char *a);
-extern int pg_ultoa_n(uint32 l, char *a);
-extern int pg_ulltoa_n(uint64 l, char *a);
-extern int pg_ltoa(int32 l, char *a);
-extern int pg_lltoa(int64 ll, char *a);
+extern int pg_ultoa_n(uint32 value, char *a);
+extern int pg_ulltoa_n(uint64 value, char *a);
+extern int pg_ltoa(int32 value, char *a);
+extern int pg_lltoa(int64 value, char *a);
extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
extern char *pg_ultostr(char *str, uint32 value);
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 4527e8251..2cae346be 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -327,7 +327,7 @@ extern int DecodeTimezoneAbbrev(int field, char *lowtoken,
extern int DecodeSpecial(int field, char *lowtoken, int *val);
extern int DecodeUnits(int field, char *lowtoken, int *val);
-extern int j2day(int jd);
+extern int j2day(int date);
extern Node *TemporalSimplify(int32 max_precis, Node *node);
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index 4cbe6edf2..8f1b3dc5e 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -379,13 +379,13 @@ typedef struct JsonbIterator
extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
extern uint32 getJsonbLength(const JsonbContainer *jc, int index);
extern int compareJsonbContainers(JsonbContainer *a, JsonbContainer *b);
-extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *container,
uint32 flags,
JsonbValue *key);
extern JsonbValue *getKeyJsonValueFromContainer(JsonbContainer *container,
const char *keyVal, int keyLen,
JsonbValue *res);
-extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *container,
uint32 i);
extern JsonbValue *pushJsonbValue(JsonbParseState **pstate,
JsonbIteratorToken seq, JsonbValue *jbval);
diff --git a/src/include/utils/multirangetypes.h b/src/include/utils/multirangetypes.h
index 915330f99..bc3339205 100644
--- a/src/include/utils/multirangetypes.h
+++ b/src/include/utils/multirangetypes.h
@@ -64,7 +64,7 @@ extern bool multirange_ne_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr2);
extern bool multirange_contains_elem_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
- Datum elem);
+ Datum val);
extern bool multirange_contains_range_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
const RangeType *r);
@@ -115,11 +115,11 @@ extern MultirangeType *multirange_intersect_internal(Oid mltrngtypoid,
extern TypeCacheEntry *multirange_get_typcache(FunctionCallInfo fcinfo,
Oid mltrngtypid);
extern void multirange_deserialize(TypeCacheEntry *rangetyp,
- const MultirangeType *range,
+ const MultirangeType *multirange,
int32 *range_count,
RangeType ***ranges);
extern MultirangeType *make_multirange(Oid mltrngtypoid,
- TypeCacheEntry *typcache,
+ TypeCacheEntry *rangetyp,
int32 range_count, RangeType **ranges);
extern MultirangeType *make_empty_multirange(Oid mltrngtypoid,
TypeCacheEntry *rangetyp);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 3caa74dfe..09d355e81 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -85,6 +85,6 @@ extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2,
bool *have_error);
extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2,
bool *have_error);
-extern int32 numeric_int4_opt_error(Numeric num, bool *error);
+extern int32 numeric_int4_opt_error(Numeric num, bool *have_error);
#endif /* _PG_NUMERIC_H_ */
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 901d2041d..40a360285 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -567,7 +567,7 @@ extern void pgstat_relation_delete_pending_cb(PgStat_EntryRef *entry_ref);
*/
extern void pgstat_replslot_reset_timestamp_cb(PgStatShared_Common *header, TimestampTz ts);
-extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *tmp, NameData *name);
+extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *header, NameData *name);
extern bool pgstat_replslot_from_serialized_name_cb(const NameData *name, PgStat_HashKey *key);
@@ -579,7 +579,7 @@ extern void pgstat_attach_shmem(void);
extern void pgstat_detach_shmem(void);
extern PgStat_EntryRef *pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objoid,
- bool create, bool *found);
+ bool create, bool *created_entry);
extern bool pgstat_lock_entry(PgStat_EntryRef *entry_ref, bool nowait);
extern bool pgstat_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait);
extern void pgstat_unlock_entry(PgStat_EntryRef *entry_ref);
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h
index 993fad4fc..b62f1ea48 100644
--- a/src/include/utils/rangetypes.h
+++ b/src/include/utils/rangetypes.h
@@ -141,8 +141,8 @@ extern int range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1,
extern int range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1,
const RangeBound *b2);
extern int range_compare(const void *key1, const void *key2, void *arg);
-extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1,
- RangeBound bound2);
+extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound boundA,
+ RangeBound boundB);
extern RangeType *make_empty_range(TypeCacheEntry *typcache);
extern bool range_split_internal(TypeCacheEntry *typcache, const RangeType *r1,
const RangeType *r2, RangeType **output1,
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h
index a36ceba7a..0e2965ff9 100644
--- a/src/include/utils/regproc.h
+++ b/src/include/utils/regproc.h
@@ -28,7 +28,7 @@ extern char *format_operator_extended(Oid operator_oid, bits16 flags);
extern List *stringToQualifiedNameList(const char *string);
extern char *format_procedure(Oid procedure_oid);
extern char *format_procedure_qualified(Oid procedure_oid);
-extern void format_procedure_parts(Oid operator_oid, List **objnames,
+extern void format_procedure_parts(Oid procedure_oid, List **objnames,
List **objargs, bool missing_ok);
extern char *format_operator(Oid operator_oid);
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index ba35d6b3b..73106b6fc 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -50,7 +50,7 @@ extern Oid RelationGetReplicaIndex(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);
extern List *RelationGetDummyIndexExpressions(Relation relation);
extern List *RelationGetIndexPredicate(Relation relation);
-extern Datum *RelationGetIndexRawAttOptions(Relation relation);
+extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
typedef enum IndexAttrBitmapKind
diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h
index 2bb2e255f..92f1f779a 100644
--- a/src/include/utils/relmapper.h
+++ b/src/include/utils/relmapper.h
@@ -37,7 +37,7 @@ typedef struct xl_relmap_update
extern RelFileNumber RelationMapOidToFilenumber(Oid relationId, bool shared);
-extern Oid RelationMapFilenumberToOid(RelFileNumber relationId, bool shared);
+extern Oid RelationMapFilenumberToOid(RelFileNumber filenumber, bool shared);
extern RelFileNumber RelationMapOidToFilenumberForDatabase(char *dbpath,
Oid relationId);
extern void RelationMapCopy(Oid dbid, Oid tsid, char *srcdbpath,
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index d485b9bfc..49af4ed2e 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -181,11 +181,11 @@ extern double ineq_histogram_selectivity(PlannerInfo *root,
Oid collation,
Datum constval, Oid consttype);
extern double var_eq_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Datum constval, bool constisnull,
bool varonleft, bool negate);
extern double var_eq_non_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Node *other,
bool varonleft, bool negate);
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 06eafdf11..9f4dd5360 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -169,7 +169,7 @@ extern bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
/* Support for catalog timetravel for logical decoding */
struct HTAB;
extern struct HTAB *HistoricSnapshotGetTupleCids(void);
-extern void SetupHistoricSnapshot(Snapshot snapshot_now, struct HTAB *tuplecids);
+extern void SetupHistoricSnapshot(Snapshot historic_snapshot, struct HTAB *tuplecids);
extern void TeardownHistoricSnapshot(bool is_error);
extern bool HistoricSnapshotActive(void);
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index edf3a9731..820c08941 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -83,10 +83,10 @@ extern pg_time_t timestamptz_to_time_t(TimestampTz t);
extern const char *timestamptz_to_str(TimestampTz t);
-extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *dt);
+extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result);
extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm,
fsec_t *fsec, const char **tzn, pg_tz *attimezone);
-extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec);
+extern void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec);
extern void interval2itm(Interval span, struct pg_itm *itm);
extern int itm2interval(struct pg_itm *itm, Interval *span);
diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c
index dbad77643..ed16f93ac 100644
--- a/src/backend/access/brin/brin_minmax_multi.c
+++ b/src/backend/access/brin/brin_minmax_multi.c
@@ -223,7 +223,8 @@ typedef struct SerializedRanges
static SerializedRanges *brin_range_serialize(Ranges *range);
-static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range);
+static Ranges *brin_range_deserialize(int maxvalues,
+ SerializedRanges *serialized);
/*
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 503cda46e..7e355585a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -420,13 +420,13 @@ heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
* ----------------
*/
Datum
-nocachegetattr(HeapTuple tuple,
+nocachegetattr(HeapTuple tup,
int attnum,
TupleDesc tupleDesc)
{
- HeapTupleHeader tup = tuple->t_data;
+ HeapTupleHeader td = tup->t_data;
char *tp; /* ptr to data part of tuple */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ bits8 *bp = td->t_bits; /* ptr to null bitmap in tuple */
bool slow = false; /* do we have to walk attrs? */
int off; /* current offset within data */
@@ -441,7 +441,7 @@ nocachegetattr(HeapTuple tuple,
attnum--;
- if (!HeapTupleNoNulls(tuple))
+ if (!HeapTupleNoNulls(tup))
{
/*
* there's a null somewhere in the tuple
@@ -470,7 +470,7 @@ nocachegetattr(HeapTuple tuple,
}
}
- tp = (char *) tup + tup->t_hoff;
+ tp = (char *) td + td->t_hoff;
if (!slow)
{
@@ -489,7 +489,7 @@ nocachegetattr(HeapTuple tuple,
* target. If there aren't any, it's safe to cheaply initialize the
* cached offsets for these attrs.
*/
- if (HeapTupleHasVarWidth(tuple))
+ if (HeapTupleHasVarWidth(tup))
{
int j;
@@ -565,7 +565,7 @@ nocachegetattr(HeapTuple tuple,
{
Form_pg_attribute att = TupleDescAttr(tupleDesc, i);
- if (HeapTupleHasNulls(tuple) && att_isnull(i, bp))
+ if (HeapTupleHasNulls(tup) && att_isnull(i, bp))
{
usecache = false;
continue; /* this cannot be the target att */
diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c
index c6c7dfe4c..538e3880c 100644
--- a/src/backend/access/gist/gistbuildbuffers.c
+++ b/src/backend/access/gist/gistbuildbuffers.c
@@ -31,9 +31,9 @@ static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer);
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple item);
+ IndexTuple itup);
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple *item);
+ IndexTuple *itup);
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 588716606..eb811d751 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -108,7 +108,7 @@ static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status
static void index_delete_sort(TM_IndexDeleteOp *delstate);
static int bottomup_sort_and_shrink(TM_IndexDeleteOp *delstate);
static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup);
-static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_required,
+static HeapTuple ExtractReplicaIdentity(Relation relation, HeapTuple tp, bool key_required,
bool *copy);
diff --git a/src/backend/access/heap/visibilitymap.c b/src/backend/access/heap/visibilitymap.c
index ed72eb7b6..93aa5bad6 100644
--- a/src/backend/access/heap/visibilitymap.c
+++ b/src/backend/access/heap/visibilitymap.c
@@ -137,7 +137,7 @@ static void vm_extend(Relation rel, BlockNumber vm_nblocks);
* any I/O. Returns true if any bits have been cleared and false otherwise.
*/
bool
-visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
+visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
int mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -152,21 +152,21 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
elog(DEBUG1, "vm_clear %s %d", RelationGetRelationName(rel), heapBlk);
#endif
- if (!BufferIsValid(buf) || BufferGetBlockNumber(buf) != mapBlock)
+ if (!BufferIsValid(vmbuf) || BufferGetBlockNumber(vmbuf) != mapBlock)
elog(ERROR, "wrong buffer passed to visibilitymap_clear");
- LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
- map = PageGetContents(BufferGetPage(buf));
+ LockBuffer(vmbuf, BUFFER_LOCK_EXCLUSIVE);
+ map = PageGetContents(BufferGetPage(vmbuf));
if (map[mapByte] & mask)
{
map[mapByte] &= ~mask;
- MarkBufferDirty(buf);
+ MarkBufferDirty(vmbuf);
cleared = true;
}
- LockBuffer(buf, BUFFER_LOCK_UNLOCK);
+ LockBuffer(vmbuf, BUFFER_LOCK_UNLOCK);
return cleared;
}
@@ -180,27 +180,27 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
* shouldn't hold a lock on the heap page while doing that. Then, call
* visibilitymap_set to actually set the bit.
*
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by
* an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
* the bit for heapBlk.
*
* If the page doesn't exist in the map file yet, it is extended.
*/
void
-visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
/* Reuse the old pinned buffer if possible */
- if (BufferIsValid(*buf))
+ if (BufferIsValid(*vmbuf))
{
- if (BufferGetBlockNumber(*buf) == mapBlock)
+ if (BufferGetBlockNumber(*vmbuf) == mapBlock)
return;
- ReleaseBuffer(*buf);
+ ReleaseBuffer(*vmbuf);
}
- *buf = vm_readbuf(rel, mapBlock, true);
+ *vmbuf = vm_readbuf(rel, mapBlock, true);
}
/*
@@ -314,11 +314,11 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
* Are all tuples on heapBlk visible to all or are marked frozen, according
* to the visibility map?
*
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by an
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by an
* earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
* the bit for heapBlk, or InvalidBuffer. The caller is responsible for
- * releasing *buf after it's done testing and setting bits.
+ * releasing *vmbuf after it's done testing and setting bits.
*
* NOTE: This function is typically called without a lock on the heap page,
* so somebody else could change the bit just after we look at it. In fact,
@@ -328,7 +328,7 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
* all concurrency issues!
*/
uint8
-visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
uint32 mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -341,23 +341,23 @@ visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
#endif
/* Reuse the old pinned buffer if possible */
- if (BufferIsValid(*buf))
+ if (BufferIsValid(*vmbuf))
{
- if (BufferGetBlockNumber(*buf) != mapBlock)
+ if (BufferGetBlockNumber(*vmbuf) != mapBlock)
{
- ReleaseBuffer(*buf);
- *buf = InvalidBuffer;
+ ReleaseBuffer(*vmbuf);
+ *vmbuf = InvalidBuffer;
}
}
- if (!BufferIsValid(*buf))
+ if (!BufferIsValid(*vmbuf))
{
- *buf = vm_readbuf(rel, mapBlock, false);
- if (!BufferIsValid(*buf))
+ *vmbuf = vm_readbuf(rel, mapBlock, false);
+ if (!BufferIsValid(*vmbuf))
return false;
}
- map = PageGetContents(BufferGetPage(*buf));
+ map = PageGetContents(BufferGetPage(*vmbuf));
/*
* A single byte read is atomic. There could be memory-ordering effects
diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c
index b3d1a6c3f..094b24c7c 100644
--- a/src/backend/access/table/tableam.c
+++ b/src/backend/access/table/tableam.c
@@ -172,19 +172,18 @@ table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan,
}
TableScanDesc
-table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
+table_beginscan_parallel(Relation relation, ParallelTableScanDesc pscan)
{
Snapshot snapshot;
uint32 flags = SO_TYPE_SEQSCAN |
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
- Assert(RelationGetRelid(relation) == parallel_scan->phs_relid);
+ Assert(RelationGetRelid(relation) == pscan->phs_relid);
- if (!parallel_scan->phs_snapshot_any)
+ if (!pscan->phs_snapshot_any)
{
/* Snapshot was serialized -- restore it */
- snapshot = RestoreSnapshot((char *) parallel_scan +
- parallel_scan->phs_snapshot_off);
+ snapshot = RestoreSnapshot((char *) pscan + pscan->phs_snapshot_off);
RegisterSnapshot(snapshot);
flags |= SO_TEMP_SNAPSHOT;
}
@@ -195,7 +194,7 @@ table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
}
return relation->rd_tableam->scan_begin(relation, snapshot, 0, NULL,
- parallel_scan, flags);
+ pscan, flags);
}
diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c
index bbb542b32..6db9a1fca 100644
--- a/src/backend/access/transam/generic_xlog.c
+++ b/src/backend/access/transam/generic_xlog.c
@@ -69,7 +69,7 @@ struct GenericXLogState
};
static void writeFragment(PageData *pageData, OffsetNumber offset,
- OffsetNumber len, const char *data);
+ OffsetNumber length, const char *data);
static void computeRegionDelta(PageData *pageData,
const char *curpage, const char *targetpage,
int targetStart, int targetEnd,
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index ec57f56ad..a7383f553 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1214,14 +1214,14 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
* range, that is, greater to or equal than oldestMultiXactId, and less than
* nextMXact. Otherwise, an error is raised.
*
- * onlyLock must be set to true if caller is certain that the given multi
+ * isLockOnly must be set to true if caller is certain that the given multi
* is used only to lock tuples; can be false without loss of correctness,
* but passing a true means we can return quickly without checking for
* old updates.
*/
int
GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
- bool from_pgupgrade, bool onlyLock)
+ bool from_pgupgrade, bool isLockOnly)
{
int pageno;
int prev_pageno;
@@ -1263,7 +1263,7 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
* we can skip checking if the value is older than our oldest visible
* multi. It cannot possibly still be running.
*/
- if (onlyLock &&
+ if (isLockOnly &&
MultiXactIdPrecedes(multi, OldestVisibleMXactId[MyBackendId]))
{
debug_elog2(DEBUG2, "GetMembers: a locker-only multi is too old");
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 50f092d7e..5eec4df47 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -354,7 +354,7 @@ static void AtSubStart_Memory(void);
static void AtSubStart_ResourceOwner(void);
static void ShowTransactionState(const char *str);
-static void ShowTransactionStateRec(const char *str, TransactionState state);
+static void ShowTransactionStateRec(const char *str, TransactionState s);
static const char *BlockStateAsString(TBlockState blockState);
static const char *TransStateAsString(TransState state);
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 81d339d57..eb0430fe9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -648,7 +648,7 @@ static void XLogReportParameters(void);
static int LocalSetXLogInsertAllowed(void);
static void CreateEndOfRecoveryRecord(void);
static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn,
- XLogRecPtr missingContrecPtr,
+ XLogRecPtr pagePtr,
TimeLineID newTLI);
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo);
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index c4fbc37c7..c2d4ab271 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -47,7 +47,7 @@ static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
int reqLen);
static void XLogReaderInvalReadState(XLogReaderState *state);
-static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool non_blocking);
+static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index b20974bbe..6c7b05847 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -104,17 +104,17 @@ typedef struct
bool binary_upgrade_record_init_privs = false;
static void ExecGrantStmt_oids(InternalGrant *istmt);
-static void ExecGrant_Relation(InternalGrant *grantStmt);
-static void ExecGrant_Database(InternalGrant *grantStmt);
-static void ExecGrant_Fdw(InternalGrant *grantStmt);
-static void ExecGrant_ForeignServer(InternalGrant *grantStmt);
-static void ExecGrant_Function(InternalGrant *grantStmt);
-static void ExecGrant_Language(InternalGrant *grantStmt);
-static void ExecGrant_Largeobject(InternalGrant *grantStmt);
-static void ExecGrant_Namespace(InternalGrant *grantStmt);
-static void ExecGrant_Tablespace(InternalGrant *grantStmt);
-static void ExecGrant_Type(InternalGrant *grantStmt);
-static void ExecGrant_Parameter(InternalGrant *grantStmt);
+static void ExecGrant_Relation(InternalGrant *istmt);
+static void ExecGrant_Database(InternalGrant *istmt);
+static void ExecGrant_Fdw(InternalGrant *istmt);
+static void ExecGrant_ForeignServer(InternalGrant *istmt);
+static void ExecGrant_Function(InternalGrant *istmt);
+static void ExecGrant_Language(InternalGrant *istmt);
+static void ExecGrant_Largeobject(InternalGrant *istmt);
+static void ExecGrant_Namespace(InternalGrant *istmt);
+static void ExecGrant_Tablespace(InternalGrant *istmt);
+static void ExecGrant_Type(InternalGrant *istmt);
+static void ExecGrant_Parameter(InternalGrant *istmt);
static void SetDefaultACLsInSchemas(InternalDefaultACL *iacls, List *nspnames);
static void SetDefaultACL(InternalDefaultACL *iacls);
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 6ff48bb18..b5cb21fe5 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -125,9 +125,9 @@ static bool have_createdb_privilege(void);
static void remove_dbtablespaces(Oid db_id);
static bool check_db_file_conflict(Oid db_id);
static int errdetail_busy_db(int notherbackends, int npreparedxacts);
-static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dboid, Oid src_tsid,
+static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
Oid dst_tsid);
-static List *ScanSourceDatabasePgClass(Oid srctbid, Oid srcdbid, char *srcpath);
+static List *ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath);
static List *ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid,
Oid dbid, char *srcpath,
List *rlocatorlist, Snapshot snapshot);
@@ -136,8 +136,8 @@ static CreateDBRelInfo *ScanSourceDatabasePgClassTuple(HeapTupleData *tuple,
char *srcpath);
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid,
bool isRedo);
-static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dboid, Oid src_tsid,
- Oid dst_tsid);
+static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
+ Oid src_tsid, Oid dst_tsid);
static void recovery_create_dbdir(char *path, bool only_tblspc);
/*
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 635d05405..441f29d68 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -94,7 +94,7 @@ static void AlterEventTriggerOwner_internal(Relation rel,
static void error_duplicate_filter_variable(const char *defname);
static Datum filter_list_to_array(List *filterlist);
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
- Oid evtOwner, Oid funcoid, List *tags);
+ Oid evtOwner, Oid funcoid, List *taglist);
static void validate_ddl_tags(const char *filtervar, List *taglist);
static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 053d2ca5a..f86983c66 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -111,7 +111,7 @@ static void show_incremental_sort_info(IncrementalSortState *incrsortstate,
static void show_hash_info(HashState *hashstate, ExplainState *es);
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
ExplainState *es);
-static void show_hashagg_info(AggState *hashstate, ExplainState *es);
+static void show_hashagg_info(AggState *aggstate, ExplainState *es);
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
ExplainState *es);
static void show_instrumentation_count(const char *qlabel, int which,
diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c
index b97b8b043..b0747ce29 100644
--- a/src/backend/commands/lockcmds.c
+++ b/src/backend/commands/lockcmds.c
@@ -29,7 +29,7 @@
#include "utils/syscache.h"
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait);
-static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
+static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid);
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid,
Oid oldrelid, void *arg);
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index a583aa430..134610497 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -285,16 +285,16 @@ RenameSchema(const char *oldname, const char *newname)
}
void
-AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
+AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId)
{
HeapTuple tup;
Relation rel;
rel = table_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
+ tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(schemaoid));
if (!HeapTupleIsValid(tup))
- elog(ERROR, "cache lookup failed for schema %u", oid);
+ elog(ERROR, "cache lookup failed for schema %u", schemaoid);
AlterSchemaOwner_internal(tup, rel, newOwnerId);
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e3233a8f3..6c52edd9b 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -550,7 +550,7 @@ static ObjectAddress ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
AlterTableCmd *cmd, LOCKMODE lockmode);
static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab);
static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab);
-static void RememberStatisticsForRebuilding(Oid indoid, AlteredTableInfo *tab);
+static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab);
static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab,
LOCKMODE lockmode);
static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
@@ -610,7 +610,7 @@ static void ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partPa
List **partexprs, Oid *partopclass, Oid *partcollation, char strategy);
static void CreateInheritance(Relation child_rel, Relation parent_rel);
static void RemoveInheritance(Relation child_rel, Relation parent_rel,
- bool allow_detached);
+ bool expect_detached);
static ObjectAddress ATExecAttachPartition(List **wqueue, Relation rel,
PartitionCmd *cmd,
AlterTableUtilityContext *context);
@@ -627,7 +627,7 @@ static ObjectAddress ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab,
static void DetachPartitionFinalize(Relation rel, Relation partRel,
bool concurrent, Oid defaultPartOid);
static ObjectAddress ATExecDetachPartitionFinalize(Relation rel, RangeVar *name);
-static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation rel,
+static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
RangeVar *name);
static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 5ad18d2de..6f5a5262c 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -86,8 +86,8 @@ static bool GetTupleForTrigger(EState *estate,
ItemPointer tid,
LockTupleMode lockmode,
TupleTableSlot *oldslot,
- TupleTableSlot **newSlot,
- TM_FailureData *tmfpd);
+ TupleTableSlot **epqslot,
+ TM_FailureData *tmfdp);
static bool TriggerEnabled(EState *estate, ResultRelInfo *relinfo,
Trigger *trigger, TriggerEvent event,
Bitmapset *modifiedCols,
@@ -101,7 +101,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
ResultRelInfo *src_partinfo,
ResultRelInfo *dst_partinfo,
int event, bool row_trigger,
- TupleTableSlot *oldtup, TupleTableSlot *newtup,
+ TupleTableSlot *oldslot, TupleTableSlot *newslot,
List *recheckIndexes, Bitmapset *modifiedCols,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
@@ -3871,7 +3871,7 @@ static void TransitionTableAddTuple(EState *estate,
Tuplestorestate *tuplestore);
static void AfterTriggerFreeQuery(AfterTriggersQueryData *qs);
static SetConstraintState SetConstraintStateCreate(int numalloc);
-static SetConstraintState SetConstraintStateCopy(SetConstraintState state);
+static SetConstraintState SetConstraintStateCopy(SetConstraintState origstate);
static SetConstraintState SetConstraintStateAddItem(SetConstraintState state,
Oid tgoid, bool tgisdeferred);
static void cancel_prior_stmt_triggers(Oid relid, CmdType cmdType, int tgevent);
diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c
index 6a8735edf..1f1181b56 100644
--- a/src/backend/executor/execIndexing.c
+++ b/src/backend/executor/execIndexing.c
@@ -130,7 +130,7 @@ static bool check_exclusion_or_unique_constraint(Relation heap, Relation index,
Datum *values, bool *isnull,
EState *estate, bool newIndex,
CEOUC_WAIT_MODE waitMode,
- bool errorOK,
+ bool violationOK,
ItemPointer conflictTid);
static bool index_recheck_constraint(Relation index, Oid *constr_procs,
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index f1fd7f7e8..99512826c 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -126,9 +126,9 @@ typedef struct ExecParallelInitializeDSMContext
/* Helper functions that run in the parallel leader. */
static char *ExecSerializePlan(Plan *plan, EState *estate);
-static bool ExecParallelEstimate(PlanState *node,
+static bool ExecParallelEstimate(PlanState *planstate,
ExecParallelEstimateContext *e);
-static bool ExecParallelInitializeDSM(PlanState *node,
+static bool ExecParallelInitializeDSM(PlanState *planstate,
ExecParallelInitializeDSMContext *d);
static shm_mq_handle **ExecParallelSetupTupleQueues(ParallelContext *pcxt,
bool reinitialize);
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 933c30490..fe74e4981 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -396,7 +396,7 @@ static void prepare_projection_slot(AggState *aggstate,
TupleTableSlot *slot,
int currentSet);
static void finalize_aggregates(AggState *aggstate,
- AggStatePerAgg peragg,
+ AggStatePerAgg peraggs,
AggStatePerGroup pergroup);
static TupleTableSlot *project_aggregates(AggState *aggstate);
static void find_cols(AggState *aggstate, Bitmapset **aggregated,
@@ -407,12 +407,11 @@ static void build_hash_table(AggState *aggstate, int setno, long nbuckets);
static void hashagg_recompile_expressions(AggState *aggstate, bool minslot,
bool nullcheck);
static long hash_choose_num_buckets(double hashentrysize,
- long estimated_nbuckets,
- Size memory);
+ long ngroups, Size memory);
static int hash_choose_num_partitions(double input_groups,
double hashentrysize,
int used_bits,
- int *log2_npartittions);
+ int *log2_npartitions);
static void initialize_hash_entry(AggState *aggstate,
TupleHashTable hashtable,
TupleHashEntry entry);
@@ -432,11 +431,11 @@ static HashAggBatch *hashagg_batch_new(LogicalTape *input_tape, int setno,
int64 input_tuples, double input_card,
int used_bits);
static MinimalTuple hashagg_batch_read(HashAggBatch *batch, uint32 *hashp);
-static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *lts,
+static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *tapeset,
int used_bits, double input_groups,
double hashentrysize);
static Size hashagg_spill_tuple(AggState *aggstate, HashAggSpill *spill,
- TupleTableSlot *slot, uint32 hash);
+ TupleTableSlot *inputslot, uint32 hash);
static void hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill,
int setno);
static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 77dd1dae8..6622b202c 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -62,9 +62,9 @@ static HashJoinTuple ExecParallelHashTupleAlloc(HashJoinTable hashtable,
dsa_pointer *shared);
static void MultiExecPrivateHash(HashState *node);
static void MultiExecParallelHash(HashState *node);
-static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable hashtable,
int bucketno);
-static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable hashtable,
HashJoinTuple tuple);
static inline void ExecParallelHashPushTuple(dsa_pointer_atomic *head,
HashJoinTuple tuple,
@@ -73,7 +73,7 @@ static void ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch
static void ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable);
static void ExecParallelHashRepartitionFirst(HashJoinTable hashtable);
static void ExecParallelHashRepartitionRest(HashJoinTable hashtable);
-static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable table,
+static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable hashtable,
dsa_pointer *shared);
static bool ExecParallelHashTuplePrealloc(HashJoinTable hashtable,
int batchno,
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 87403e247..2718c2113 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -145,7 +145,7 @@ static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
TupleTableSlot *tupleSlot);
static bool ExecHashJoinNewBatch(HashJoinState *hjstate);
static bool ExecParallelHashJoinNewBatch(HashJoinState *hjstate);
-static void ExecParallelHashJoinPartitionOuter(HashJoinState *node);
+static void ExecParallelHashJoinPartitionOuter(HashJoinState *hjstate);
/* ----------------------------------------------------------------
@@ -1502,11 +1502,11 @@ ExecHashJoinInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
* ----------------------------------------------------------------
*/
void
-ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt)
+ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
{
int plan_node_id = state->js.ps.plan->plan_node_id;
ParallelHashJoinState *pstate =
- shm_toc_lookup(cxt->toc, plan_node_id, false);
+ shm_toc_lookup(pcxt->toc, plan_node_id, false);
/*
* It would be possible to reuse the shared hash table in single-batch
diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index d1b97d46b..972e024db 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -1229,10 +1229,10 @@ ExecIncrementalSortInitializeDSM(IncrementalSortState *node, ParallelContext *pc
* ----------------------------------------------------------------
*/
void
-ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pwcxt)
+ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pcxt)
{
node->shared_info =
- shm_toc_lookup(pwcxt->toc, node->ss.ps.plan->plan_node_id, true);
+ shm_toc_lookup(pcxt->toc, node->ss.ps.plan->plan_node_id, true);
node->am_worker = true;
}
diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c
index d2bceb97c..7bfe02464 100644
--- a/src/backend/executor/nodeMemoize.c
+++ b/src/backend/executor/nodeMemoize.c
@@ -133,8 +133,8 @@ typedef struct MemoizeEntry
static uint32 MemoizeHash_hash(struct memoize_hash *tb,
const MemoizeKey *key);
static bool MemoizeHash_equal(struct memoize_hash *tb,
- const MemoizeKey *params1,
- const MemoizeKey *params2);
+ const MemoizeKey *key1,
+ const MemoizeKey *key2);
#define SH_PREFIX memoize
#define SH_ELEMENT_TYPE MemoizeEntry
diff --git a/src/backend/lib/bloomfilter.c b/src/backend/lib/bloomfilter.c
index 465ca7cf6..3ef67d35a 100644
--- a/src/backend/lib/bloomfilter.c
+++ b/src/backend/lib/bloomfilter.c
@@ -55,7 +55,7 @@ static int my_bloom_power(uint64 target_bitset_bits);
static int optimal_k(uint64 bitset_bits, int64 total_elems);
static void k_hashes(bloom_filter *filter, uint32 *hashes, unsigned char *elem,
size_t len);
-static inline uint32 mod_m(uint32 a, uint64 m);
+static inline uint32 mod_m(uint32 val, uint64 m);
/*
* Create Bloom filter in caller's memory context. We aim for a false positive
diff --git a/src/backend/lib/integerset.c b/src/backend/lib/integerset.c
index 41d3abdb0..345cd1b3a 100644
--- a/src/backend/lib/integerset.c
+++ b/src/backend/lib/integerset.c
@@ -264,9 +264,9 @@ static void intset_update_upper(IntegerSet *intset, int level,
intset_node *child, uint64 child_key);
static void intset_flush_buffered_values(IntegerSet *intset);
-static int intset_binsrch_uint64(uint64 value, uint64 *arr, int arr_elems,
+static int intset_binsrch_uint64(uint64 item, uint64 *arr, int arr_elems,
bool nextkey);
-static int intset_binsrch_leaf(uint64 value, leaf_item *arr, int arr_elems,
+static int intset_binsrch_leaf(uint64 item, leaf_item *arr, int arr_elems,
bool nextkey);
static uint64 simple8b_encode(const uint64 *ints, int *num_encoded, uint64 base);
diff --git a/src/backend/optimizer/geqo/geqo_selection.c b/src/backend/optimizer/geqo/geqo_selection.c
index 50f678a49..fd3f6894d 100644
--- a/src/backend/optimizer/geqo/geqo_selection.c
+++ b/src/backend/optimizer/geqo/geqo_selection.c
@@ -42,7 +42,7 @@
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_selection.h"
-static int linear_rand(PlannerInfo *root, int max, double bias);
+static int linear_rand(PlannerInfo *root, int pool_size, double bias);
/*
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 5012bfe14..6d5718ee4 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -75,7 +75,8 @@ static List *build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
static List *get_relation_statistics(RelOptInfo *rel, Relation relation);
static void set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
Relation relation);
-static PartitionScheme find_partition_scheme(PlannerInfo *root, Relation rel);
+static PartitionScheme find_partition_scheme(PlannerInfo *root,
+ Relation relation);
static void set_baserel_partition_key_exprs(Relation relation,
RelOptInfo *rel);
static void set_baserel_partition_constraint(Relation relation,
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index ea3378431..581a6cbf8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -205,8 +205,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args,
static List *mergeTableFuncParameters(List *func_args, List *columns);
static TypeName *TableFuncTypeName(List *columns);
static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner);
-static RangeVar *makeRangeVarFromQualifiedName(char *name, List *rels,
- int location,
+static RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location,
core_yyscan_t yyscanner);
static void SplitColQualList(List *qualList,
List **constraintList, CollateClause **collClause,
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 061d0bcc5..202a38f81 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -67,7 +67,7 @@ static ParseNamespaceItem *transformRangeSubselect(ParseState *pstate,
static ParseNamespaceItem *transformRangeFunction(ParseState *pstate,
RangeFunction *r);
static ParseNamespaceItem *transformRangeTableFunc(ParseState *pstate,
- RangeTableFunc *t);
+ RangeTableFunc *rtf);
static TableSampleClause *transformRangeTableSample(ParseState *pstate,
RangeTableSample *rts);
static ParseNamespaceItem *getNSItemForSpecialRelationTypes(ParseState *pstate,
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 6d283006e..bd068bba0 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -139,7 +139,7 @@ static void transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd);
static List *transformPartitionRangeBounds(ParseState *pstate, List *blist,
Relation parent);
static void validateInfiniteBounds(ParseState *pstate, List *blist);
-static Const *transformPartitionBoundValue(ParseState *pstate, Node *con,
+static Const *transformPartitionBoundValue(ParseState *pstate, Node *val,
const char *colName, Oid colType, int32 colTypmod,
Oid partCollation);
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 57c9b5181..7f74ed212 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -104,7 +104,7 @@ static PartitionBoundInfo create_list_bounds(PartitionBoundSpec **boundspecs,
static PartitionBoundInfo create_range_bounds(PartitionBoundSpec **boundspecs,
int nparts, PartitionKey key, int **mapping);
static PartitionBoundInfo merge_list_bounds(FmgrInfo *partsupfunc,
- Oid *collations,
+ Oid *partcollation,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel,
JoinType jointype,
@@ -123,8 +123,8 @@ static void free_partition_map(PartitionMap *map);
static bool is_dummy_partition(RelOptInfo *rel, int part_index);
static int merge_matching_partitions(PartitionMap *outer_map,
PartitionMap *inner_map,
- int outer_part,
- int inner_part,
+ int outer_index,
+ int inner_index,
int *next_index);
static int process_outer_partition(PartitionMap *outer_map,
PartitionMap *inner_map,
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index de1184ad7..383bc4776 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -414,7 +414,7 @@ static void report_fork_failure_to_client(Port *port, int errnum);
static CAC_state canAcceptConnections(int backend_type);
static bool RandomCancelKey(int32 *cancel_key);
static void signal_child(pid_t pid, int signal);
-static bool SignalSomeChildren(int signal, int targets);
+static bool SignalSomeChildren(int signal, int target);
static void TerminateChildren(int signal);
#define SignalChildren(sig) SignalSomeChildren(sig, BACKEND_TYPE_ALL)
@@ -2598,9 +2598,9 @@ ConnCreate(int serverFd)
* to do here.
*/
static void
-ConnFree(Port *conn)
+ConnFree(Port *port)
{
- free(conn);
+ free(port);
}
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 89cf9f938..7d41aabd5 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -250,7 +250,7 @@ static void ReorderBufferSerializeChange(ReorderBuffer *rb, ReorderBufferTXN *tx
static Size ReorderBufferRestoreChanges(ReorderBuffer *rb, ReorderBufferTXN *txn,
TXNEntryFile *file, XLogSegNo *segno);
static void ReorderBufferRestoreChange(ReorderBuffer *rb, ReorderBufferTXN *txn,
- char *change);
+ char *data);
static void ReorderBufferRestoreCleanup(ReorderBuffer *rb, ReorderBufferTXN *txn);
static void ReorderBufferTruncateTXN(ReorderBuffer *rb, ReorderBufferTXN *txn,
bool txn_prepared);
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 62e0ffecd..03b13ae67 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -44,7 +44,7 @@ static void pgoutput_begin_txn(LogicalDecodingContext *ctx,
static void pgoutput_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pgoutput_change(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, Relation rel,
+ ReorderBufferTXN *txn, Relation relation,
ReorderBufferChange *change);
static void pgoutput_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, int nrelations, Relation relations[],
@@ -212,7 +212,7 @@ typedef struct PGOutputTxnData
/* Map used to remember which relation schemas we sent. */
static HTAB *RelationSyncCache = NULL;
-static void init_rel_sync_cache(MemoryContext decoding_context);
+static void init_rel_sync_cache(MemoryContext cachectx);
static void cleanup_rel_sync_cache(TransactionId xid, bool is_commit);
static RelationSyncEntry *get_rel_sync_entry(PGOutputData *data,
Relation relation);
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 8fec1cb4a..0bd003118 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -108,7 +108,7 @@ static void ReplicationSlotDropPtr(ReplicationSlot *slot);
/* internal persistency functions */
static void RestoreSlotFromDisk(const char *name);
static void CreateSlotOnDisk(ReplicationSlot *slot);
-static void SaveSlotToPath(ReplicationSlot *slot, const char *path, int elevel);
+static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel);
/*
* Report shared-memory space needed by ReplicationSlotsShmemInit.
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index ee05e230e..ab97e71dd 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -83,7 +83,7 @@ static void statext_store(Oid statOid, bool inh,
MVNDistinct *ndistinct, MVDependencies *dependencies,
MCVList *mcv, Datum exprs, VacAttrStats **stats);
static int statext_compute_stattarget(int stattarget,
- int natts, VacAttrStats **stats);
+ int nattrs, VacAttrStats **stats);
/* Information needed to analyze a single simple expression. */
typedef struct AnlExprData
@@ -99,7 +99,7 @@ static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs);
static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
static AnlExprData *build_expr_data(List *exprs, int stattarget);
-static StatsBuildData *make_build_data(Relation onerel, StatExtEntry *stat,
+static StatsBuildData *make_build_data(Relation rel, StatExtEntry *stat,
int numrows, HeapTuple *rows,
VacAttrStats **stats, int stattarget);
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e898ffad7..5b0e531f9 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -459,7 +459,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
)
-static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence,
+static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence,
ForkNumber forkNum, BlockNumber blockNum,
ReadBufferMode mode, BufferAccessStrategy strategy,
bool *hit);
@@ -493,7 +493,7 @@ static void RelationCopyStorageUsingBuffer(RelFileLocator srclocator,
static void AtProcExit_Buffers(int code, Datum arg);
static void CheckForBufferLeaks(void);
static int rlocator_comparator(const void *p1, const void *p2);
-static inline int buffertag_comparator(const BufferTag *a, const BufferTag *b);
+static inline int buffertag_comparator(const BufferTag *ba, const BufferTag *bb);
static inline int ckpt_buforder_comparator(const CkptSortItem *a, const CkptSortItem *b);
static int ts_ckpt_progress_comparator(Datum a, Datum b, void *arg);
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index 562ac5b43..5f2a4805d 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -446,7 +446,7 @@ static void SerialSetActiveSerXmin(TransactionId xid);
static uint32 predicatelock_hash(const void *key, Size keysize);
static void SummarizeOldestCommittedSxact(void);
-static Snapshot GetSafeSnapshot(Snapshot snapshot);
+static Snapshot GetSafeSnapshot(Snapshot origSnapshot);
static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot,
VirtualTransactionId *sourcevxid,
int sourcepid);
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 3deac496e..9939e6aee 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -121,7 +121,7 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */
/* local routines */
-static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum,
+static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum,
bool isRedo);
static MdfdVec *mdopenfork(SMgrRelation reln, ForkNumber forknum, int behavior);
static void register_dirty_segment(SMgrRelation reln, ForkNumber forknum,
@@ -135,9 +135,9 @@ static void _fdvec_resize(SMgrRelation reln,
int nseg);
static char *_mdfd_segpath(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno);
-static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno, int oflags);
-static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber blkno, bool skipFsync, int behavior);
static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum,
MdfdVec *seg);
@@ -179,16 +179,16 @@ mdexists(SMgrRelation reln, ForkNumber forkNum)
* If isRedo is true, it's okay for the relation to exist already.
*/
void
-mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
+mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
{
MdfdVec *mdfd;
char *path;
File fd;
- if (isRedo && reln->md_num_open_segs[forkNum] > 0)
+ if (isRedo && reln->md_num_open_segs[forknum] > 0)
return; /* created and opened already... */
- Assert(reln->md_num_open_segs[forkNum] == 0);
+ Assert(reln->md_num_open_segs[forknum] == 0);
/*
* We may be using the target table space for the first time in this
@@ -203,7 +203,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
reln->smgr_rlocator.locator.dbOid,
isRedo);
- path = relpath(reln->smgr_rlocator, forkNum);
+ path = relpath(reln->smgr_rlocator, forknum);
fd = PathNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
@@ -225,8 +225,8 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
pfree(path);
- _fdvec_resize(reln, forkNum, 1);
- mdfd = &reln->md_seg_fds[forkNum][0];
+ _fdvec_resize(reln, forknum, 1);
+ mdfd = &reln->md_seg_fds[forknum][0];
mdfd->mdfd_vfd = fd;
mdfd->mdfd_segno = 0;
}
@@ -237,7 +237,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
* Note that we're passed a RelFileLocatorBackend --- by the time this is called,
* there won't be an SMgrRelation hashtable entry anymore.
*
- * forkNum can be a fork number to delete a specific fork, or InvalidForkNumber
+ * forknum can be a fork number to delete a specific fork, or InvalidForkNumber
* to delete all forks.
*
* For regular relations, we don't unlink the first segment file of the rel,
@@ -278,16 +278,16 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
* we are usually not in a transaction anymore when this is called.
*/
void
-mdunlink(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
/* Now do the per-fork work */
- if (forkNum == InvalidForkNumber)
+ if (forknum == InvalidForkNumber)
{
- for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++)
- mdunlinkfork(rlocator, forkNum, isRedo);
+ for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
+ mdunlinkfork(rlocator, forknum, isRedo);
}
else
- mdunlinkfork(rlocator, forkNum, isRedo);
+ mdunlinkfork(rlocator, forknum, isRedo);
}
/*
@@ -315,18 +315,18 @@ do_truncate(const char *path)
}
static void
-mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
char *path;
int ret;
BlockNumber segno = 0;
- path = relpath(rlocator, forkNum);
+ path = relpath(rlocator, forknum);
/*
* Delete or truncate the first segment.
*/
- if (isRedo || forkNum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
+ if (isRedo || forknum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
{
if (!RelFileLocatorBackendIsTemp(rlocator))
{
@@ -334,7 +334,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
ret = do_truncate(path);
/* Forget any pending sync requests for the first segment */
- register_forget_request(rlocator, forkNum, 0 /* first seg */ );
+ register_forget_request(rlocator, forknum, 0 /* first seg */ );
}
else
ret = 0;
@@ -367,7 +367,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
*/
if (!IsBinaryUpgrade)
{
- register_unlink_segment(rlocator, forkNum, 0 /* first seg */ );
+ register_unlink_segment(rlocator, forknum, 0 /* first seg */ );
++segno;
}
}
@@ -403,7 +403,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
* Forget any pending sync requests for this segment before we
* try to unlink.
*/
- register_forget_request(rlocator, forkNum, segno);
+ register_forget_request(rlocator, forknum, segno);
}
if (unlink(segpath) < 0)
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 43fff50d4..350039cc8 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -32,7 +32,7 @@
#include "utils/memutils.h"
#include "utils/tzparser.h"
-static int DecodeNumber(int flen, char *field, bool haveTextMonth,
+static int DecodeNumber(int flen, char *str, bool haveTextMonth,
int fmask, int *tmask,
struct pg_tm *tm, fsec_t *fsec, bool *is2digits);
static int DecodeNumberField(int len, char *str,
@@ -281,26 +281,26 @@ static const datetkn *abbrevcache[MAXDATEFIELDS] = {NULL};
*/
int
-date2j(int y, int m, int d)
+date2j(int year, int month, int day)
{
int julian;
int century;
- if (m > 2)
+ if (month > 2)
{
- m += 1;
- y += 4800;
+ month += 1;
+ year += 4800;
}
else
{
- m += 13;
- y += 4799;
+ month += 13;
+ year += 4799;
}
- century = y / 100;
- julian = y * 365 - 32167;
- julian += y / 4 - century + century / 4;
- julian += 7834 * m / 256 + d;
+ century = year / 100;
+ julian = year * 365 - 32167;
+ julian += year / 4 - century + century / 4;
+ julian += 7834 * month / 256 + day;
return julian;
} /* date2j() */
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f1b632ef3..d78002b90 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -90,7 +90,7 @@ static inline float8 line_sl(LINE *line);
static inline float8 line_invsl(LINE *line);
static bool line_interpt_line(Point *result, LINE *l1, LINE *l2);
static bool line_contain_point(LINE *line, Point *point);
-static float8 line_closept_point(Point *result, LINE *line, Point *pt);
+static float8 line_closept_point(Point *result, LINE *line, Point *point);
/* Routines for line segments */
static inline void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
@@ -98,8 +98,8 @@ static inline float8 lseg_sl(LSEG *lseg);
static inline float8 lseg_invsl(LSEG *lseg);
static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line);
static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2);
-static int lseg_crossing(float8 x, float8 y, float8 px, float8 py);
-static bool lseg_contain_point(LSEG *lseg, Point *point);
+static int lseg_crossing(float8 x, float8 y, float8 prev_x, float8 prev_y);
+static bool lseg_contain_point(LSEG *lseg, Point *pt);
static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt);
static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line);
static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg);
@@ -115,7 +115,7 @@ static bool box_contain_point(BOX *box, Point *point);
static bool box_contain_box(BOX *contains_box, BOX *contained_box);
static bool box_contain_lseg(BOX *box, LSEG *lseg);
static bool box_interpt_lseg(Point *result, BOX *box, LSEG *lseg);
-static float8 box_closept_point(Point *result, BOX *box, Point *point);
+static float8 box_closept_point(Point *result, BOX *box, Point *pt);
static float8 box_closept_lseg(Point *result, BOX *box, LSEG *lseg);
/* Routines for circles */
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c
index 60442758b..e5cc4c945 100644
--- a/src/backend/utils/adt/jsonb_util.c
+++ b/src/backend/utils/adt/jsonb_util.c
@@ -57,14 +57,15 @@ static short padBufferToInt(StringInfo buffer);
static JsonbIterator *iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent);
static JsonbIterator *freeAndGetParent(JsonbIterator *it);
static JsonbParseState *pushState(JsonbParseState **pstate);
-static void appendKey(JsonbParseState *pstate, JsonbValue *scalarVal);
+static void appendKey(JsonbParseState *pstate, JsonbValue *string);
static void appendValue(JsonbParseState *pstate, JsonbValue *scalarVal);
static void appendElement(JsonbParseState *pstate, JsonbValue *scalarVal);
static int lengthCompareJsonbStringValue(const void *a, const void *b);
static int lengthCompareJsonbString(const char *val1, int len1,
const char *val2, int len2);
-static int lengthCompareJsonbPair(const void *a, const void *b, void *arg);
-static void uniqueifyJsonbObject(JsonbValue *object);
+static int lengthCompareJsonbPair(const void *a, const void *b, void *binequal);
+static void uniqueifyJsonbObject(JsonbValue *object, bool unique_keys,
+ bool skip_nulls);
static JsonbValue *pushJsonbValueScalar(JsonbParseState **pstate,
JsonbIteratorToken seq,
JsonbValue *scalarVal);
@@ -1394,22 +1395,22 @@ JsonbHashScalarValueExtended(const JsonbValue *scalarVal, uint64 *hash,
* Are two scalar JsonbValues of the same type a and b equal?
*/
static bool
-equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+equalsJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return true;
case jbvString:
- return lengthCompareJsonbStringValue(aScalar, bScalar) == 0;
+ return lengthCompareJsonbStringValue(a, b) == 0;
case jbvNumeric:
return DatumGetBool(DirectFunctionCall2(numeric_eq,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- return aScalar->val.boolean == bScalar->val.boolean;
+ return a->val.boolean == b->val.boolean;
default:
elog(ERROR, "invalid jsonb scalar type");
@@ -1426,28 +1427,28 @@ equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
* operators, where a lexical sort order is generally expected.
*/
static int
-compareJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+compareJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return 0;
case jbvString:
- return varstr_cmp(aScalar->val.string.val,
- aScalar->val.string.len,
- bScalar->val.string.val,
- bScalar->val.string.len,
+ return varstr_cmp(a->val.string.val,
+ a->val.string.len,
+ b->val.string.val,
+ b->val.string.len,
DEFAULT_COLLATION_OID);
case jbvNumeric:
return DatumGetInt32(DirectFunctionCall2(numeric_cmp,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- if (aScalar->val.boolean == bScalar->val.boolean)
+ if (a->val.boolean == b->val.boolean)
return 0;
- else if (aScalar->val.boolean > bScalar->val.boolean)
+ else if (a->val.boolean > b->val.boolean)
return 1;
else
return -1;
@@ -1608,13 +1609,13 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
}
static void
-convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbArray(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerhead;
int nElems = val->val.array.nElems;
/* Remember where in the buffer this array starts. */
@@ -1627,15 +1628,15 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nElems | JB_FARRAY;
+ containerhead = nElems | JB_FARRAY;
if (val->val.array.rawScalar)
{
Assert(nElems == 1);
Assert(level == 0);
- header |= JB_FSCALAR;
+ containerhead |= JB_FSCALAR;
}
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ appendToBuffer(buffer, (char *) &containerhead, sizeof(uint32));
/* Reserve space for the JEntries of the elements. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nElems);
@@ -1688,17 +1689,17 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbObject(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerheader;
int nPairs = val->val.object.nPairs;
/* Remember where in the buffer this object starts. */
@@ -1711,8 +1712,8 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nPairs | JB_FOBJECT;
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ containerheader = nPairs | JB_FOBJECT;
+ appendToBuffer(buffer, (char *) &containerheader, sizeof(uint32));
/* Reserve space for the JEntries of the keys and values. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nPairs * 2);
@@ -1804,11 +1805,11 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
+convertJsonbScalar(StringInfo buffer, JEntry *header, JsonbValue *scalarVal)
{
int numlen;
short padlen;
@@ -1816,13 +1817,13 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
switch (scalarVal->type)
{
case jbvNull:
- *jentry = JENTRY_ISNULL;
+ *header = JENTRY_ISNULL;
break;
case jbvString:
appendToBuffer(buffer, scalarVal->val.string.val, scalarVal->val.string.len);
- *jentry = scalarVal->val.string.len;
+ *header = scalarVal->val.string.len;
break;
case jbvNumeric:
@@ -1831,11 +1832,11 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
appendToBuffer(buffer, (char *) scalarVal->val.numeric, numlen);
- *jentry = JENTRY_ISNUMERIC | (padlen + numlen);
+ *header = JENTRY_ISNUMERIC | (padlen + numlen);
break;
case jbvBool:
- *jentry = (scalarVal->val.boolean) ?
+ *header = (scalarVal->val.boolean) ?
JENTRY_ISBOOL_TRUE : JENTRY_ISBOOL_FALSE;
break;
@@ -1851,7 +1852,7 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
len = strlen(buf);
appendToBuffer(buffer, buf, len);
- *jentry = len;
+ *header = len;
}
break;
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 9f4192e07..9abc0c062 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -225,7 +225,7 @@ static JsonPathExecResult appendBoolResult(JsonPathExecContext *cxt,
static void getJsonPathItem(JsonPathExecContext *cxt, JsonPathItem *item,
JsonbValue *value);
static void getJsonPathVariable(JsonPathExecContext *cxt,
- JsonPathItem *variable, Jsonb *vars, JsonbValue *value);
+ JsonPathItem *variable, JsonbValue *value);
static int JsonbArraySize(JsonbValue *jb);
static JsonPathBool executeComparison(JsonPathItem *cmp, JsonbValue *lv,
JsonbValue *rv, void *p);
@@ -252,7 +252,7 @@ static int JsonbType(JsonbValue *jb);
static JsonbValue *getScalar(JsonbValue *scalar, enum jbvType type);
static JsonbValue *wrapItemsInArray(const JsonValueList *items);
static int compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
- bool useTz, bool *have_error);
+ bool useTz, bool *cast_error);
/****************** User interface to JsonPath executor ********************/
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 920a63b00..85ee9ec42 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -499,7 +499,7 @@ static void zero_var(NumericVar *var);
static const char *set_var_from_str(const char *str, const char *cp,
NumericVar *dest);
-static void set_var_from_num(Numeric value, NumericVar *dest);
+static void set_var_from_num(Numeric num, NumericVar *dest);
static void init_var_from_num(Numeric num, NumericVar *dest);
static void set_var_from_var(const NumericVar *value, NumericVar *dest);
static char *get_str_from_var(const NumericVar *var);
@@ -510,7 +510,7 @@ static void numericvar_deserialize(StringInfo buf, NumericVar *var);
static Numeric duplicate_numeric(Numeric num);
static Numeric make_result(const NumericVar *var);
-static Numeric make_result_opt_error(const NumericVar *var, bool *error);
+static Numeric make_result_opt_error(const NumericVar *var, bool *have_error);
static void apply_typmod(NumericVar *var, int32 typmod);
static void apply_typmod_special(Numeric num, int32 typmod);
@@ -591,7 +591,7 @@ static void compute_bucket(Numeric operand, Numeric bound1, Numeric bound2,
const NumericVar *count_var, bool reversed_bounds,
NumericVar *result_var);
-static void accum_sum_add(NumericSumAccum *accum, const NumericVar *var1);
+static void accum_sum_add(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_rescale(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_carry(NumericSumAccum *accum);
static void accum_sum_reset(NumericSumAccum *accum);
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index aa4c53e0a..b09cb4905 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -55,14 +55,14 @@ typedef struct RangeIOData
static RangeIOData *get_range_io_data(FunctionCallInfo fcinfo, Oid rngtypid,
IOFuncSelector func);
static char range_parse_flags(const char *flags_str);
-static void range_parse(const char *input_str, char *flags, char **lbound_str,
+static void range_parse(const char *string, char *flags, char **lbound_str,
char **ubound_str);
static const char *range_parse_bound(const char *string, const char *ptr,
char **bound_str, bool *infinite);
static char *range_deparse(char flags, const char *lbound_str,
const char *ubound_str);
static char *range_bound_escape(const char *value);
-static Size datum_compute_size(Size sz, Datum datum, bool typbyval,
+static Size datum_compute_size(Size data_length, Datum val, bool typbyval,
char typalign, int16 typlen, char typstorage);
static Pointer datum_write(Pointer ptr, Datum datum, bool typbyval,
char typalign, int16 typlen, char typstorage);
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 51b3fdc9a..1d503e7e0 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -196,7 +196,7 @@ static void ri_GenerateQual(StringInfo buf,
Oid opoid,
const char *rightop, Oid rightoptype);
static void ri_GenerateQualCollation(StringInfo buf, Oid collation);
-static int ri_NullCheck(TupleDesc tupdesc, TupleTableSlot *slot,
+static int ri_NullCheck(TupleDesc tupDesc, TupleTableSlot *slot,
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
static void ri_BuildQueryKey(RI_QueryKey *key,
const RI_ConstraintInfo *riinfo,
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 021b760f4..9799647e1 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -2034,9 +2034,9 @@ time2t(const int hour, const int min, const int sec, const fsec_t fsec)
}
static Timestamp
-dt2local(Timestamp dt, int tz)
+dt2local(Timestamp dt, int timezone)
{
- dt -= (tz * USECS_PER_SEC);
+ dt -= (timezone * USECS_PER_SEC);
return dt;
}
diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c
index e7345e141..626656860 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -137,7 +137,7 @@ static RelMapFile pending_local_updates;
/* non-export function prototypes */
static void apply_map_update(RelMapFile *map, Oid relationId,
- RelFileNumber filenumber, bool add_okay);
+ RelFileNumber fileNumber, bool add_okay);
static void merge_map_updates(RelMapFile *map, const RelMapFile *updates,
bool add_okay);
static void load_relmap_file(bool shared, bool lock_held);
diff --git a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
index 93493d415..25791e23e 100644
--- a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
+++ b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
@@ -54,8 +54,8 @@ static int sjis2mic(const unsigned char *sjis, unsigned char *p, int len, bool n
static int mic2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_jp2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
static int mic2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int euc_jp2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int sjis2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
+static int euc_jp2sjis(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int sjis2euc_jp(const unsigned char *sjis, unsigned char *p, int len, bool noError);
Datum
euc_jp_to_sjis(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
index e00a2ca41..88e0deb5e 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
@@ -41,7 +41,7 @@ PG_FUNCTION_INFO_V1(mic_to_big5);
*/
static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError);
-static int big52euc_tw(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
diff --git a/src/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c
index a67487e5f..6e75acda2 100644
--- a/src/backend/utils/misc/queryjumble.c
+++ b/src/backend/utils/misc/queryjumble.c
@@ -45,7 +45,8 @@ int compute_query_id = COMPUTE_QUERY_ID_AUTO;
/* True when compute_query_id is ON, or AUTO and a module requests them */
bool query_id_enabled = false;
-static uint64 compute_utility_query_id(const char *str, int query_location, int query_len);
+static uint64 compute_utility_query_id(const char *query_text,
+ int query_location, int query_len);
static void AppendJumble(JumbleState *jstate,
const unsigned char *item, Size size);
static void JumbleQueryInternal(JumbleState *jstate, Query *query);
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 9b504c974..f1f2ddac1 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -680,9 +680,9 @@ FreeSnapshot(Snapshot snapshot)
* with active refcount=1. Otherwise, only increment the refcount.
*/
void
-PushActiveSnapshot(Snapshot snap)
+PushActiveSnapshot(Snapshot snapshot)
{
- PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
+ PushActiveSnapshotWithLevel(snapshot, GetCurrentTransactionNestLevel());
}
/*
@@ -694,11 +694,11 @@ PushActiveSnapshot(Snapshot snap)
* must not be deeper than the current top of the snapshot stack.
*/
void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
+PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
{
ActiveSnapshotElt *newactive;
- Assert(snap != InvalidSnapshot);
+ Assert(snapshot != InvalidSnapshot);
Assert(ActiveSnapshot == NULL || snap_level >= ActiveSnapshot->as_level);
newactive = MemoryContextAlloc(TopTransactionContext, sizeof(ActiveSnapshotElt));
@@ -707,10 +707,11 @@ PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
* Checking SecondarySnapshot is probably useless here, but it seems
* better to be sure.
*/
- if (snap == CurrentSnapshot || snap == SecondarySnapshot || !snap->copied)
- newactive->as_snap = CopySnapshot(snap);
+ if (snapshot == CurrentSnapshot || snapshot == SecondarySnapshot ||
+ !snapshot->copied)
+ newactive->as_snap = CopySnapshot(snapshot);
else
- newactive->as_snap = snap;
+ newactive->as_snap = snapshot;
newactive->as_next = ActiveSnapshot;
newactive->as_level = snap_level;
@@ -2119,20 +2120,20 @@ HistoricSnapshotGetTupleCids(void)
* SerializedSnapshotData.
*/
Size
-EstimateSnapshotSpace(Snapshot snap)
+EstimateSnapshotSpace(Snapshot snapshot)
{
Size size;
- Assert(snap != InvalidSnapshot);
- Assert(snap->snapshot_type == SNAPSHOT_MVCC);
+ Assert(snapshot != InvalidSnapshot);
+ Assert(snapshot->snapshot_type == SNAPSHOT_MVCC);
/* We allocate any XID arrays needed in the same palloc block. */
size = add_size(sizeof(SerializedSnapshotData),
- mul_size(snap->xcnt, sizeof(TransactionId)));
- if (snap->subxcnt > 0 &&
- (!snap->suboverflowed || snap->takenDuringRecovery))
+ mul_size(snapshot->xcnt, sizeof(TransactionId)));
+ if (snapshot->subxcnt > 0 &&
+ (!snapshot->suboverflowed || snapshot->takenDuringRecovery))
size = add_size(size,
- mul_size(snap->subxcnt, sizeof(TransactionId)));
+ mul_size(snapshot->subxcnt, sizeof(TransactionId)));
return size;
}
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index e00837eca..b46ee1098 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -275,7 +275,7 @@ static char *escape_quotes_bki(const char *src);
static int locale_date_order(const char *locale);
static void check_locale_name(int category, const char *locale,
char **canonname);
-static bool check_locale_encoding(const char *locale, int encoding);
+static bool check_locale_encoding(const char *locale, int user_enc);
static void setlocales(void);
static void usage(const char *progname);
void setup_pgdata(void);
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index f064cff4a..0afc79413 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -63,7 +63,7 @@ static DIR *get_destination_dir(char *dest_folder);
static void close_destination_dir(DIR *dest_dir, char *dest_folder);
static XLogRecPtr FindStreamingStart(uint32 *tli);
static void StreamLog(void);
-static bool stop_streaming(XLogRecPtr segendpos, uint32 timeline,
+static bool stop_streaming(XLogRecPtr xlogpos, uint32 timeline,
bool segment_finished);
static void
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 8638f81f3..1537ef47e 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -44,7 +44,7 @@ extern bool RunIdentifySystem(PGconn *conn, char **sysid,
extern void AppendPlainCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
- char *option_value);
+ char *option_name);
extern void AppendStringCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
char *option_name, char *option_value);
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
index 54a853bd4..e6277c463 100644
--- a/src/bin/pg_rewind/file_ops.h
+++ b/src/bin/pg_rewind/file_ops.h
@@ -17,8 +17,8 @@ extern void write_target_range(char *buf, off_t begin, size_t size);
extern void close_target_file(void);
extern void remove_target_file(const char *path, bool missing_ok);
extern void truncate_target_file(const char *path, off_t newsize);
-extern void create_target(file_entry_t *t);
-extern void remove_target(file_entry_t *t);
+extern void create_target(file_entry_t *entry);
+extern void remove_target(file_entry_t *entry);
extern void sync_target_dir(void);
extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h
index 8b4b50a33..80c276285 100644
--- a/src/bin/pg_rewind/pg_rewind.h
+++ b/src/bin/pg_rewind/pg_rewind.h
@@ -37,7 +37,7 @@ extern uint64 fetch_done;
extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
int tliIndex, XLogRecPtr endpoint,
const char *restoreCommand);
-extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
+extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
int tliIndex,
XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
XLogRecPtr *lastchkptredo,
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 53ea348e2..f18cf9712 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -23,7 +23,7 @@ static void free_db_and_rel_infos(DbInfoArr *db_arr);
static void get_db_infos(ClusterInfo *cluster);
static void get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo);
static void free_rel_infos(RelInfoArr *rel_arr);
-static void print_db_infos(DbInfoArr *dbinfo);
+static void print_db_infos(DbInfoArr *db_arr);
static void print_rel_infos(RelInfoArr *rel_arr);
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index 63d02719a..2c0d285de 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -134,7 +134,7 @@ static void verify_backup_file(verifier_context *context,
static void report_extra_backup_files(verifier_context *context);
static void verify_backup_checksums(verifier_context *context);
static void verify_file_checksum(verifier_context *context,
- manifest_file *m, char *pathname);
+ manifest_file *m, char *fullpath);
static void parse_required_wal(verifier_context *context,
char *pg_waldump_path,
char *wal_directory,
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index abbdc443a..40903bc16 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -158,10 +158,10 @@ extern char *expr_scanner_get_substring(PsqlScanState state,
extern int expr_scanner_get_lineno(PsqlScanState state, int offset);
extern void syntax_error(const char *source, int lineno, const char *line,
- const char *cmd, const char *msg,
- const char *more, int col) pg_attribute_noreturn();
+ const char *command, const char *msg,
+ const char *more, int column) pg_attribute_noreturn();
-extern bool strtoint64(const char *str, bool errorOK, int64 *pi);
-extern bool strtodouble(const char *str, bool errorOK, double *pd);
+extern bool strtoint64(const char *str, bool errorOK, int64 *result);
+extern bool strtodouble(const char *str, bool errorOK, double *dv);
#endif /* PGBENCH_H */
diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h
index 7872c71f5..bd051e09c 100644
--- a/src/bin/psql/describe.h
+++ b/src/bin/psql/describe.h
@@ -127,16 +127,16 @@ bool describeSubscriptions(const char *pattern, bool verbose);
/* \dAc */
extern bool listOperatorClasses(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAf */
extern bool listOperatorFamilies(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAo */
-extern bool listOpFamilyOperators(const char *accessMethod_pattern,
+extern bool listOpFamilyOperators(const char *access_method_pattern,
const char *family_pattern, bool verbose);
/* \dAp */
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 84a1be72f..9d91ad87c 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -18,7 +18,7 @@
extern void splitTableColumnsSpec(const char *spec, int encoding,
char **table, const char **columns);
-extern void appendQualifiedRelation(PQExpBuffer buf, const char *name,
+extern void appendQualifiedRelation(PQExpBuffer buf, const char *spec,
PGconn *conn, bool echo);
extern bool yesno_prompt(const char *question);
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 917b19e0e..746e9b4f1 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -381,7 +381,7 @@ static void closePGconn(PGconn *conn);
static void release_conn_addrinfo(PGconn *conn);
static void sendTerminateConn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
-static PQconninfoOption *parse_connection_string(const char *conninfo,
+static PQconninfoOption *parse_connection_string(const char *connstr,
PQExpBuffer errorMessage, bool use_defaults);
static int uri_prefix_length(const char *connstr);
static bool recognized_connection_string(const char *connstr);
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index bb874f7f5..ca0b184af 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2808,7 +2808,7 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* PQgetline - gets a newline-terminated string from the backend.
*
* Chiefly here so that applications can use "COPY <rel> to stdout"
- * and read the output string. Returns a null-terminated string in s.
+ * and read the output string. Returns a null-terminated string in 'string'.
*
* XXX this routine is now deprecated, because it can't handle binary data.
* If called during a COPY BINARY we return EOF.
@@ -2828,11 +2828,11 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* 1 in other cases (i.e., the buffer was filled before \n is reached)
*/
int
-PQgetline(PGconn *conn, char *s, int maxlen)
+PQgetline(PGconn *conn, char *string, int maxlen)
{
- if (!s || maxlen <= 0)
+ if (!string || maxlen <= 0)
return EOF;
- *s = '\0';
+ *string = '\0';
/* maxlen must be at least 3 to hold the \. terminator! */
if (maxlen < 3)
return EOF;
@@ -2840,7 +2840,7 @@ PQgetline(PGconn *conn, char *s, int maxlen)
if (!conn)
return EOF;
- return pqGetline3(conn, s, maxlen);
+ return pqGetline3(conn, string, maxlen);
}
/*
@@ -2892,9 +2892,9 @@ PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
* send failure.
*/
int
-PQputline(PGconn *conn, const char *s)
+PQputline(PGconn *conn, const char *string)
{
- return PQputnbytes(conn, s, strlen(s));
+ return PQputnbytes(conn, string, strlen(string));
}
/*
diff --git a/src/interfaces/libpq/fe-secure-common.h b/src/interfaces/libpq/fe-secure-common.h
index d18db7138..415a93898 100644
--- a/src/interfaces/libpq/fe-secure-common.h
+++ b/src/interfaces/libpq/fe-secure-common.h
@@ -22,8 +22,8 @@ extern int pq_verify_peer_name_matches_certificate_name(PGconn *conn,
const char *namedata, size_t namelen,
char **store_name);
extern int pq_verify_peer_name_matches_certificate_ip(PGconn *conn,
- const unsigned char *addrdata,
- size_t addrlen,
+ const unsigned char *ipdata,
+ size_t iplen,
char **store_name);
extern bool pq_verify_peer_name_matches_certificate(PGconn *conn);
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index 7986445f1..f7a5db4c2 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -483,7 +483,7 @@ extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
/* Deprecated routines for copy in/out */
-extern int PQgetline(PGconn *conn, char *string, int length);
+extern int PQgetline(PGconn *conn, char *string, int maxlen);
extern int PQputline(PGconn *conn, const char *string);
extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
@@ -591,7 +591,7 @@ extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_lengt
extern void PQprint(FILE *fout, /* output stream */
const PGresult *res,
- const PQprintOpt *ps); /* option structure */
+ const PQprintOpt *po); /* option structure */
/*
* really old printing routines
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 7bd2a9fff..a64734294 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -374,7 +374,7 @@ static ParamListInfo setup_param_list(PLpgSQL_execstate *estate,
PLpgSQL_expr *expr);
static ParamExternData *plpgsql_param_fetch(ParamListInfo params,
int paramid, bool speculative,
- ParamExternData *workspace);
+ ParamExternData *prm);
static void plpgsql_param_compile(ParamListInfo params, Param *param,
ExprState *state,
Datum *resv, bool *resnull);
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index e51c03610..14f20e2d2 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = {
* ScanKeywordLookup(), except we want case-sensitive matching.
*/
int
-ScanCKeywordLookup(const char *str)
+ScanCKeywordLookup(const char *text)
{
size_t len;
int h;
@@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str)
* Reject immediately if too long to be any keyword. This saves useless
* hashing work on long strings.
*/
- len = strlen(str);
+ len = strlen(text);
if (len > ScanCKeywords.max_kw_len)
return -1;
@@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str)
* Compute the hash function. Since it's a perfect hash, we need only
* match to the specific keyword it identifies.
*/
- h = ScanCKeywords_hash_func(str, len);
+ h = ScanCKeywords_hash_func(text, len);
/* An out-of-range result implies no match */
if (h < 0 || h >= ScanCKeywords.num_keywords)
@@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str)
kw = GetScanKeyword(h, &ScanCKeywords);
- if (strcmp(kw, str) == 0)
+ if (strcmp(kw, text) == 0)
return ScanCKeywordTokens[h];
return -1;
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index cf8aadd0b..6c0b8a27b 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -4,7 +4,7 @@
#include "preproc_extern.h"
-static void output_escaped_str(char *cmd, bool quoted);
+static void output_escaped_str(char *str, bool quoted);
void
output_line_number(void)
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 6be59b719..732556a0a 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -75,8 +75,8 @@ extern int base_yylex(void);
extern void base_yyerror(const char *);
extern void *mm_alloc(size_t);
extern char *mm_strdup(const char *);
-extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
-extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
+extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
+extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
extern void output_get_descr_header(char *);
extern void output_get_descr(char *, char *);
extern void output_set_descr_header(char *);
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 0ea6ead2d..10d5499ec 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -128,11 +128,11 @@ static void leapadd(zic_t, int, int);
static void adjleap(void);
static void associate(void);
static void dolink(const char *, const char *, bool);
-static char **getfields(char *buf);
+static char **getfields(char *cp);
static zic_t gethms(const char *string, const char *errstring);
static zic_t getsave(char *, bool *);
static void inexpires(char **, int);
-static void infile(const char *filename);
+static void infile(const char *name);
static void inleap(char **fields, int nfields);
static void inlink(char **fields, int nfields);
static void inrule(char **fields, int nfields);
@@ -144,9 +144,9 @@ static bool itssymlink(char const *);
static bool is_alpha(char a);
static char lowerit(char);
static void mkdirs(char const *, bool);
-static void newabbr(const char *abbr);
+static void newabbr(const char *string);
static zic_t oadd(zic_t t1, zic_t t2);
-static void outzone(const struct zone *zp, ptrdiff_t ntzones);
+static void outzone(const struct zone *zpfirst, ptrdiff_t zonecount);
static zic_t rpytime(const struct rule *rp, zic_t wantedy);
static void rulesub(struct rule *rp,
const char *loyearp, const char *hiyearp,
@@ -304,8 +304,8 @@ struct lookup
const int l_value;
};
-static struct lookup const *byword(const char *string,
- const struct lookup *lp);
+static struct lookup const *byword(const char *word,
+ const struct lookup *table);
static struct lookup const zi_line_codes[] = {
{"Rule", LC_RULE},
--
2.34.1
Peter Geoghegan <pg@bowt.ie> writes:
I have to admit that these inconsistencies are a pet peeve of mine. I
find them distracting, and have a history of fixing them on an ad-hoc
basis. But there are real practical arguments in favor of being strict
about it as a matter of policy -- it's not *just* neatnikism.
I agree, this has always been a pet peeve of mine as well. I would
have guessed there were fewer examples than you found, because I've
generally fixed any such cases I happened to notice.
regards, tom lane
On Fri, Sep 16, 2022 at 4:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
I agree, this has always been a pet peeve of mine as well. I would
have guessed there were fewer examples than you found, because I've
generally fixed any such cases I happened to notice.
If you actually go through them all one by one you'll see that the
vast majority of individual cases involve an inconsistency that
follows some kind of recognizable pattern. For example, a Relation
parameter might be spelled "relation" in one place and "rel" in
another. I find these more common cases much less noticeable --
perhaps that's why there are more than you thought there'd be?
It's possible to configure the clang-tidy tooling to tolerate various
inconsistencies, below some kind of threshold -- it is totally
customizable. But I think that a strict, simple rule is the way to go
here. (Though without creating busy work for committers that don't
want to use clang-tidy all the time.)
--
Peter Geoghegan
Peter Geoghegan <pg@bowt.ie> writes:
It's possible to configure the clang-tidy tooling to tolerate various
inconsistencies, below some kind of threshold -- it is totally
customizable. But I think that a strict, simple rule is the way to go
here.
Agreed; I see no need to tolerate any inconsistency.
(Though without creating busy work for committers that don't
want to use clang-tidy all the time.)
Yeah. I'd be inclined to handle it about like cpluspluscheck:
provide a script that people can run from time to time, but
don't insist that it's a commit-blocker. (I wouldn't be unhappy
to see the cfbot include this in its compiler warnings suite,
though, once we get rid of the existing instances.)
regards, tom lane
On Fri, Sep 16, 2022 at 4:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Agreed; I see no need to tolerate any inconsistency.
The check that I used to write the patches doesn't treat unnamed
parameters in a function declaration as an inconsistency, even when
"strict" is used. Another nearby check *could* be used to catch
unnamed parameters [1]https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-named-parameter.html -- Peter Geoghegan if that was deemed useful, though. How do you
feel about unnamed parameters?
Many of the function declarations from reorderbuffer.h will be
affected if we decide that we don't want to allow unnamed parameters
-- it's quite noticeable there. I myself lean towards not allowing
unnamed parameters. (Though perhaps I should reserve judgement until
after I've measured just how prevalent unnamed parameters are.)
Yeah. I'd be inclined to handle it about like cpluspluscheck:
provide a script that people can run from time to time, but
don't insist that it's a commit-blocker.
My thoughts exactly.
[1]: https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-named-parameter.html -- Peter Geoghegan
--
Peter Geoghegan
Peter Geoghegan <pg@bowt.ie> writes:
The check that I used to write the patches doesn't treat unnamed
parameters in a function declaration as an inconsistency, even when
"strict" is used. Another nearby check *could* be used to catch
unnamed parameters [1] if that was deemed useful, though. How do you
feel about unnamed parameters?
I think they're easily Stroustrup's worst idea ever. You're basically
throwing away an opportunity for documentation, and that documentation
is often sorely needed. Handy example:
extern void ReorderBufferCommitChild(ReorderBuffer *, TransactionId, TransactionId,
XLogRecPtr commit_lsn, XLogRecPtr end_lsn);
Which TransactionId parameter is which? You might be tempted to guess,
if you think you remember how the function works, and that is a recipe
for bugs.
I'd view the current state of reorderbuffer.h as pretty unacceptable on
stylistic grounds no matter which position you take. Having successive
declarations randomly using named or unnamed parameters is seriously
ugly and distracting, at least to my eye. We don't need such blatant
reminders of how many cooks have stirred this broth.
regards, tom lane
On Fri, Sep 16, 2022 at 6:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
I think they're easily Stroustrup's worst idea ever. You're basically
throwing away an opportunity for documentation, and that documentation
is often sorely needed.
He could at least point to C++ pure virtual functions, where omitting
a parameter name in the base class supposedly conveys useful
information. I don't find that argument particularly convincing
myself, even in a C++ context, but at least it's an argument. Doesn't
apply here in any case.
I'd view the current state of reorderbuffer.h as pretty unacceptable on
stylistic grounds no matter which position you take. Having successive
declarations randomly using named or unnamed parameters is seriously
ugly and distracting, at least to my eye. We don't need such blatant
reminders of how many cooks have stirred this broth.
I'll come up with a revision that deals with that too, then. Shouldn't
be too much more work.
I suppose that I ought to backpatch a fix for the really egregious
issue in hba.h, and leave it at that on stable branches.
--
Peter Geoghegan
On Fri, Sep 16, 2022 at 06:48:36PM -0700, Peter Geoghegan wrote:
On Fri, Sep 16, 2022 at 6:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
I'd view the current state of reorderbuffer.h as pretty unacceptable on
stylistic grounds no matter which position you take. Having successive
declarations randomly using named or unnamed parameters is seriously
ugly and distracting, at least to my eye. We don't need such blatant
reminders of how many cooks have stirred this broth.I'll come up with a revision that deals with that too, then. Shouldn't
be too much more work.
Being able to catch unnamed paramaters in function declarations would
be really nice. Thanks for looking at that.
I suppose that I ought to backpatch a fix for the really egregious
issue in hba.h, and leave it at that on stable branches.
If check_usermap() is used in a bugfix, that could be a risk, so this
bit warrants a backpatch in my opinion.
--
Michael
On Fri, Sep 16, 2022 at 6:48 PM Peter Geoghegan <pg@bowt.ie> wrote:
On Fri, Sep 16, 2022 at 6:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
I think they're easily Stroustrup's worst idea ever. You're basically
throwing away an opportunity for documentation, and that documentation
is often sorely needed.He could at least point to C++ pure virtual functions, where omitting
a parameter name in the base class supposedly conveys useful
information. I don't find that argument particularly convincing
myself, even in a C++ context, but at least it's an argument. Doesn't
apply here in any case.
Several files from src/timezone and from src/backend/regex make use of
unnamed parameters in function declarations. It wouldn't be difficult
to fix everything and call it a day, but I wonder if there are any
special considerations here. I don't think that Henry Spencer's regex
code is considered vendored code these days (if it ever was), so that
seems clear cut. I'm less sure about the timezone code.
Note that regcomp.c has a relatively large number of function
declarations that need to be fixed (regexec.c has some too), since the
regex code was written in a style that makes unnamed parameters in
declarations the standard -- we're talking about changing every static
function declaration. The timezone code is just inconsistent about its
use of unnamed parameters, kind of like reorderbuffer.h.
I don't see any reason to treat this quasi-vendored code as special,
but I don't really know anything about your workflow with the timezone
files.
--
Peter Geoghegan
Peter Geoghegan <pg@bowt.ie> writes:
Several files from src/timezone and from src/backend/regex make use of
unnamed parameters in function declarations. It wouldn't be difficult
to fix everything and call it a day, but I wonder if there are any
special considerations here. I don't think that Henry Spencer's regex
code is considered vendored code these days (if it ever was), so that
seems clear cut. I'm less sure about the timezone code.
Yeah, bringing the regex code into line with our standards is fine.
I don't really see a reason not to do it with the timezone code
either, as long as there aren't too many changes there. We are
carrying a pretty large number of diffs from upstream already.
(Which reminds me that I need to do another update pass on that
code soon. Not right now, though.)
regards, tom lane
On Sat, Sep 17, 2022 at 11:26 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Yeah, bringing the regex code into line with our standards is fine.
I don't really see a reason not to do it with the timezone code
either, as long as there aren't too many changes there. We are
carrying a pretty large number of diffs from upstream already.
I'd be surprised if this created more than 3 minutes of extra work for
you when updating the timezone code.
There are a few places where I had to apply a certain amount of
subjective judgement (rather than just mechanically normalizing the
declarations), but the timezone code wasn't one of those places. Plus
there just isn't that many affected timezone related function
declarations, and they're concentrated in only 3 distinct areas.
--
Peter Geoghegan
On Sat, Sep 17, 2022 at 11:36 AM Peter Geoghegan <pg@bowt.ie> wrote:
I'd be surprised if this created more than 3 minutes of extra work for
you when updating the timezone code.
Attached revision adds a new, third patch. This fixes all the warnings
from clang-tidy's "readability-named-parameter" check. The extent of
the code churn seems acceptable to me.
BTW. there are just a couple of remaining unfixed
"readability-inconsistent-declaration-parameter-name" warnings --
legitimately tricky cases. These are related to simplehash.h client
code, where we use the C preprocessor to simulate C++ templates
(Bjarne strikes again). It would be possible to suppress the warnings
by making the client code use matching generic function-style
parameter names, but that doesn't seem like an improvement.
If we're going to adapt a project policy around parameter names, then
we'll need a workaround -- probably just by suppressing a handful of
tricky warnings. For now my focus is cleaning things up on HEAD.
--
Peter Geoghegan
Attachments:
v2-0002-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchapplication/octet-stream; name=v2-0002-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchDownload
From af31e6e22e04f1308ff1fb3b94bfdecb82211c6a Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 22:19:51 -0700
Subject: [PATCH v2 2/3] Harmonize parameter names in pg_dump/pg_dumpall
---
src/bin/pg_dump/common.c | 2 +-
src/bin/pg_dump/parallel.c | 4 +-
src/bin/pg_dump/pg_backup.h | 28 +++---
src/bin/pg_dump/pg_backup_archiver.c | 53 ++++++------
src/bin/pg_dump/pg_backup_archiver.h | 6 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_tar.c | 4 +-
src/bin/pg_dump/pg_dump.c | 120 +++++++++++++-------------
src/bin/pg_dump/pg_dump.h | 6 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
11 files changed, 117 insertions(+), 116 deletions(-)
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 395f817fa..44fa52cc5 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -79,7 +79,7 @@ typedef struct _catalogIdMapEntry
static catalogid_hash *catalogIdHash = NULL;
-static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables,
+static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables);
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c8a70d9bc..1c194ceb4 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -325,9 +325,9 @@ getThreadLocalPQExpBuffer(void)
* as soon as they've created the ArchiveHandle.
*/
void
-on_exit_close_archive(Archive *AHX)
+on_exit_close_archive(Archive *A)
{
- shutdown_info.AHX = AHX;
+ shutdown_info.AHX = A;
on_exit_nicely(archive_close_connection, &shutdown_info);
}
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fcc5f6bd0..e234ec216 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -270,33 +270,33 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods.
*/
-typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+typedef int (*DataDumperPtr) (Archive *A, const void *userArg);
-typedef void (*SetupWorkerPtrType) (Archive *AH);
+typedef void (*SetupWorkerPtrType) (Archive *A);
/*
* Main archiver interface.
*/
-extern void ConnectDatabase(Archive *AHX,
+extern void ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect);
-extern void DisconnectDatabase(Archive *AHX);
-extern PGconn *GetConnection(Archive *AHX);
+extern void DisconnectDatabase(Archive *A);
+extern PGconn *GetConnection(Archive *A);
/* Called to write *data* to the archive */
-extern void WriteData(Archive *AH, const void *data, size_t dLen);
+extern void WriteData(Archive *A, const void *data, size_t dLen);
-extern int StartBlob(Archive *AH, Oid oid);
-extern int EndBlob(Archive *AH, Oid oid);
+extern int StartBlob(Archive *A, Oid oid);
+extern int EndBlob(Archive *A, Oid oid);
-extern void CloseArchive(Archive *AH);
+extern void CloseArchive(Archive *A);
-extern void SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt);
+extern void SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt);
-extern void ProcessArchiveRestoreOptions(Archive *AH);
+extern void ProcessArchiveRestoreOptions(Archive *A);
-extern void RestoreArchive(Archive *AH);
+extern void RestoreArchive(Archive *A);
/* Open an existing archive */
extern Archive *OpenArchive(const char *FileSpec, const ArchiveFormat fmt);
@@ -307,7 +307,7 @@ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt,
SetupWorkerPtrType setupDumpWorker);
/* The --list option */
-extern void PrintTOCSummary(Archive *AH);
+extern void PrintTOCSummary(Archive *A);
extern RestoreOptions *NewRestoreOptions(void);
@@ -316,7 +316,7 @@ extern void InitDumpOptions(DumpOptions *opts);
extern DumpOptions *dumpOptionsFromRestoreOptions(RestoreOptions *ropt);
/* Rearrange and filter TOC entries */
-extern void SortTocFromFile(Archive *AHX);
+extern void SortTocFromFile(Archive *A);
/* Convenience functions used only when writing DATA */
extern void archputs(const char *s, Archive *AH);
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 233198afc..0f3f90bf2 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -261,10 +261,10 @@ OpenArchive(const char *FileSpec, const ArchiveFormat fmt)
/* Public */
void
-CloseArchive(Archive *AHX)
+CloseArchive(Archive *A)
{
int res = 0;
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ClosePtr(AH);
@@ -281,22 +281,22 @@ CloseArchive(Archive *AHX)
/* Public */
void
-SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt)
+SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt)
{
/* Caller can omit dump options, in which case we synthesize them */
if (dopt == NULL && ropt != NULL)
dopt = dumpOptionsFromRestoreOptions(ropt);
/* Save options for later access */
- AH->dopt = dopt;
- AH->ropt = ropt;
+ A->dopt = dopt;
+ A->ropt = ropt;
}
/* Public */
void
-ProcessArchiveRestoreOptions(Archive *AHX)
+ProcessArchiveRestoreOptions(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -349,9 +349,9 @@ ProcessArchiveRestoreOptions(Archive *AHX)
/* Public */
void
-RestoreArchive(Archive *AHX)
+RestoreArchive(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
bool parallel_mode;
TocEntry *te;
@@ -415,10 +415,10 @@ RestoreArchive(Archive *AHX)
* restore; allow the attempt regardless of the version of the restore
* target.
*/
- AHX->minRemoteVersion = 0;
- AHX->maxRemoteVersion = 9999999;
+ A->minRemoteVersion = 0;
+ A->maxRemoteVersion = 9999999;
- ConnectDatabase(AHX, &ropt->cparams, false);
+ ConnectDatabase(A, &ropt->cparams, false);
/*
* If we're talking to the DB directly, don't send comments since they
@@ -479,7 +479,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- StartTransaction(AHX);
+ StartTransaction(A);
else
ahprintf(AH, "BEGIN;\n\n");
}
@@ -724,7 +724,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- CommitTransaction(AHX);
+ CommitTransaction(A);
else
ahprintf(AH, "COMMIT;\n\n");
}
@@ -1031,9 +1031,9 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te)
/* Public */
void
-WriteData(Archive *AHX, const void *data, size_t dLen)
+WriteData(Archive *A, const void *data, size_t dLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->currToc)
pg_fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
@@ -1052,10 +1052,9 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
/* Public */
TocEntry *
-ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
- ArchiveOpts *opts)
+ArchiveEntry(Archive *A, CatalogId catalogId, DumpId dumpId, ArchiveOpts *opts)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
TocEntry *newToc;
newToc = (TocEntry *) pg_malloc0(sizeof(TocEntry));
@@ -1110,9 +1109,9 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
/* Public */
void
-PrintTOCSummary(Archive *AHX)
+PrintTOCSummary(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -1214,9 +1213,9 @@ PrintTOCSummary(Archive *AHX)
/* Called by a dumper to signal start of a BLOB */
int
-StartBlob(Archive *AHX, Oid oid)
+StartBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->StartBlobPtr)
pg_fatal("large-object output not supported in chosen format");
@@ -1228,9 +1227,9 @@ StartBlob(Archive *AHX, Oid oid)
/* Called by a dumper to signal end of a BLOB */
int
-EndBlob(Archive *AHX, Oid oid)
+EndBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->EndBlobPtr)
AH->EndBlobPtr(AH, AH->currToc, oid);
@@ -1358,9 +1357,9 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
***********/
void
-SortTocFromFile(Archive *AHX)
+SortTocFromFile(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
FILE *fh;
StringInfoData linebuf;
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 084cd87e8..12b84e2e6 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -404,7 +404,7 @@ struct _tocEntry
};
extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
-extern void on_exit_close_archive(Archive *AHX);
+extern void on_exit_close_archive(Archive *A);
extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
@@ -428,7 +428,7 @@ typedef struct _archiveOpts
} ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */
-extern TocEntry *ArchiveEntry(Archive *AHX, CatalogId catalogId,
+extern TocEntry *ArchiveEntry(Archive *A, CatalogId catalogId,
DumpId dumpId, ArchiveOpts *opts);
extern void WriteHead(ArchiveHandle *AH);
@@ -457,7 +457,7 @@ extern bool checkSeek(FILE *fp);
extern size_t WriteInt(ArchiveHandle *AH, int i);
extern int ReadInt(ArchiveHandle *AH);
extern char *ReadStr(ArchiveHandle *AH);
-extern size_t WriteStr(ArchiveHandle *AH, const char *s);
+extern size_t WriteStr(ArchiveHandle *AH, const char *c);
int ReadOffset(ArchiveHandle *, pgoff_t *);
size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 1023fea01..a0a55a1ed 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -40,7 +40,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 3f46f7988..798182b6f 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -67,7 +67,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 7960b81c0..402b93c61 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -46,7 +46,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
@@ -97,7 +97,7 @@ typedef struct
static void _LoadBlobs(ArchiveHandle *AH);
static TAR_MEMBER *tarOpen(ArchiveHandle *AH, const char *filename, char mode);
-static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
+static void tarClose(ArchiveHandle *AH, TAR_MEMBER *th);
#ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 67b6d9079..dbed4ebc4 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -159,7 +159,7 @@ static int nseclabels = 0;
(obj)->dobj.name)
static void help(const char *progname);
-static void setup_connection(Archive *AH,
+static void setup_connection(Archive *A,
const char *dumpencoding, const char *dumpsnapshot,
char *use_role);
static ArchiveFormat parseArchiveFormat(const char *format, ArchiveMode *mode);
@@ -221,7 +221,7 @@ static void dumpFunc(Archive *fout, const FuncInfo *finfo);
static void dumpCast(Archive *fout, const CastInfo *cast);
static void dumpTransform(Archive *fout, const TransformInfo *transform);
static void dumpOpr(Archive *fout, const OprInfo *oprinfo);
-static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *oprinfo);
+static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *aminfo);
static void dumpOpclass(Archive *fout, const OpclassInfo *opcinfo);
static void dumpOpfamily(Archive *fout, const OpfamilyInfo *opfinfo);
static void dumpCollation(Archive *fout, const CollInfo *collinfo);
@@ -232,7 +232,7 @@ static void dumpTrigger(Archive *fout, const TriggerInfo *tginfo);
static void dumpEventTrigger(Archive *fout, const EventTriggerInfo *evtinfo);
static void dumpTable(Archive *fout, const TableInfo *tbinfo);
static void dumpTableSchema(Archive *fout, const TableInfo *tbinfo);
-static void dumpTableAttach(Archive *fout, const TableAttachInfo *tbinfo);
+static void dumpTableAttach(Archive *fout, const TableAttachInfo *attachinfo);
static void dumpAttrDef(Archive *fout, const AttrDefInfo *adinfo);
static void dumpSequence(Archive *fout, const TableInfo *tbinfo);
static void dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo);
@@ -287,12 +287,12 @@ static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
static void dumpPublicationTable(Archive *fout, const PublicationRelInfo *pubrinfo);
static void dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo);
-static void dumpDatabase(Archive *AH);
+static void dumpDatabase(Archive *fout);
static void dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
const char *dbname, Oid dboid);
-static void dumpEncoding(Archive *AH);
-static void dumpStdStrings(Archive *AH);
-static void dumpSearchPath(Archive *AH);
+static void dumpEncoding(Archive *A);
+static void dumpStdStrings(Archive *A);
+static void dumpSearchPath(Archive *A);
static void binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
PQExpBuffer upgrade_buffer,
Oid pg_type_oid,
@@ -315,7 +315,7 @@ static bool nonemptyReloptions(const char *reloptions);
static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
const char *prefix, Archive *fout);
static char *get_synchronized_snapshot(Archive *fout);
-static void setupDumpWorker(Archive *AHX);
+static void setupDumpWorker(Archive *A);
static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
@@ -1069,14 +1069,14 @@ help(const char *progname)
}
static void
-setup_connection(Archive *AH, const char *dumpencoding,
+setup_connection(Archive *A, const char *dumpencoding,
const char *dumpsnapshot, char *use_role)
{
- DumpOptions *dopt = AH->dopt;
- PGconn *conn = GetConnection(AH);
+ DumpOptions *dopt = A->dopt;
+ PGconn *conn = GetConnection(A);
const char *std_strings;
- PQclear(ExecuteSqlQueryForSingleRow(AH, ALWAYS_SECURE_SEARCH_PATH_SQL));
+ PQclear(ExecuteSqlQueryForSingleRow(A, ALWAYS_SECURE_SEARCH_PATH_SQL));
/*
* Set the client encoding if requested.
@@ -1092,18 +1092,18 @@ setup_connection(Archive *AH, const char *dumpencoding,
* Get the active encoding and the standard_conforming_strings setting, so
* we know how to escape strings.
*/
- AH->encoding = PQclientEncoding(conn);
+ A->encoding = PQclientEncoding(conn);
std_strings = PQparameterStatus(conn, "standard_conforming_strings");
- AH->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
+ A->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
/*
* Set the role if requested. In a parallel dump worker, we'll be passed
* use_role == NULL, but AH->use_role is already set (if user specified it
* originally) and we should use that.
*/
- if (!use_role && AH->use_role)
- use_role = AH->use_role;
+ if (!use_role && A->use_role)
+ use_role = A->use_role;
/* Set the role if requested */
if (use_role)
@@ -1111,19 +1111,19 @@ setup_connection(Archive *AH, const char *dumpencoding,
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query, "SET ROLE %s", fmtId(use_role));
- ExecuteSqlStatement(AH, query->data);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
/* save it for possible later use by parallel workers */
- if (!AH->use_role)
- AH->use_role = pg_strdup(use_role);
+ if (!A->use_role)
+ A->use_role = pg_strdup(use_role);
}
/* Set the datestyle to ISO to ensure the dump's portability */
- ExecuteSqlStatement(AH, "SET DATESTYLE = ISO");
+ ExecuteSqlStatement(A, "SET DATESTYLE = ISO");
/* Likewise, avoid using sql_standard intervalstyle */
- ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
+ ExecuteSqlStatement(A, "SET INTERVALSTYLE = POSTGRES");
/*
* Use an explicitly specified extra_float_digits if it has been provided.
@@ -1136,54 +1136,54 @@ setup_connection(Archive *AH, const char *dumpencoding,
appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits);
- ExecuteSqlStatement(AH, q->data);
+ ExecuteSqlStatement(A, q->data);
destroyPQExpBuffer(q);
}
else
- ExecuteSqlStatement(AH, "SET extra_float_digits TO 3");
+ ExecuteSqlStatement(A, "SET extra_float_digits TO 3");
/*
* Disable synchronized scanning, to prevent unpredictable changes in row
* ordering across a dump and reload.
*/
- ExecuteSqlStatement(AH, "SET synchronize_seqscans TO off");
+ ExecuteSqlStatement(A, "SET synchronize_seqscans TO off");
/*
* Disable timeouts if supported.
*/
- ExecuteSqlStatement(AH, "SET statement_timeout = 0");
- if (AH->remoteVersion >= 90300)
- ExecuteSqlStatement(AH, "SET lock_timeout = 0");
- if (AH->remoteVersion >= 90600)
- ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
+ ExecuteSqlStatement(A, "SET statement_timeout = 0");
+ if (A->remoteVersion >= 90300)
+ ExecuteSqlStatement(A, "SET lock_timeout = 0");
+ if (A->remoteVersion >= 90600)
+ ExecuteSqlStatement(A, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.
*/
if (quote_all_identifiers)
- ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ ExecuteSqlStatement(A, "SET quote_all_identifiers = true");
/*
* Adjust row-security mode, if supported.
*/
- if (AH->remoteVersion >= 90500)
+ if (A->remoteVersion >= 90500)
{
if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security = on");
+ ExecuteSqlStatement(A, "SET row_security = on");
else
- ExecuteSqlStatement(AH, "SET row_security = off");
+ ExecuteSqlStatement(A, "SET row_security = off");
}
/*
* Initialize prepared-query state to "nothing prepared". We do this here
* so that a parallel dump worker will have its own state.
*/
- AH->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
+ A->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
- ExecuteSqlStatement(AH, "BEGIN");
+ ExecuteSqlStatement(A, "BEGIN");
/*
* To support the combination of serializable_deferrable with the jobs
@@ -1193,12 +1193,12 @@ setup_connection(Archive *AH, const char *dumpencoding,
* REPEATABLE READ transaction provides the appropriate integrity
* guarantees. This is a kluge, but safe for back-patching.
*/
- if (dopt->serializable_deferrable && AH->sync_snapshot_id == NULL)
- ExecuteSqlStatement(AH,
+ if (dopt->serializable_deferrable && A->sync_snapshot_id == NULL)
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
- ExecuteSqlStatement(AH,
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ, READ ONLY");
@@ -1208,28 +1208,28 @@ setup_connection(Archive *AH, const char *dumpencoding,
* is already set (if the server can handle it) and we should use that.
*/
if (dumpsnapshot)
- AH->sync_snapshot_id = pg_strdup(dumpsnapshot);
+ A->sync_snapshot_id = pg_strdup(dumpsnapshot);
- if (AH->sync_snapshot_id)
+ if (A->sync_snapshot_id)
{
PQExpBuffer query = createPQExpBuffer();
appendPQExpBufferStr(query, "SET TRANSACTION SNAPSHOT ");
- appendStringLiteralConn(query, AH->sync_snapshot_id, conn);
- ExecuteSqlStatement(AH, query->data);
+ appendStringLiteralConn(query, A->sync_snapshot_id, conn);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
}
- else if (AH->numWorkers > 1)
+ else if (A->numWorkers > 1)
{
- if (AH->isStandby && AH->remoteVersion < 100000)
+ if (A->isStandby && A->remoteVersion < 100000)
pg_fatal("parallel dumps from standby servers are not supported by this server version");
- AH->sync_snapshot_id = get_synchronized_snapshot(AH);
+ A->sync_snapshot_id = get_synchronized_snapshot(A);
}
}
/* Set up connection for a parallel worker process */
static void
-setupDumpWorker(Archive *AH)
+setupDumpWorker(Archive *A)
{
/*
* We want to re-select all the same values the leader connection is
@@ -1237,8 +1237,8 @@ setupDumpWorker(Archive *AH)
* AH->sync_snapshot_id and AH->use_role, but we need to translate the
* inherited encoding value back to a string to pass to setup_connection.
*/
- setup_connection(AH,
- pg_encoding_to_char(AH->encoding),
+ setup_connection(A,
+ pg_encoding_to_char(A->encoding),
NULL,
NULL);
}
@@ -3270,18 +3270,18 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
* dumpEncoding: put the correct encoding into the archive
*/
static void
-dumpEncoding(Archive *AH)
+dumpEncoding(Archive *A)
{
- const char *encname = pg_encoding_to_char(AH->encoding);
+ const char *encname = pg_encoding_to_char(A->encoding);
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving encoding = %s", encname);
appendPQExpBufferStr(qry, "SET client_encoding = ");
- appendStringLiteralAH(qry, encname, AH);
+ appendStringLiteralAH(qry, encname, A);
appendPQExpBufferStr(qry, ";\n");
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "ENCODING",
.description = "ENCODING",
.section = SECTION_PRE_DATA,
@@ -3295,9 +3295,9 @@ dumpEncoding(Archive *AH)
* dumpStdStrings: put the correct escape string behavior into the archive
*/
static void
-dumpStdStrings(Archive *AH)
+dumpStdStrings(Archive *A)
{
- const char *stdstrings = AH->std_strings ? "on" : "off";
+ const char *stdstrings = A->std_strings ? "on" : "off";
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving standard_conforming_strings = %s",
@@ -3306,7 +3306,7 @@ dumpStdStrings(Archive *AH)
appendPQExpBuffer(qry, "SET standard_conforming_strings = '%s';\n",
stdstrings);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "STDSTRINGS",
.description = "STDSTRINGS",
.section = SECTION_PRE_DATA,
@@ -3319,7 +3319,7 @@ dumpStdStrings(Archive *AH)
* dumpSearchPath: record the active search_path in the archive
*/
static void
-dumpSearchPath(Archive *AH)
+dumpSearchPath(Archive *A)
{
PQExpBuffer qry = createPQExpBuffer();
PQExpBuffer path = createPQExpBuffer();
@@ -3335,7 +3335,7 @@ dumpSearchPath(Archive *AH)
* listing schemas that may appear in search_path but not actually exist,
* which seems like a prudent exclusion.
*/
- res = ExecuteSqlQueryForSingleRow(AH,
+ res = ExecuteSqlQueryForSingleRow(A,
"SELECT pg_catalog.current_schemas(false)");
if (!parsePGArray(PQgetvalue(res, 0, 0), &schemanames, &nschemanames))
@@ -3355,19 +3355,19 @@ dumpSearchPath(Archive *AH)
}
appendPQExpBufferStr(qry, "SELECT pg_catalog.set_config('search_path', ");
- appendStringLiteralAH(qry, path->data, AH);
+ appendStringLiteralAH(qry, path->data, A);
appendPQExpBufferStr(qry, ", false);\n");
pg_log_info("saving search_path = %s", path->data);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "SEARCHPATH",
.description = "SEARCHPATH",
.section = SECTION_PRE_DATA,
.createStmt = qry->data));
/* Also save it in AH->searchpath, in case we're doing plain text dump */
- AH->searchpath = pg_strdup(qry->data);
+ A->searchpath = pg_strdup(qry->data);
free(schemanames);
PQclear(res);
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 69ee939d4..427f5d45f 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -705,8 +705,8 @@ extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
extern TypeInfo *getTypes(Archive *fout, int *numTypes);
extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
-extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
-extern OprInfo *getOperators(Archive *fout, int *numOperators);
+extern AggInfo *getAggregates(Archive *fout, int *numAggs);
+extern OprInfo *getOperators(Archive *fout, int *numOprs);
extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
@@ -723,7 +723,7 @@ extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
-extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
+extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 69ae027bd..083012ca3 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -72,8 +72,10 @@ static void buildShSecLabels(PGconn *conn,
const char *catalog_name, Oid objectId,
const char *objtype, const char *objname,
PQExpBuffer buffer);
-static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
- const char *pguser, trivalue prompt_password, bool fail_on_error);
+static PGconn *connectDatabase(const char *dbname,
+ const char *connection_string, const char *pghost,
+ const char *pgport, const char *pguser,
+ trivalue prompt_password, bool fail_on_error);
static char *constructConnStr(const char **keywords, const char **values);
static PGresult *executeQuery(PGconn *conn, const char *query);
static void executeCommand(PGconn *conn, const char *query);
--
2.34.1
v2-0003-Consistently-use-named-parameters.patchapplication/octet-stream; name=v2-0003-Consistently-use-named-parameters.patchDownload
From 939bc10a6e9ae7dc2c24335ea377128a4fd649d4 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Fri, 16 Sep 2022 21:28:51 -0700
Subject: [PATCH v2 3/3] Consistently use named parameters.
---
src/include/replication/reorderbuffer.h | 55 ++--
src/backend/libpq/be-secure-openssl.c | 4 +-
src/backend/regex/regcomp.c | 342 +++++++++++++----------
src/backend/regex/regexec.c | 65 +++--
src/backend/utils/adt/like.c | 4 +-
src/interfaces/libpq/fe-secure-openssl.c | 2 +-
src/interfaces/ecpg/preproc/type.c | 2 +-
src/timezone/localtime.c | 16 +-
src/timezone/strftime.c | 10 +-
src/timezone/zic.c | 22 +-
10 files changed, 291 insertions(+), 231 deletions(-)
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index d7902666b..39e94ed1a 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -630,23 +630,26 @@ struct ReorderBuffer
extern ReorderBuffer *ReorderBufferAllocate(void);
-extern void ReorderBufferFree(ReorderBuffer *);
+extern void ReorderBufferFree(ReorderBuffer *rb);
-extern ReorderBufferTupleBuf *ReorderBufferGetTupleBuf(ReorderBuffer *, Size tuple_len);
-extern void ReorderBufferReturnTupleBuf(ReorderBuffer *, ReorderBufferTupleBuf *tuple);
-extern ReorderBufferChange *ReorderBufferGetChange(ReorderBuffer *);
-extern void ReorderBufferReturnChange(ReorderBuffer *, ReorderBufferChange *, bool);
+extern ReorderBufferTupleBuf *ReorderBufferGetTupleBuf(ReorderBuffer *rb,
+ Size tuple_len);
+extern void ReorderBufferReturnTupleBuf(ReorderBuffer *rb,
+ ReorderBufferTupleBuf *tuple);
+extern ReorderBufferChange *ReorderBufferGetChange(ReorderBuffer *rb);
+extern void ReorderBufferReturnChange(ReorderBuffer *rb,
+ ReorderBufferChange *change, bool upd_mem);
-extern Oid *ReorderBufferGetRelids(ReorderBuffer *, int nrelids);
-extern void ReorderBufferReturnRelids(ReorderBuffer *, Oid *relids);
+extern Oid *ReorderBufferGetRelids(ReorderBuffer *rb, int nrelids);
+extern void ReorderBufferReturnRelids(ReorderBuffer *rb, Oid *relids);
-extern void ReorderBufferQueueChange(ReorderBuffer *, TransactionId,
- XLogRecPtr lsn, ReorderBufferChange *,
+extern void ReorderBufferQueueChange(ReorderBuffer *rb, TransactionId xid,
+ XLogRecPtr lsn, ReorderBufferChange *change,
bool toast_insert);
-extern void ReorderBufferQueueMessage(ReorderBuffer *, TransactionId, Snapshot snapshot, XLogRecPtr lsn,
+extern void ReorderBufferQueueMessage(ReorderBuffer *rb, TransactionId xid, Snapshot snapshot, XLogRecPtr lsn,
bool transactional, const char *prefix,
Size message_size, const char *message);
-extern void ReorderBufferCommit(ReorderBuffer *, TransactionId,
+extern void ReorderBufferCommit(ReorderBuffer *rb, TransactionId xid,
XLogRecPtr commit_lsn, XLogRecPtr end_lsn,
TimestampTz commit_time, RepOriginId origin_id, XLogRecPtr origin_lsn);
extern void ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
@@ -657,30 +660,30 @@ extern void ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
char *gid, bool is_commit);
extern void ReorderBufferAssignChild(ReorderBuffer *rb, TransactionId xid,
TransactionId subxid, XLogRecPtr lsn);
-extern void ReorderBufferCommitChild(ReorderBuffer *, TransactionId, TransactionId,
+extern void ReorderBufferCommitChild(ReorderBuffer *rb, TransactionId, TransactionId,
XLogRecPtr commit_lsn, XLogRecPtr end_lsn);
-extern void ReorderBufferAbort(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
+extern void ReorderBufferAbort(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn);
extern void ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid);
-extern void ReorderBufferForget(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
-extern void ReorderBufferInvalidate(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
+extern void ReorderBufferForget(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn);
+extern void ReorderBufferInvalidate(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn);
-extern void ReorderBufferSetBaseSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap);
-extern void ReorderBufferAddSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap);
-extern void ReorderBufferAddNewCommandId(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
+extern void ReorderBufferSetBaseSnapshot(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn, Snapshot snap);
+extern void ReorderBufferAddSnapshot(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn, Snapshot snap);
+extern void ReorderBufferAddNewCommandId(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
CommandId cid);
extern void ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
RelFileLocator locator, ItemPointerData tid,
CommandId cmin, CommandId cmax,
CommandId combocid);
-extern void ReorderBufferAddInvalidations(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
+extern void ReorderBufferAddInvalidations(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
Size nmsgs, SharedInvalidationMessage *msgs);
-extern void ReorderBufferImmediateInvalidation(ReorderBuffer *, uint32 ninvalidations,
+extern void ReorderBufferImmediateInvalidation(ReorderBuffer *rb, uint32 ninvalidations,
SharedInvalidationMessage *invalidations);
-extern void ReorderBufferProcessXid(ReorderBuffer *, TransactionId xid, XLogRecPtr lsn);
+extern void ReorderBufferProcessXid(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn);
-extern void ReorderBufferXidSetCatalogChanges(ReorderBuffer *, TransactionId xid, XLogRecPtr lsn);
-extern bool ReorderBufferXidHasCatalogChanges(ReorderBuffer *, TransactionId xid);
-extern bool ReorderBufferXidHasBaseSnapshot(ReorderBuffer *, TransactionId xid);
+extern void ReorderBufferXidSetCatalogChanges(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn);
+extern bool ReorderBufferXidHasCatalogChanges(ReorderBuffer *rb, TransactionId xid);
+extern bool ReorderBufferXidHasBaseSnapshot(ReorderBuffer *rb, TransactionId xid);
extern bool ReorderBufferRememberPrepareInfo(ReorderBuffer *rb, TransactionId xid,
XLogRecPtr prepare_lsn, XLogRecPtr end_lsn,
@@ -688,11 +691,11 @@ extern bool ReorderBufferRememberPrepareInfo(ReorderBuffer *rb, TransactionId xi
RepOriginId origin_id, XLogRecPtr origin_lsn);
extern void ReorderBufferSkipPrepare(ReorderBuffer *rb, TransactionId xid);
extern void ReorderBufferPrepare(ReorderBuffer *rb, TransactionId xid, char *gid);
-extern ReorderBufferTXN *ReorderBufferGetOldestTXN(ReorderBuffer *);
+extern ReorderBufferTXN *ReorderBufferGetOldestTXN(ReorderBuffer *rb);
extern TransactionId ReorderBufferGetOldestXmin(ReorderBuffer *rb);
extern TransactionId *ReorderBufferGetCatalogChangesXacts(ReorderBuffer *rb);
-extern void ReorderBufferSetRestartPoint(ReorderBuffer *, XLogRecPtr ptr);
+extern void ReorderBufferSetRestartPoint(ReorderBuffer *rb, XLogRecPtr ptr);
extern void StartupReorderBuffer(void);
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 035655738..cb702e0fd 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -62,10 +62,10 @@ static BIO_METHOD *my_BIO_s_socket(void);
static int my_SSL_set_fd(Port *port, int fd);
static DH *load_dh_file(char *filename, bool isServerStart);
-static DH *load_dh_buffer(const char *, size_t);
+static DH *load_dh_buffer(const char *buffer, size_t len);
static int ssl_external_passwd_cb(char *buf, int size, int rwflag, void *userdata);
static int dummy_ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);
-static int verify_cb(int, X509_STORE_CTX *);
+static int verify_cb(int ok, X509_STORE_CTX *ctx);
static void info_cb(const SSL *ssl, int type, int args);
static bool initialize_dh(SSL_CTX *context, bool isServerStart);
static bool initialize_ecdh(SSL_CTX *context, bool isServerStart);
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c
index 473738040..e6ff3653a 100644
--- a/src/backend/regex/regcomp.c
+++ b/src/backend/regex/regcomp.c
@@ -38,158 +38,200 @@
* forward declarations, up here so forward datatypes etc. are defined early
*/
/* === regcomp.c === */
-static void moresubs(struct vars *, int);
-static int freev(struct vars *, int);
-static void makesearch(struct vars *, struct nfa *);
-static struct subre *parse(struct vars *, int, int, struct state *, struct state *);
-static struct subre *parsebranch(struct vars *, int, int, struct state *, struct state *, int);
-static struct subre *parseqatom(struct vars *, int, int, struct state *, struct state *, struct subre *);
-static void nonword(struct vars *, int, struct state *, struct state *);
-static void word(struct vars *, int, struct state *, struct state *);
-static void charclass(struct vars *, enum char_classes,
- struct state *, struct state *);
-static void charclasscomplement(struct vars *, enum char_classes,
- struct state *, struct state *);
-static int scannum(struct vars *);
-static void repeat(struct vars *, struct state *, struct state *, int, int);
-static void bracket(struct vars *, struct state *, struct state *);
-static void cbracket(struct vars *, struct state *, struct state *);
-static void brackpart(struct vars *, struct state *, struct state *, bool *);
-static const chr *scanplain(struct vars *);
-static void onechr(struct vars *, chr, struct state *, struct state *);
-static void optimizebracket(struct vars *, struct state *, struct state *);
-static void wordchrs(struct vars *);
-static void processlacon(struct vars *, struct state *, struct state *, int,
- struct state *, struct state *);
-static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
-static void freesubre(struct vars *, struct subre *);
-static void freesubreandsiblings(struct vars *, struct subre *);
-static void freesrnode(struct vars *, struct subre *);
-static void removecaptures(struct vars *, struct subre *);
-static int numst(struct subre *, int);
-static void markst(struct subre *);
-static void cleanst(struct vars *);
-static long nfatree(struct vars *, struct subre *, FILE *);
-static long nfanode(struct vars *, struct subre *, int, FILE *);
-static int newlacon(struct vars *, struct state *, struct state *, int);
-static void freelacons(struct subre *, int);
-static void rfree(regex_t *);
+static void moresubs(struct vars *v, int wanted);
+static int freev(struct vars *v, int err);
+static void makesearch(struct vars *v, struct nfa *nfa);
+static struct subre *parse(struct vars *v, int stopper, int type,
+ struct state *init, struct state *final);
+static struct subre *parsebranch(struct vars *v, int stopper, int type,
+ struct state *left, struct state *right,
+ int partial);
+static struct subre *parseqatom(struct vars *v, int stopper, int type,
+ struct state *lp, struct state *rp,
+ struct subre *top);
+static void nonword(struct vars *v, int dir, struct state *lp,
+ struct state *rp);
+static void word(struct vars *v, int dir, struct state *lp, struct state *rp);
+static void charclass(struct vars *v, enum char_classes cls, struct state *lp,
+ struct state *rp);
+static void charclasscomplement(struct vars *v, enum char_classes cls,
+ struct state *lp, struct state *rp);
+static int scannum(struct vars *v);
+static void repeat(struct vars *v, struct state *lp, struct state *rp,
+ int m, int n);
+static void bracket(struct vars *v, struct state *lp, struct state *rp);
+static void cbracket(struct vars *v, struct state *lp, struct state *rp);
+static void brackpart(struct vars *v, struct state *lp, struct state *rp,
+ bool *have_cclassc);
+static const chr *scanplain(struct vars *v);
+static void onechr(struct vars *v, chr c, struct state *lp, struct state *rp);
+static void optimizebracket(struct vars *v, struct state *lp, struct state *rp);
+static void wordchrs(struct vars *v);
+static void processlacon(struct vars *v, struct state *begin,
+ struct state *end, int latype,
+ struct state *lp, struct state *rp);
+static struct subre *subre(struct vars *v, int op, int flags,
+ struct state *begin, struct state *end);
+static void freesubre(struct vars *v, struct subre *sr);
+static void freesubreandsiblings(struct vars *v, struct subre *sr);
+static void freesrnode(struct vars *v, struct subre *sr);
+static void removecaptures(struct vars *v, struct subre *t);
+static int numst(struct subre *t, int start);
+static void markst(struct subre *t);
+static void cleanst(struct vars *v);
+static long nfatree(struct vars *v, struct subre *t, FILE *f);
+static long nfanode(struct vars *v, struct subre *t,
+ int converttosearch, FILE *f);
+static int newlacon(struct vars *v, struct state *begin, struct state *end,
+ int latype);
+static void freelacons(struct subre *subs, int n);
+static void rfree(regex_t *re);
static int rcancelrequested(void);
static int rstacktoodeep(void);
#ifdef REG_DEBUG
-static void dump(regex_t *, FILE *);
-static void dumpst(struct subre *, FILE *, int);
-static void stdump(struct subre *, FILE *, int);
-static const char *stid(struct subre *, char *, size_t);
+static void dump(regex_t *re, FILE *f);
+static void dumpst(struct subre *t, FILE *f, int nfapresent);
+static void stdump(struct subre *t, FILE *f, int nfapresent);
+static const char *stid(struct subre *t, char *buf, size_t bufsize);
#endif
/* === regc_lex.c === */
-static void lexstart(struct vars *);
-static void prefixes(struct vars *);
-static int next(struct vars *);
-static int lexescape(struct vars *);
-static chr lexdigits(struct vars *, int, int, int);
-static int brenext(struct vars *, chr);
-static void skip(struct vars *);
+static void lexstart(struct vars *v);
+static void prefixes(struct vars *v);
+static int next(struct vars *v);
+static int lexescape(struct vars *v);
+static chr lexdigits(struct vars *v, int base, int minlen, int maxlen);
+static int brenext(struct vars *v, chr c);
+static void skip(struct vars *v);
static chr newline(void);
-static chr chrnamed(struct vars *, const chr *, const chr *, chr);
+static chr chrnamed(struct vars *v, const chr *startp, const chr *endp,
+ chr lastresort);
/* === regc_color.c === */
-static void initcm(struct vars *, struct colormap *);
-static void freecm(struct colormap *);
-static color maxcolor(struct colormap *);
-static color newcolor(struct colormap *);
-static void freecolor(struct colormap *, color);
-static color pseudocolor(struct colormap *);
-static color subcolor(struct colormap *, chr);
-static color subcolorhi(struct colormap *, color *);
-static color newsub(struct colormap *, color);
-static int newhicolorrow(struct colormap *, int);
-static void newhicolorcols(struct colormap *);
-static void subcolorcvec(struct vars *, struct cvec *, struct state *, struct state *);
-static void subcoloronechr(struct vars *, chr, struct state *, struct state *, color *);
-static void subcoloronerange(struct vars *, chr, chr, struct state *, struct state *, color *);
-static void subcoloronerow(struct vars *, int, struct state *, struct state *, color *);
-static void okcolors(struct nfa *, struct colormap *);
-static void colorchain(struct colormap *, struct arc *);
-static void uncolorchain(struct colormap *, struct arc *);
-static void rainbow(struct nfa *, struct colormap *, int, color, struct state *, struct state *);
-static void colorcomplement(struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *);
+static void initcm(struct vars *v, struct colormap *cm);
+static void freecm(struct colormap *cm);
+static color maxcolor(struct colormap *cm);
+static color newcolor(struct colormap *cm);
+static void freecolor(struct colormap *cm, color co);
+static color pseudocolor(struct colormap *cm);
+static color subcolor(struct colormap *cm, chr c);
+static color subcolorhi(struct colormap *cm, color *pco);
+static color newsub(struct colormap *cm, color co);
+static int newhicolorrow(struct colormap *cm, int oldrow);
+static void newhicolorcols(struct colormap *cm);
+static void subcolorcvec(struct vars *v, struct cvec *cv, struct state *lp,
+ struct state *rp);
+static void subcoloronechr(struct vars *v, chr ch, struct state *lp,
+ struct state *rp, color *lastsubcolor);
+static void subcoloronerange(struct vars *v, chr from, chr to,
+ struct state *lp, struct state *rp,
+ color *lastsubcolor);
+static void subcoloronerow(struct vars *v, int rownum, struct state *lp,
+ struct state *rp, color *lastsubcolor);
+static void okcolors(struct nfa *nfa, struct colormap *cm);
+static void colorchain(struct colormap *cm, struct arc *a);
+static void uncolorchain(struct colormap *cm, struct arc *a);
+static void rainbow(struct nfa *nfa, struct colormap *cm, int type, color but,
+ struct state *from, struct state *to);
+static void colorcomplement(struct nfa *nfa, struct colormap *cm, int type,
+ struct state *of, struct state *from,
+ struct state *to);
#ifdef REG_DEBUG
-static void dumpcolors(struct colormap *, FILE *);
-static void dumpchr(chr, FILE *);
+static void dumpcolors(struct colormap *cm, FILE *f);
+static void dumpchr(chr c, FILE *f);
#endif
/* === regc_nfa.c === */
-static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *);
-static void freenfa(struct nfa *);
-static struct state *newstate(struct nfa *);
-static struct state *newfstate(struct nfa *, int flag);
-static void dropstate(struct nfa *, struct state *);
-static void freestate(struct nfa *, struct state *);
-static void newarc(struct nfa *, int, color, struct state *, struct state *);
-static void createarc(struct nfa *, int, color, struct state *, struct state *);
-static struct arc *allocarc(struct nfa *);
-static void freearc(struct nfa *, struct arc *);
-static void changearcsource(struct arc *, struct state *);
-static void changearctarget(struct arc *, struct state *);
-static int hasnonemptyout(struct state *);
-static struct arc *findarc(struct state *, int, color);
-static void cparc(struct nfa *, struct arc *, struct state *, struct state *);
-static void sortins(struct nfa *, struct state *);
-static int sortins_cmp(const void *, const void *);
-static void sortouts(struct nfa *, struct state *);
-static int sortouts_cmp(const void *, const void *);
-static void moveins(struct nfa *, struct state *, struct state *);
-static void copyins(struct nfa *, struct state *, struct state *);
-static void mergeins(struct nfa *, struct state *, struct arc **, int);
-static void moveouts(struct nfa *, struct state *, struct state *);
-static void copyouts(struct nfa *, struct state *, struct state *);
-static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int);
-static void delsub(struct nfa *, struct state *, struct state *);
-static void deltraverse(struct nfa *, struct state *, struct state *);
-static void dupnfa(struct nfa *, struct state *, struct state *, struct state *, struct state *);
-static void duptraverse(struct nfa *, struct state *, struct state *);
-static void removeconstraints(struct nfa *, struct state *, struct state *);
-static void removetraverse(struct nfa *, struct state *);
-static void cleartraverse(struct nfa *, struct state *);
-static struct state *single_color_transition(struct state *, struct state *);
-static void specialcolors(struct nfa *);
-static long optimize(struct nfa *, FILE *);
-static void pullback(struct nfa *, FILE *);
-static int pull(struct nfa *, struct arc *, struct state **);
-static void pushfwd(struct nfa *, FILE *);
-static int push(struct nfa *, struct arc *, struct state **);
+static struct nfa *newnfa(struct vars *v, struct colormap *cm,
+ struct nfa *parent);
+static void freenfa(struct nfa *nfa);
+static struct state *newstate(struct nfa *nfa);
+static struct state *newfstate(struct nfa *nfa, int flag);
+static void dropstate(struct nfa *nfa, struct state *s);
+static void freestate(struct nfa *nfa, struct state *s);
+static void newarc(struct nfa *nfa, int t, color co,
+ struct state *from, struct state *to);
+static void createarc(struct nfa *nfa, int t, color co,
+ struct state *from, struct state *to);
+static struct arc *allocarc(struct nfa *nfa);
+static void freearc(struct nfa *nfa, struct arc *victim);
+static void changearcsource(struct arc *a, struct state *newfrom);
+static void changearctarget(struct arc *a, struct state *newto);
+static int hasnonemptyout(struct state *s);
+static struct arc *findarc(struct state *s, int type, color co);
+static void cparc(struct nfa *nfa, struct arc *oa,
+ struct state *from, struct state *to);
+static void sortins(struct nfa *nfa, struct state *s);
+static int sortins_cmp(const void *a, const void *b);
+static void sortouts(struct nfa *nfa, struct state *s);
+static int sortouts_cmp(const void *a, const void *b);
+static void moveins(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void copyins(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void mergeins(struct nfa *nfa, struct state *s,
+ struct arc **arcarray, int arccount);
+static void moveouts(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void copyouts(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void cloneouts(struct nfa *nfa, struct state *old, struct state *from,
+ struct state *to, int type);
+static void delsub(struct nfa *nfa, struct state *lp, struct state *rp);
+static void deltraverse(struct nfa *nfa, struct state *leftend,
+ struct state *s);
+static void dupnfa(struct nfa *nfa, struct state *start, struct state *stop,
+ struct state *from, struct state *to);
+static void duptraverse(struct nfa *nfa, struct state *s, struct state *stmp);
+static void removeconstraints(struct nfa *nfa, struct state *start, struct state *stop);
+static void removetraverse(struct nfa *nfa, struct state *s);
+static void cleartraverse(struct nfa *nfa, struct state *s);
+static struct state *single_color_transition(struct state *s1,
+ struct state *s2);
+static void specialcolors(struct nfa *nfa);
+static long optimize(struct nfa *nfa, FILE *f);
+static void pullback(struct nfa *nfa, FILE *f);
+static int pull(struct nfa *nfa, struct arc *con,
+ struct state **intermediates);
+static void pushfwd(struct nfa *nfa, FILE *f);
+static int push(struct nfa *nfa, struct arc *con,
+ struct state **intermediates);
#define INCOMPATIBLE 1 /* destroys arc */
#define SATISFIED 2 /* constraint satisfied */
#define COMPATIBLE 3 /* compatible but not satisfied yet */
#define REPLACEARC 4 /* replace arc's color with constraint color */
static int combine(struct nfa *nfa, struct arc *con, struct arc *a);
-static void fixempties(struct nfa *, FILE *);
-static struct state *emptyreachable(struct nfa *, struct state *,
- struct state *, struct arc **);
-static int isconstraintarc(struct arc *);
-static int hasconstraintout(struct state *);
-static void fixconstraintloops(struct nfa *, FILE *);
-static int findconstraintloop(struct nfa *, struct state *);
-static void breakconstraintloop(struct nfa *, struct state *);
-static void clonesuccessorstates(struct nfa *, struct state *, struct state *,
- struct state *, struct arc *,
- char *, char *, int);
-static void cleanup(struct nfa *);
-static void markreachable(struct nfa *, struct state *, struct state *, struct state *);
-static void markcanreach(struct nfa *, struct state *, struct state *, struct state *);
-static long analyze(struct nfa *);
-static void checkmatchall(struct nfa *);
-static bool checkmatchall_recurse(struct nfa *, struct state *, bool **);
-static bool check_out_colors_match(struct state *, color, color);
-static bool check_in_colors_match(struct state *, color, color);
-static void compact(struct nfa *, struct cnfa *);
-static void carcsort(struct carc *, size_t);
-static int carc_cmp(const void *, const void *);
-static void freecnfa(struct cnfa *);
-static void dumpnfa(struct nfa *, FILE *);
+static void fixempties(struct nfa *nfa, FILE *f);
+static struct state *emptyreachable(struct nfa *nfa, struct state *s,
+ struct state *lastfound,
+ struct arc **inarcsorig);
+static int isconstraintarc(struct arc *a);
+static int hasconstraintout(struct state *s);
+static void fixconstraintloops(struct nfa *nfa, FILE *f);
+static int findconstraintloop(struct nfa *nfa, struct state *s);
+static void breakconstraintloop(struct nfa *nfa, struct state *sinitial);
+static void clonesuccessorstates(struct nfa *nfa, struct state *ssource,
+ struct state *sclone,
+ struct state *spredecessor,
+ struct arc *refarc, char *curdonemap,
+ char *outerdonemap, int nstates);
+static void cleanup(struct nfa *nfa);
+static void markreachable(struct nfa *nfa, struct state *s,
+ struct state *okay, struct state *mark);
+static void markcanreach(struct nfa *nfa, struct state *s, struct state *okay,
+ struct state *mark);
+static long analyze(struct nfa *nfa);
+static void checkmatchall(struct nfa *nfa);
+static bool checkmatchall_recurse(struct nfa *nfa, struct state *s,
+ bool **haspaths);
+static bool check_out_colors_match(struct state *s, color co1, color co2);
+static bool check_in_colors_match(struct state *s, color co1, color co2);
+static void compact(struct nfa *nfa, struct cnfa *cnfa);
+static void carcsort(struct carc *first, size_t n);
+static int carc_cmp(const void *a, const void *b);
+static void freecnfa(struct cnfa *cnfa);
+static void dumpnfa(struct nfa *nfa, FILE *f);
#ifdef REG_DEBUG
static void dumpstate(struct state *, FILE *);
@@ -199,12 +241,12 @@ static void dumpcnfa(struct cnfa *, FILE *);
static void dumpcstate(int, struct cnfa *, FILE *);
#endif
/* === regc_cvec.c === */
-static struct cvec *newcvec(int, int);
-static struct cvec *clearcvec(struct cvec *);
-static void addchr(struct cvec *, chr);
-static void addrange(struct cvec *, chr, chr);
-static struct cvec *getcvec(struct vars *, int, int);
-static void freecvec(struct cvec *);
+static struct cvec *newcvec(int nchrs, int nranges);
+static struct cvec *clearcvec(struct cvec *cv);
+static void addchr(struct cvec *cv, chr c);
+static void addrange(struct cvec *cv, chr from, chr to);
+static struct cvec *getcvec(struct vars *v, int nchrs, int nranges);
+static void freecvec(struct cvec *cv);
/* === regc_pg_locale.c === */
static int pg_wc_isdigit(pg_wchar c);
@@ -221,16 +263,18 @@ static pg_wchar pg_wc_toupper(pg_wchar c);
static pg_wchar pg_wc_tolower(pg_wchar c);
/* === regc_locale.c === */
-static chr element(struct vars *, const chr *, const chr *);
-static struct cvec *range(struct vars *, chr, chr, int);
-static int before(chr, chr);
-static struct cvec *eclass(struct vars *, chr, int);
-static enum char_classes lookupcclass(struct vars *, const chr *, const chr *);
-static struct cvec *cclasscvec(struct vars *, enum char_classes, int);
-static int cclass_column_index(struct colormap *, chr);
-static struct cvec *allcases(struct vars *, chr);
-static int cmp(const chr *, const chr *, size_t);
-static int casecmp(const chr *, const chr *, size_t);
+static chr element(struct vars *v, const chr *startp, const chr *endp);
+static struct cvec *range(struct vars *v, chr a, chr b, int cases);
+static int before(chr x, chr y);
+static struct cvec *eclass(struct vars *v, chr c, int cases);
+static enum char_classes lookupcclass(struct vars *v, const chr *startp,
+ const chr *endp);
+static struct cvec *cclasscvec(struct vars *v, enum char_classes cclasscode,
+ int cases);
+static int cclass_column_index(struct colormap *cm, chr c);
+static struct cvec *allcases(struct vars *v, chr c);
+static int cmp(const chr *x, const chr *y, size_t len);
+static int casecmp(const chr *x, const chr *y, size_t len);
/* internal variables, bundled for easy passing around */
diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c
index 927154436..29c364f3d 100644
--- a/src/backend/regex/regexec.c
+++ b/src/backend/regex/regexec.c
@@ -137,36 +137,45 @@ struct vars
* forward declarations
*/
/* === regexec.c === */
-static struct dfa *getsubdfa(struct vars *, struct subre *);
-static struct dfa *getladfa(struct vars *, int);
-static int find(struct vars *, struct cnfa *, struct colormap *);
-static int cfind(struct vars *, struct cnfa *, struct colormap *);
-static int cfindloop(struct vars *, struct cnfa *, struct colormap *, struct dfa *, struct dfa *, chr **);
-static void zapallsubs(regmatch_t *, size_t);
-static void zaptreesubs(struct vars *, struct subre *);
-static void subset(struct vars *, struct subre *, chr *, chr *);
-static int cdissect(struct vars *, struct subre *, chr *, chr *);
-static int ccondissect(struct vars *, struct subre *, chr *, chr *);
-static int crevcondissect(struct vars *, struct subre *, chr *, chr *);
-static int cbrdissect(struct vars *, struct subre *, chr *, chr *);
-static int caltdissect(struct vars *, struct subre *, chr *, chr *);
-static int citerdissect(struct vars *, struct subre *, chr *, chr *);
-static int creviterdissect(struct vars *, struct subre *, chr *, chr *);
+static struct dfa *getsubdfa(struct vars *v, struct subre *t);
+static struct dfa *getladfa(struct vars *v, int n);
+static int find(struct vars *v, struct cnfa *cnfa, struct colormap *cm);
+static int cfind(struct vars *v, struct cnfa *cnfa, struct colormap *cm);
+static int cfindloop(struct vars *v, struct cnfa *cnfa, struct colormap *cm,
+ struct dfa *d, struct dfa *s, chr **coldp);
+static void zapallsubs(regmatch_t *p, size_t n);
+static void zaptreesubs(struct vars *v, struct subre *t);
+static void subset(struct vars *v, struct subre *sub, chr *begin, chr *end);
+static int cdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int ccondissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int crevcondissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int cbrdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int caltdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int citerdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int creviterdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
/* === rege_dfa.c === */
-static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *);
-static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, chr **, int *);
-static int matchuntil(struct vars *, struct dfa *, chr *, struct sset **, chr **);
-static chr *dfa_backref(struct vars *, struct dfa *, chr *, chr *, chr *, bool);
-static chr *lastcold(struct vars *, struct dfa *);
-static struct dfa *newdfa(struct vars *, struct cnfa *, struct colormap *, struct smalldfa *);
-static void freedfa(struct dfa *);
-static unsigned hash(unsigned *, int);
-static struct sset *initialize(struct vars *, struct dfa *, chr *);
-static struct sset *miss(struct vars *, struct dfa *, struct sset *, color, chr *, chr *);
-static int lacon(struct vars *, struct cnfa *, chr *, color);
-static struct sset *getvacant(struct vars *, struct dfa *, chr *, chr *);
-static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *);
+static chr *longest(struct vars *v, struct dfa *d,
+ chr *start, chr *stop, int *hitstopp);
+static chr *shortest(struct vars *v, struct dfa *d, chr *start, chr *min,
+ chr *max, chr **coldp, int *hitstopp);
+static int matchuntil(struct vars *v, struct dfa *d, chr *probe,
+ struct sset **lastcss, chr **lastcp);
+static chr *dfa_backref(struct vars *v, struct dfa *d, chr *start,
+ chr *min, chr *max, bool shortest);
+static chr *lastcold(struct vars *v, struct dfa *d);
+static struct dfa *newdfa(struct vars *v, struct cnfa *cnfa,
+ struct colormap *cm, struct smalldfa *sml);
+static void freedfa(struct dfa *d);
+static unsigned hash(unsigned *uv, int n);
+static struct sset *initialize(struct vars *v, struct dfa *d, chr *start);
+static struct sset *miss(struct vars *v, struct dfa *d, struct sset *css,
+ color co, chr *cp, chr *start);
+static int lacon(struct vars *v, struct cnfa *pcnfa, chr *cp, color co);
+static struct sset *getvacant(struct vars *v, struct dfa *d, chr *cp,
+ chr *start);
+static struct sset *pickss(struct vars *v, struct dfa *d, chr *cp,
+ chr *start);
/*
diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c
index e02fc3725..8e671b9fa 100644
--- a/src/backend/utils/adt/like.c
+++ b/src/backend/utils/adt/like.c
@@ -33,11 +33,11 @@
static int SB_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
-static text *SB_do_like_escape(text *, text *);
+static text *SB_do_like_escape(text *pat, text *esc);
static int MB_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
-static text *MB_do_like_escape(text *, text *);
+static text *MB_do_like_escape(text *pat, text *esc);
static int UTF8_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index 02ab604ec..aea466173 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -75,7 +75,7 @@ static int openssl_verify_peer_name_matches_certificate_ip(PGconn *conn,
char **store_name);
static void destroy_ssl_system(void);
static int initialize_SSL(PGconn *conn);
-static PostgresPollingStatusType open_client_SSL(PGconn *);
+static PostgresPollingStatusType open_client_SSL(PGconn *conn);
static char *SSLerrmessage(unsigned long ecode);
static void SSLerrfree(char *buf);
static int PQssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index d4b4da5ff..58119d110 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -233,7 +233,7 @@ get_type(enum ECPGttype type)
*/
static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize,
- char *arrsize, const char *size, const char *prefix, int);
+ char *arrsize, const char *size, const char *prefix, int counter);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize,
struct ECPGtype *type, struct ECPGtype *ind_type, const char *prefix, const char *ind_prefix);
diff --git a/src/timezone/localtime.c b/src/timezone/localtime.c
index fa3c05903..ad83c7ee5 100644
--- a/src/timezone/localtime.c
+++ b/src/timezone/localtime.c
@@ -82,13 +82,15 @@ struct rule
* Prototypes for static functions.
*/
-static struct pg_tm *gmtsub(pg_time_t const *, int32, struct pg_tm *);
-static bool increment_overflow(int *, int);
-static bool increment_overflow_time(pg_time_t *, int32);
-static int64 leapcorr(struct state const *, pg_time_t);
-static struct pg_tm *timesub(pg_time_t const *, int32, struct state const *,
- struct pg_tm *);
-static bool typesequiv(struct state const *, int, int);
+static struct pg_tm *gmtsub(pg_time_t const *timep, int32 offset,
+ struct pg_tm *tmp);
+static bool increment_overflow(int *ip, int j);
+static bool increment_overflow_time(pg_time_t *tp, int32 j);
+static int64 leapcorr(struct state const *sp, pg_time_t t);
+static struct pg_tm *timesub(pg_time_t const *timep,
+ int32 offset, struct state const *sp,
+ struct pg_tm *tmp);
+static bool typesequiv(struct state const *sp, int a, int b);
/*
diff --git a/src/timezone/strftime.c b/src/timezone/strftime.c
index dd6c7db86..9247a3415 100644
--- a/src/timezone/strftime.c
+++ b/src/timezone/strftime.c
@@ -111,11 +111,11 @@ enum warn
IN_NONE, IN_SOME, IN_THIS, IN_ALL
};
-static char *_add(const char *, char *, const char *);
-static char *_conv(int, const char *, char *, const char *);
-static char *_fmt(const char *, const struct pg_tm *, char *, const char *,
- enum warn *);
-static char *_yconv(int, int, bool, bool, char *, char const *);
+static char *_add(const char *str, char *pt, const char *ptlim);
+static char *_conv(int n, const char *format, char *pt, const char *ptlim);
+static char *_fmt(const char *format, const struct pg_tm *t, char *pt, const char *ptlim,
+ enum warn *warnp);
+static char *_yconv(int a, int b, bool convert_top, bool convert_yy, char *pt, char const *ptlim);
/*
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 10d5499ec..d6c514192 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -123,27 +123,29 @@ static void error(const char *string,...) pg_attribute_printf(1, 2);
static void warning(const char *string,...) pg_attribute_printf(1, 2);
static void usage(FILE *stream, int status) pg_attribute_noreturn();
static void addtt(zic_t starttime, int type);
-static int addtype(zic_t, char const *, bool, bool, bool);
-static void leapadd(zic_t, int, int);
+static int addtype(zic_t utoff, char const *abbr,
+ bool isdst, bool ttisstd, bool ttisut);
+static void leapadd(zic_t t, int correction, int rolling);
static void adjleap(void);
static void associate(void);
-static void dolink(const char *, const char *, bool);
+static void dolink(char const *target, char const *linkname,
+ bool staysymlink);
static char **getfields(char *cp);
static zic_t gethms(const char *string, const char *errstring);
-static zic_t getsave(char *, bool *);
-static void inexpires(char **, int);
+static zic_t getsave(char *field, bool *isdst);
+static void inexpires(char **fields, int nfields);
static void infile(const char *name);
static void inleap(char **fields, int nfields);
static void inlink(char **fields, int nfields);
static void inrule(char **fields, int nfields);
static bool inzcont(char **fields, int nfields);
static bool inzone(char **fields, int nfields);
-static bool inzsub(char **, int, bool);
-static bool itsdir(char const *);
-static bool itssymlink(char const *);
+static bool inzsub(char **fields, int nfields, bool iscont);
+static bool itsdir(char const *name);
+static bool itssymlink(char const *name);
static bool is_alpha(char a);
-static char lowerit(char);
-static void mkdirs(char const *, bool);
+static char lowerit(char a);
+static void mkdirs(char const *argname, bool ancestors);
static void newabbr(const char *string);
static zic_t oadd(zic_t t1, zic_t t2);
static void outzone(const struct zone *zpfirst, ptrdiff_t zonecount);
--
2.34.1
v2-0001-Harmonize-parameter-names.patchapplication/octet-stream; name=v2-0001-Harmonize-parameter-names.patchDownload
From 59146fe3b15a7222b9bd72f6b284ea16d9684ab4 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 16:48:24 -0700
Subject: [PATCH v2 1/3] Harmonize parameter names
---
src/include/access/genam.h | 9 ++-
src/include/access/generic_xlog.h | 2 +-
src/include/access/gin_private.h | 8 +-
src/include/access/gist_private.h | 18 ++---
src/include/access/heapam.h | 26 +++----
src/include/access/heapam_xlog.h | 4 +-
src/include/access/htup_details.h | 2 +-
src/include/access/multixact.h | 7 +-
src/include/access/rewriteheap.h | 12 +--
src/include/access/tableam.h | 8 +-
src/include/access/tupconvert.h | 2 +-
src/include/access/twophase.h | 2 +-
src/include/access/xact.h | 8 +-
src/include/access/xlog.h | 8 +-
src/include/access/xlogreader.h | 2 +-
src/include/access/xlogrecovery.h | 4 +-
src/include/access/xlogutils.h | 4 +-
src/include/catalog/dependency.h | 6 +-
src/include/catalog/objectaccess.h | 12 +--
src/include/catalog/objectaddress.h | 4 +-
src/include/catalog/pg_conversion.h | 2 +-
src/include/catalog/pg_inherits.h | 5 +-
src/include/catalog/pg_publication.h | 2 +-
src/include/commands/alter.h | 2 +-
src/include/commands/cluster.h | 2 +-
src/include/commands/conversioncmds.h | 2 +-
src/include/commands/copy.h | 4 +-
src/include/commands/dbcommands_xlog.h | 4 +-
src/include/commands/policy.h | 2 +-
src/include/commands/publicationcmds.h | 2 +-
src/include/commands/schemacmds.h | 2 +-
src/include/commands/sequence.h | 8 +-
src/include/commands/tablecmds.h | 2 +-
src/include/commands/tablespace.h | 4 +-
src/include/commands/trigger.h | 8 +-
src/include/commands/typecmds.h | 2 +-
src/include/common/fe_memutils.h | 4 +-
src/include/common/kwlookup.h | 2 +-
src/include/common/scram-common.h | 2 +-
src/include/executor/execParallel.h | 4 +-
src/include/executor/executor.h | 2 +-
src/include/executor/spi.h | 2 +-
src/include/fe_utils/parallel_slot.h | 2 +-
src/include/fe_utils/simple_list.h | 2 +-
src/include/fe_utils/string_utils.h | 2 +-
src/include/funcapi.h | 2 +-
src/include/libpq/hba.h | 2 +-
src/include/libpq/pqmq.h | 2 +-
src/include/mb/pg_wchar.h | 4 +-
src/include/miscadmin.h | 2 +-
src/include/nodes/nodes.h | 2 +-
src/include/nodes/params.h | 4 +-
src/include/nodes/value.h | 2 +-
src/include/optimizer/appendinfo.h | 2 +-
src/include/optimizer/clauses.h | 4 +-
src/include/optimizer/paths.h | 4 +-
src/include/optimizer/planmain.h | 2 +-
src/include/parser/analyze.h | 2 +-
src/include/parser/parse_agg.h | 2 +-
src/include/parser/parse_oper.h | 4 +-
src/include/parser/parse_relation.h | 2 +-
src/include/partitioning/partbounds.h | 4 +-
src/include/pgstat.h | 10 +--
src/include/pgtime.h | 4 +-
src/include/port.h | 6 +-
src/include/replication/logicalproto.h | 6 +-
src/include/replication/reorderbuffer.h | 12 +--
src/include/replication/slot.h | 2 +-
src/include/replication/snapbuild.h | 13 ++--
src/include/replication/walsender.h | 2 +-
src/include/rewrite/rewriteManip.h | 2 +-
src/include/snowball/libstemmer/header.h | 2 +-
src/include/statistics/statistics.h | 4 +-
src/include/storage/barrier.h | 2 +-
src/include/storage/bufpage.h | 4 +-
src/include/storage/fd.h | 14 ++--
src/include/storage/fsm_internals.h | 2 +-
src/include/storage/indexfsm.h | 4 +-
src/include/storage/predicate.h | 2 +-
src/include/storage/standby.h | 2 +-
src/include/tcop/cmdtag.h | 2 +-
src/include/tsearch/ts_utils.h | 4 +-
src/include/utils/acl.h | 6 +-
src/include/utils/attoptcache.h | 2 +-
src/include/utils/builtins.h | 8 +-
src/include/utils/datetime.h | 2 +-
src/include/utils/jsonb.h | 4 +-
src/include/utils/multirangetypes.h | 6 +-
src/include/utils/numeric.h | 2 +-
src/include/utils/pgstat_internal.h | 4 +-
src/include/utils/rangetypes.h | 4 +-
src/include/utils/regproc.h | 2 +-
src/include/utils/relcache.h | 2 +-
src/include/utils/relmapper.h | 2 +-
src/include/utils/selfuncs.h | 4 +-
src/include/utils/snapmgr.h | 2 +-
src/include/utils/timestamp.h | 4 +-
src/backend/access/brin/brin_minmax_multi.c | 3 +-
src/backend/access/common/heaptuple.c | 14 ++--
src/backend/access/gist/gistbuildbuffers.c | 4 +-
src/backend/access/heap/heapam.c | 2 +-
src/backend/access/heap/visibilitymap.c | 50 ++++++------
src/backend/access/table/tableam.c | 11 ++-
src/backend/access/transam/generic_xlog.c | 2 +-
src/backend/access/transam/multixact.c | 6 +-
src/backend/access/transam/xact.c | 2 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/access/transam/xlogreader.c | 2 +-
src/backend/catalog/aclchk.c | 22 +++---
src/backend/commands/dbcommands.c | 8 +-
src/backend/commands/event_trigger.c | 2 +-
src/backend/commands/explain.c | 2 +-
src/backend/commands/lockcmds.c | 2 +-
src/backend/commands/schemacmds.c | 6 +-
src/backend/commands/tablecmds.c | 6 +-
src/backend/commands/trigger.c | 8 +-
src/backend/executor/execIndexing.c | 2 +-
src/backend/executor/execParallel.c | 4 +-
src/backend/executor/nodeAgg.c | 11 ++-
src/backend/executor/nodeHash.c | 6 +-
src/backend/executor/nodeHashjoin.c | 6 +-
src/backend/executor/nodeIncrementalSort.c | 4 +-
src/backend/executor/nodeMemoize.c | 4 +-
src/backend/lib/bloomfilter.c | 2 +-
src/backend/lib/integerset.c | 4 +-
src/backend/optimizer/geqo/geqo_selection.c | 2 +-
src/backend/optimizer/util/plancat.c | 3 +-
src/backend/parser/gram.y | 3 +-
src/backend/parser/parse_clause.c | 2 +-
src/backend/parser/parse_utilcmd.c | 2 +-
src/backend/partitioning/partbounds.c | 6 +-
src/backend/postmaster/postmaster.c | 6 +-
.../replication/logical/reorderbuffer.c | 2 +-
src/backend/replication/pgoutput/pgoutput.c | 4 +-
src/backend/replication/slot.c | 2 +-
src/backend/statistics/extended_stats.c | 4 +-
src/backend/storage/buffer/bufmgr.c | 4 +-
src/backend/storage/lmgr/predicate.c | 2 +-
src/backend/storage/smgr/md.c | 42 +++++-----
src/backend/utils/adt/datetime.c | 22 +++---
src/backend/utils/adt/geo_ops.c | 8 +-
src/backend/utils/adt/jsonb_util.c | 77 ++++++++++---------
src/backend/utils/adt/jsonpath_exec.c | 4 +-
src/backend/utils/adt/numeric.c | 6 +-
src/backend/utils/adt/rangetypes.c | 4 +-
src/backend/utils/adt/ri_triggers.c | 2 +-
src/backend/utils/adt/timestamp.c | 4 +-
src/backend/utils/cache/relmapper.c | 2 +-
.../euc_jp_and_sjis/euc_jp_and_sjis.c | 4 +-
.../euc_tw_and_big5/euc_tw_and_big5.c | 2 +-
src/backend/utils/misc/queryjumble.c | 3 +-
src/backend/utils/time/snapmgr.c | 29 +++----
src/bin/initdb/initdb.c | 2 +-
src/bin/pg_basebackup/pg_receivewal.c | 2 +-
src/bin/pg_basebackup/streamutil.h | 2 +-
src/bin/pg_rewind/file_ops.h | 4 +-
src/bin/pg_rewind/pg_rewind.h | 2 +-
src/bin/pg_upgrade/info.c | 2 +-
src/bin/pg_verifybackup/pg_verifybackup.c | 2 +-
src/bin/pgbench/pgbench.h | 8 +-
src/bin/psql/describe.h | 6 +-
src/bin/scripts/common.h | 2 +-
src/interfaces/libpq/fe-connect.c | 2 +-
src/interfaces/libpq/fe-exec.c | 14 ++--
src/interfaces/libpq/fe-secure-common.h | 4 +-
src/interfaces/libpq/fe-secure-openssl.c | 2 +-
src/interfaces/libpq/libpq-fe.h | 4 +-
src/pl/plpgsql/src/pl_exec.c | 2 +-
src/interfaces/ecpg/preproc/c_keywords.c | 8 +-
src/interfaces/ecpg/preproc/output.c | 2 +-
src/interfaces/ecpg/preproc/preproc_extern.h | 4 +-
src/timezone/zic.c | 12 +--
172 files changed, 483 insertions(+), 473 deletions(-)
diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index 134b20f1e..e1c4fdbd0 100644
--- a/src/include/access/genam.h
+++ b/src/include/access/genam.h
@@ -161,9 +161,10 @@ extern void index_rescan(IndexScanDesc scan,
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
-extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot);
-extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel,
- Snapshot snapshot, ParallelIndexScanDesc target);
+extern Size index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot);
+extern void index_parallelscan_initialize(Relation heapRelation,
+ Relation indexRelation, Snapshot snapshot,
+ ParallelIndexScanDesc target);
extern void index_parallelrescan(IndexScanDesc scan);
extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
Relation indexrel, int nkeys, int norderbys,
@@ -191,7 +192,7 @@ extern void index_store_float8_orderby_distances(IndexScanDesc scan,
Oid *orderByTypes,
IndexOrderByDistance *distances,
bool recheckOrderBy);
-extern bytea *index_opclass_options(Relation relation, AttrNumber attnum,
+extern bytea *index_opclass_options(Relation indrel, AttrNumber attnum,
Datum attoptions, bool validate);
diff --git a/src/include/access/generic_xlog.h b/src/include/access/generic_xlog.h
index c8363a476..da4565642 100644
--- a/src/include/access/generic_xlog.h
+++ b/src/include/access/generic_xlog.h
@@ -40,6 +40,6 @@ extern void GenericXLogAbort(GenericXLogState *state);
extern void generic_redo(XLogReaderState *record);
extern const char *generic_identify(uint8 info);
extern void generic_desc(StringInfo buf, XLogReaderState *record);
-extern void generic_mask(char *pagedata, BlockNumber blkno);
+extern void generic_mask(char *page, BlockNumber blkno);
#endif /* GENERIC_XLOG_H */
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index 2935d2f35..39b51573d 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -240,7 +240,7 @@ extern void ginDataFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page
*/
typedef struct GinVacuumState GinVacuumState;
-extern void ginVacuumPostingTreeLeaf(Relation rel, Buffer buf, GinVacuumState *gvs);
+extern void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer, GinVacuumState *gvs);
/* ginscan.c */
@@ -469,10 +469,10 @@ extern void ginInsertCleanup(GinState *ginstate, bool full_clean,
extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd,
int maxsize, int *nwritten);
-extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int totalsize, TIDBitmap *tbm);
+extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int len, TIDBitmap *tbm);
-extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *ptr, int len, int *ndecoded);
-extern ItemPointer ginPostingListDecode(GinPostingList *ptr, int *ndecoded);
+extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *segment, int len, int *ndecoded_out);
+extern ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded);
extern ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na,
ItemPointerData *b, uint32 nb,
int *nmerged);
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 240131ef7..093bf2344 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -445,16 +445,16 @@ extern void gistXLogPageReuse(Relation rel, BlockNumber blkno,
extern XLogRecPtr gistXLogUpdate(Buffer buffer,
OffsetNumber *todelete, int ntodelete,
- IndexTuple *itup, int ntup,
- Buffer leftchild);
+ IndexTuple *itup, int ituplen,
+ Buffer leftchildbuf);
extern XLogRecPtr gistXLogDelete(Buffer buffer, OffsetNumber *todelete,
int ntodelete, TransactionId latestRemovedXid);
extern XLogRecPtr gistXLogSplit(bool page_is_leaf,
SplitedPageLayout *dist,
- BlockNumber origrlink, GistNSN oldnsn,
- Buffer leftchild, bool markfollowright);
+ BlockNumber origrlink, GistNSN orignsn,
+ Buffer leftchildbuf, bool markfollowright);
extern XLogRecPtr gistXLogAssignLSN(void);
@@ -516,8 +516,8 @@ extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
bool l, bool isNull);
extern float gistpenalty(GISTSTATE *giststate, int attno,
- GISTENTRY *key1, bool isNull1,
- GISTENTRY *key2, bool isNull2);
+ GISTENTRY *orig, bool isNullOrig,
+ GISTENTRY *add, bool isNullAdd);
extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len,
Datum *attr, bool *isnull);
extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b);
@@ -556,11 +556,11 @@ extern GISTBuildBuffers *gistInitBuildBuffers(int pagesPerBuffer, int levelStep,
int maxLevel);
extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb,
GISTSTATE *giststate,
- BlockNumber blkno, int level);
+ BlockNumber nodeBlocknum, int level);
extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple itup);
extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple *item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple *itup);
extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb);
extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb,
GISTSTATE *giststate, Relation r,
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index abf62d9df..9dab35551 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -118,13 +118,13 @@ extern TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot,
int nkeys, ScanKey key,
ParallelTableScanDesc parallel_scan,
uint32 flags);
-extern void heap_setscanlimits(TableScanDesc scan, BlockNumber startBlk,
+extern void heap_setscanlimits(TableScanDesc sscan, BlockNumber startBlk,
BlockNumber numBlks);
-extern void heapgetpage(TableScanDesc scan, BlockNumber page);
-extern void heap_rescan(TableScanDesc scan, ScanKey key, bool set_params,
+extern void heapgetpage(TableScanDesc sscan, BlockNumber page);
+extern void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params,
bool allow_strat, bool allow_sync, bool allow_pagemode);
-extern void heap_endscan(TableScanDesc scan);
-extern HeapTuple heap_getnext(TableScanDesc scan, ScanDirection direction);
+extern void heap_endscan(TableScanDesc sscan);
+extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
extern bool heap_getnextslot(TableScanDesc sscan,
ScanDirection direction, struct TupleTableSlot *slot);
extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
@@ -138,7 +138,7 @@ extern bool heap_hot_search_buffer(ItemPointer tid, Relation relation,
Buffer buffer, Snapshot snapshot, HeapTuple heapTuple,
bool *all_dead, bool first_call);
-extern void heap_get_latest_tid(TableScanDesc scan, ItemPointer tid);
+extern void heap_get_latest_tid(TableScanDesc sscan, ItemPointer tid);
extern BulkInsertState GetBulkInsertState(void);
extern void FreeBulkInsertState(BulkInsertState);
@@ -160,7 +160,7 @@ extern TM_Result heap_update(Relation relation, ItemPointer otid,
struct TM_FailureData *tmfd, LockTupleMode *lockmode);
extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
- bool follow_update,
+ bool follow_updates,
Buffer *buffer, struct TM_FailureData *tmfd);
extern void heap_inplace_update(Relation relation, HeapTuple tuple);
@@ -187,7 +187,7 @@ extern void heap_page_prune_opt(Relation relation, Buffer buffer);
extern int heap_page_prune(Relation relation, Buffer buffer,
struct GlobalVisState *vistest,
TransactionId old_snap_xmin,
- TimestampTz old_snap_ts_ts,
+ TimestampTz old_snap_ts,
int *nnewlpdead,
OffsetNumber *off_loc);
extern void heap_page_prune_execute(Buffer buffer,
@@ -202,13 +202,13 @@ extern void heap_vacuum_rel(Relation rel,
struct VacuumParams *params, BufferAccessStrategy bstrategy);
/* in heap/heapam_visibility.c */
-extern bool HeapTupleSatisfiesVisibility(HeapTuple stup, Snapshot snapshot,
+extern bool HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot,
Buffer buffer);
-extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple stup, CommandId curcid,
+extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple stup, TransactionId OldestXmin,
+extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple stup, Buffer buffer,
+extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple htup, Buffer buffer,
TransactionId *dead_after);
extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
uint16 infomask, TransactionId xid);
@@ -227,7 +227,7 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
HeapTuple htup,
Buffer buffer,
CommandId *cmin, CommandId *cmax);
-extern void HeapCheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple,
+extern void HeapCheckForSerializableConflictOut(bool visible, Relation relation, HeapTuple tuple,
Buffer buffer, Snapshot snapshot);
#endif /* HEAPAM_H */
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index 1705e736b..34220d93c 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -414,8 +414,8 @@ extern bool heap_prepare_freeze_tuple(HeapTupleHeader tuple,
TransactionId *relfrozenxid_out,
MultiXactId *relminmxid_out);
extern void heap_execute_freeze_tuple(HeapTupleHeader tuple,
- xl_heap_freeze_tuple *xlrec_tp);
+ xl_heap_freeze_tuple *frz);
extern XLogRecPtr log_heap_visible(RelFileLocator rlocator, Buffer heap_buffer,
- Buffer vm_buffer, TransactionId cutoff_xid, uint8 flags);
+ Buffer vm_buffer, TransactionId cutoff_xid, uint8 vmflags);
#endif /* HEAPAM_XLOG_H */
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h
index 51a60eda0..9561c835f 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -699,7 +699,7 @@ extern void heap_fill_tuple(TupleDesc tupleDesc,
uint16 *infomask, bits8 *bit);
extern bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc);
extern Datum nocachegetattr(HeapTuple tup, int attnum,
- TupleDesc att);
+ TupleDesc tupleDesc);
extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
bool *isnull);
extern Datum getmissingattr(TupleDesc tupleDesc,
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index a5600a320..4cbe17de7 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -112,8 +112,8 @@ extern MultiXactId ReadNextMultiXactId(void);
extern void ReadMultiXactIdRange(MultiXactId *oldest, MultiXactId *next);
extern bool MultiXactIdIsRunning(MultiXactId multi, bool isLockOnly);
extern void MultiXactIdSetOldestMember(void);
-extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **xids,
- bool allow_old, bool isLockOnly);
+extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
+ bool from_pgupgrade, bool isLockOnly);
extern bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2);
extern bool MultiXactIdPrecedesOrEquals(MultiXactId multi1,
MultiXactId multi2);
@@ -140,7 +140,8 @@ extern void MultiXactGetCheckptMulti(bool is_shutdown,
Oid *oldestMultiDB);
extern void CheckPointMultiXact(void);
extern MultiXactId GetOldestMultiXactId(void);
-extern void TruncateMultiXact(MultiXactId oldestMulti, Oid oldestMultiDB);
+extern void TruncateMultiXact(MultiXactId newOldestMulti,
+ Oid newOldestMultiDB);
extern void MultiXactSetNextMXact(MultiXactId nextMulti,
MultiXactOffset nextMultiOffset);
extern void MultiXactAdvanceNextMXact(MultiXactId minMulti,
diff --git a/src/include/access/rewriteheap.h b/src/include/access/rewriteheap.h
index 353cbb292..5cc04756a 100644
--- a/src/include/access/rewriteheap.h
+++ b/src/include/access/rewriteheap.h
@@ -21,13 +21,13 @@
/* struct definition is private to rewriteheap.c */
typedef struct RewriteStateData *RewriteState;
-extern RewriteState begin_heap_rewrite(Relation OldHeap, Relation NewHeap,
- TransactionId OldestXmin, TransactionId FreezeXid,
- MultiXactId MultiXactCutoff);
+extern RewriteState begin_heap_rewrite(Relation old_heap, Relation new_heap,
+ TransactionId oldest_xmin, TransactionId freeze_xid,
+ MultiXactId cutoff_multi);
extern void end_heap_rewrite(RewriteState state);
-extern void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple,
- HeapTuple newTuple);
-extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple);
+extern void rewrite_heap_tuple(RewriteState state, HeapTuple old_tuple,
+ HeapTuple new_tuple);
+extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple);
/*
* On-Disk data format for an individual logical rewrite mapping.
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index ffe265d2a..e45d73eae 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -863,13 +863,13 @@ typedef struct TableAmRoutine
* for the relation. Works for tables, views, foreign tables and partitioned
* tables.
*/
-extern const TupleTableSlotOps *table_slot_callbacks(Relation rel);
+extern const TupleTableSlotOps *table_slot_callbacks(Relation relation);
/*
* Returns slot using the callbacks returned by table_slot_callbacks(), and
* registers it on *reglist.
*/
-extern TupleTableSlot *table_slot_create(Relation rel, List **reglist);
+extern TupleTableSlot *table_slot_create(Relation relation, List **reglist);
/* ----------------------------------------------------------------------------
@@ -895,7 +895,7 @@ table_beginscan(Relation rel, Snapshot snapshot,
* Like table_beginscan(), but for scanning catalog. It'll automatically use a
* snapshot appropriate for scanning catalog relations.
*/
-extern TableScanDesc table_beginscan_catalog(Relation rel, int nkeys,
+extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
struct ScanKeyData *key);
/*
@@ -1133,7 +1133,7 @@ extern void table_parallelscan_initialize(Relation rel,
*
* Caller must hold a suitable lock on the relation.
*/
-extern TableScanDesc table_beginscan_parallel(Relation rel,
+extern TableScanDesc table_beginscan_parallel(Relation relation,
ParallelTableScanDesc pscan);
/*
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h
index f5a5fd826..a37dafc66 100644
--- a/src/include/access/tupconvert.h
+++ b/src/include/access/tupconvert.h
@@ -44,7 +44,7 @@ extern HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map
extern TupleTableSlot *execute_attr_map_slot(AttrMap *attrMap,
TupleTableSlot *in_slot,
TupleTableSlot *out_slot);
-extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *inbitmap);
+extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols);
extern void free_conversion_map(TupleConversionMap *map);
diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h
index 5d6544e26..f94fded10 100644
--- a/src/include/access/twophase.h
+++ b/src/include/access/twophase.h
@@ -60,6 +60,6 @@ extern void PrepareRedoAdd(char *buf, XLogRecPtr start_lsn,
XLogRecPtr end_lsn, RepOriginId origin_id);
extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
extern void restoreTwoPhaseData(void);
-extern bool LookupGXact(const char *gid, XLogRecPtr prepare_at_lsn,
+extern bool LookupGXact(const char *gid, XLogRecPtr prepare_end_lsn,
TimestampTz origin_prepare_timestamp);
#endif /* TWOPHASE_H */
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index 300baae12..c604ee11f 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -490,8 +490,8 @@ extern int xactGetCommittedChildren(TransactionId **ptr);
extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval,
int xactflags,
@@ -501,8 +501,8 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int xactflags, TransactionId twophase_xid,
const char *twophase_gid);
extern void xact_redo(XLogReaderState *record);
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 9ebd321ba..3dbfa6b59 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -197,15 +197,15 @@ extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
uint8 flags,
int num_fpi,
bool topxid_included);
-extern void XLogFlush(XLogRecPtr RecPtr);
+extern void XLogFlush(XLogRecPtr record);
extern bool XLogBackgroundFlush(void);
-extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
-extern int XLogFileInit(XLogSegNo segno, TimeLineID tli);
+extern bool XLogNeedsFlush(XLogRecPtr record);
+extern int XLogFileInit(XLogSegNo logsegno, TimeLineID logtli);
extern int XLogFileOpen(XLogSegNo segno, TimeLineID tli);
extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli);
extern XLogSegNo XLogGetLastRemovedSegno(void);
-extern void XLogSetAsyncXactLSN(XLogRecPtr record);
+extern void XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN);
extern void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn);
extern void xlog_redo(XLogReaderState *record);
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 6afec33d4..6dcde2523 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -400,7 +400,7 @@ extern bool DecodeXLogRecord(XLogReaderState *state,
DecodedXLogRecord *decoded,
XLogRecord *record,
XLogRecPtr lsn,
- char **errmsg);
+ char **errormsg);
/*
* Macros that provide access to parts of the record most recently returned by
diff --git a/src/include/access/xlogrecovery.h b/src/include/access/xlogrecovery.h
index 0aa85d90e..0e3e246bd 100644
--- a/src/include/access/xlogrecovery.h
+++ b/src/include/access/xlogrecovery.h
@@ -80,7 +80,9 @@ extern PGDLLIMPORT bool StandbyMode;
extern Size XLogRecoveryShmemSize(void);
extern void XLogRecoveryShmemInit(void);
-extern void InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdownPtr, bool *haveBackupLabel, bool *haveTblspcMap);
+extern void InitWalRecovery(ControlFileData *ControlFile,
+ bool *wasShutdown_ptr, bool *haveBackupLabel_ptr,
+ bool *haveTblspcMap_ptr);
extern void PerformWalRecovery(void);
/*
diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h
index ef182977b..18dc5f99a 100644
--- a/src/include/access/xlogutils.h
+++ b/src/include/access/xlogutils.h
@@ -82,10 +82,10 @@ typedef struct ReadLocalXLogPageNoWaitPrivate
} ReadLocalXLogPageNoWaitPrivate;
extern XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record,
- uint8 buffer_id, Buffer *buf);
+ uint8 block_id, Buffer *buf);
extern Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id);
extern XLogRedoAction XLogReadBufferForRedoExtended(XLogReaderState *record,
- uint8 buffer_id,
+ uint8 block_id,
ReadBufferMode mode, bool get_cleanup_lock,
Buffer *buf);
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index 729c4c46c..98a1a8428 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -249,7 +249,7 @@ extern void recordDependencyOnTablespace(Oid classId, Oid objectId,
extern void changeDependencyOnTablespace(Oid classId, Oid objectId,
Oid newTablespaceId);
-extern void updateAclDependencies(Oid classId, Oid objectId, int32 objectSubId,
+extern void updateAclDependencies(Oid classId, Oid objectId, int32 objsubId,
Oid ownerId,
int noldmembers, Oid *oldmembers,
int nnewmembers, Oid *newmembers);
@@ -263,8 +263,8 @@ extern void copyTemplateDependencies(Oid templateDbId, Oid newDbId);
extern void dropDatabaseDependencies(Oid databaseId);
-extern void shdepDropOwned(List *relids, DropBehavior behavior);
+extern void shdepDropOwned(List *roleids, DropBehavior behavior);
-extern void shdepReassignOwned(List *relids, Oid newrole);
+extern void shdepReassignOwned(List *roleids, Oid newrole);
#endif /* DEPENDENCY_H */
diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h
index 567ab63e8..d754f4120 100644
--- a/src/include/catalog/objectaccess.h
+++ b/src/include/catalog/objectaccess.h
@@ -151,15 +151,15 @@ extern bool RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation);
extern void RunFunctionExecuteHook(Oid objectId);
/* String versions */
-extern void RunObjectPostCreateHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId,
bool is_internal);
-extern void RunObjectDropHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectDropHookStr(Oid classId, const char *objectName, int subId,
int dropflags);
-extern void RunObjectTruncateHookStr(const char *objectStr);
-extern void RunObjectPostAlterHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectTruncateHookStr(const char *objectName);
+extern void RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId,
Oid auxiliaryId, bool is_internal);
-extern bool RunNamespaceSearchHookStr(const char *objectStr, bool ereport_on_violation);
-extern void RunFunctionExecuteHookStr(const char *objectStr);
+extern bool RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation);
+extern void RunFunctionExecuteHookStr(const char *objectName);
/*
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
index cf4d8b310..340ffc95a 100644
--- a/src/include/catalog/objectaddress.h
+++ b/src/include/catalog/objectaddress.h
@@ -77,9 +77,9 @@ extern char *getObjectDescriptionOids(Oid classid, Oid objid);
extern int read_objtype_from_string(const char *objtype);
extern char *getObjectTypeDescription(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentity(const ObjectAddress *address,
+extern char *getObjectIdentity(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentityParts(const ObjectAddress *address,
+extern char *getObjectIdentityParts(const ObjectAddress *object,
List **objname, List **objargs,
bool missing_ok);
extern struct ArrayType *strlist_to_textarray(List *list);
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index fb26123aa..e59ed94ed 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -69,7 +69,7 @@ extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
Oid conowner,
int32 conforencoding, int32 contoencoding,
Oid conproc, bool def);
-extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding,
+extern Oid FindDefaultConversion(Oid name_space, int32 for_encoding,
int32 to_encoding);
#endif /* PG_CONVERSION_H */
diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h
index b5a32755a..9221c2ea5 100644
--- a/src/include/catalog/pg_inherits.h
+++ b/src/include/catalog/pg_inherits.h
@@ -53,13 +53,14 @@ extern List *find_inheritance_children_extended(Oid parentrelId, bool omit_detac
LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin);
extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode,
- List **parents);
+ List **numparents);
extern bool has_subclass(Oid relationId);
extern bool has_superclass(Oid relationId);
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
extern void StoreSingleInheritance(Oid relationId, Oid parentOid,
int32 seqNumber);
-extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool allow_detached,
+extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent,
+ bool expect_detach_pending,
const char *childname);
extern bool PartitionHasPendingDetach(Oid partoid);
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
index c298327f5..ecf5a28e0 100644
--- a/src/include/catalog/pg_publication.h
+++ b/src/include/catalog/pg_publication.h
@@ -137,7 +137,7 @@ extern List *GetPublicationSchemas(Oid pubid);
extern List *GetSchemaPublications(Oid schemaid);
extern List *GetSchemaPublicationRelations(Oid schemaid,
PublicationPartOpt pub_partopt);
-extern List *GetAllSchemaPublicationRelations(Oid puboid,
+extern List *GetAllSchemaPublicationRelations(Oid pubid,
PublicationPartOpt pub_partopt);
extern List *GetPubPartitionOptionRelations(List *result,
PublicationPartOpt pub_partopt,
diff --git a/src/include/commands/alter.h b/src/include/commands/alter.h
index 52f5e6f6d..fddfa3b85 100644
--- a/src/include/commands/alter.h
+++ b/src/include/commands/alter.h
@@ -29,7 +29,7 @@ extern Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid,
ObjectAddresses *objsMoved);
extern ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
-extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
+extern void AlterObjectOwner_internal(Relation rel, Oid objectId,
Oid new_ownerId);
#endif /* ALTER_H */
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h
index df8e73af4..de9040c4b 100644
--- a/src/include/commands/cluster.h
+++ b/src/include/commands/cluster.h
@@ -45,7 +45,7 @@ extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
bool check_constraints,
bool is_internal,
TransactionId frozenXid,
- MultiXactId minMulti,
+ MultiXactId cutoffMulti,
char newrelpersistence);
#endif /* CLUSTER_H */
diff --git a/src/include/commands/conversioncmds.h b/src/include/commands/conversioncmds.h
index ab736fb62..da3136527 100644
--- a/src/include/commands/conversioncmds.h
+++ b/src/include/commands/conversioncmds.h
@@ -18,6 +18,6 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
+extern ObjectAddress CreateConversionCommand(CreateConversionStmt *stmt);
#endif /* CONVERSIONCMDS_H */
diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h
index cb0096aeb..d7efec6f2 100644
--- a/src/include/commands/copy.h
+++ b/src/include/commands/copy.h
@@ -67,11 +67,11 @@ typedef struct CopyToStateData *CopyToState;
typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread);
-extern void DoCopy(ParseState *state, const CopyStmt *stmt,
+extern void DoCopy(ParseState *pstate, const CopyStmt *stmt,
int stmt_location, int stmt_len,
uint64 *processed);
-extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *ops_out, bool is_from, List *options);
+extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *opts_out, bool is_from, List *options);
extern CopyFromState BeginCopyFrom(ParseState *pstate, Relation rel, Node *whereClause,
const char *filename,
bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options);
diff --git a/src/include/commands/dbcommands_xlog.h b/src/include/commands/dbcommands_xlog.h
index 0ee2452fe..545e5430c 100644
--- a/src/include/commands/dbcommands_xlog.h
+++ b/src/include/commands/dbcommands_xlog.h
@@ -53,8 +53,8 @@ typedef struct xl_dbase_drop_rec
} xl_dbase_drop_rec;
#define MinSizeOfDbaseDropRec offsetof(xl_dbase_drop_rec, tablespace_ids)
-extern void dbase_redo(XLogReaderState *rptr);
-extern void dbase_desc(StringInfo buf, XLogReaderState *rptr);
+extern void dbase_redo(XLogReaderState *record);
+extern void dbase_desc(StringInfo buf, XLogReaderState *record);
extern const char *dbase_identify(uint8 info);
#endif /* DBCOMMANDS_XLOG_H */
diff --git a/src/include/commands/policy.h b/src/include/commands/policy.h
index c5f3753da..f05bb66c6 100644
--- a/src/include/commands/policy.h
+++ b/src/include/commands/policy.h
@@ -23,7 +23,7 @@ extern void RelationBuildRowSecurity(Relation relation);
extern void RemovePolicyById(Oid policy_id);
-extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid objid);
+extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid policy_id);
extern ObjectAddress CreatePolicy(CreatePolicyStmt *stmt);
extern ObjectAddress AlterPolicy(AlterPolicyStmt *stmt);
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
index 57df3fc1e..249119657 100644
--- a/src/include/commands/publicationcmds.h
+++ b/src/include/commands/publicationcmds.h
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
extern void RemovePublicationSchemaById(Oid psoid);
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
-extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
extern void InvalidatePublicationRels(List *relids);
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
List *ancestors, bool pubviaroot);
diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h
index 8c21f2a2c..3076bb891 100644
--- a/src/include/commands/schemacmds.h
+++ b/src/include/commands/schemacmds.h
@@ -18,7 +18,7 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
+extern Oid CreateSchemaCommand(CreateSchemaStmt *stmt,
const char *queryString,
int stmt_location, int stmt_len);
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index d38c0e238..b3b04ccfa 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -55,16 +55,16 @@ extern int64 nextval_internal(Oid relid, bool check_permissions);
extern Datum nextval(PG_FUNCTION_ARGS);
extern List *sequence_options(Oid relid);
-extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
+extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq);
extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
extern void DeleteSequenceTuple(Oid relid);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
-extern void seq_redo(XLogReaderState *rptr);
-extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
+extern void seq_redo(XLogReaderState *record);
+extern void seq_desc(StringInfo buf, XLogReaderState *record);
extern const char *seq_identify(uint8 info);
-extern void seq_mask(char *pagedata, BlockNumber blkno);
+extern void seq_mask(char *page, BlockNumber blkno);
#endif /* SEQUENCE_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 0c48654b9..03f14d6be 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -66,7 +66,7 @@ extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
extern bool CheckRelationTableSpaceMove(Relation rel, Oid newTableSpaceId);
extern void SetRelationTableSpace(Relation rel, Oid newTableSpaceId,
- RelFileNumber newRelFileNumber);
+ RelFileNumber newRelFilenumber);
extern ObjectAddress renameatt(RenameStmt *stmt);
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 1f8090711..a11c9e947 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -62,8 +62,8 @@ extern char *get_tablespace_name(Oid spc_oid);
extern bool directory_is_empty(const char *path);
extern void remove_tablespace_symlink(const char *linkloc);
-extern void tblspc_redo(XLogReaderState *rptr);
-extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
+extern void tblspc_redo(XLogReaderState *record);
+extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
extern const char *tblspc_identify(uint8 info);
#endif /* TABLESPACE_H */
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index b7b6bd600..7615519a8 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -166,7 +166,7 @@ extern void TriggerSetParentTrigger(Relation trigRel,
Oid parentTrigId,
Oid childTableId);
extern void RemoveTriggerById(Oid trigOid);
-extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);
+extern Oid get_trigger_oid(Oid relid, const char *trigname, bool missing_ok);
extern ObjectAddress renametrig(RenameStmt *stmt);
@@ -239,7 +239,7 @@ extern void ExecARUpdateTriggers(EState *estate,
ResultRelInfo *dst_partinfo,
ItemPointer tupleid,
HeapTuple fdw_trigtuple,
- TupleTableSlot *slot,
+ TupleTableSlot *newslot,
List *recheckIndexes,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
@@ -267,9 +267,9 @@ extern bool AfterTriggerPendingOnRel(Oid relid);
* in utils/adt/ri_triggers.c
*/
extern bool RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_Initial_Check(Trigger *trigger,
Relation fk_rel, Relation pk_rel);
extern void RI_PartitionRemove_Check(Trigger *trigger, Relation fk_rel,
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h
index a17bedb85..532bc49c3 100644
--- a/src/include/commands/typecmds.h
+++ b/src/include/commands/typecmds.h
@@ -34,7 +34,7 @@ extern Oid AssignTypeMultirangeArrayOid(void);
extern ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw);
extern ObjectAddress AlterDomainNotNull(List *names, bool notNull);
-extern ObjectAddress AlterDomainAddConstraint(List *names, Node *constr,
+extern ObjectAddress AlterDomainAddConstraint(List *names, Node *newConstraint,
ObjectAddress *constrAddr);
extern ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName);
extern ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName,
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index 63f2b6a80..a1751b370 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -26,8 +26,8 @@ extern char *pg_strdup(const char *in);
extern void *pg_malloc(size_t size);
extern void *pg_malloc0(size_t size);
extern void *pg_malloc_extended(size_t size, int flags);
-extern void *pg_realloc(void *pointer, size_t size);
-extern void pg_free(void *pointer);
+extern void *pg_realloc(void *ptr, size_t size);
+extern void pg_free(void *ptr);
/*
* Variants with easier notation and more type safety
diff --git a/src/include/common/kwlookup.h b/src/include/common/kwlookup.h
index 48d7f08b8..8384e33a5 100644
--- a/src/include/common/kwlookup.h
+++ b/src/include/common/kwlookup.h
@@ -32,7 +32,7 @@ typedef struct ScanKeywordList
} ScanKeywordList;
-extern int ScanKeywordLookup(const char *text, const ScanKeywordList *keywords);
+extern int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords);
/* Code that wants to retrieve the text of the N'th keyword should use this. */
static inline const char *
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
index d1f840c11..e1f5e786e 100644
--- a/src/include/common/scram-common.h
+++ b/src/include/common/scram-common.h
@@ -49,7 +49,7 @@
extern int scram_SaltedPassword(const char *password, const char *salt,
int saltlen, int iterations, uint8 *result,
const char **errstr);
-extern int scram_H(const uint8 *str, int len, uint8 *result,
+extern int scram_H(const uint8 *input, int len, uint8 *result,
const char **errstr);
extern int scram_ClientKey(const uint8 *salted_password, uint8 *result,
const char **errstr);
diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h
index 3a1b11326..955d0bd64 100644
--- a/src/include/executor/execParallel.h
+++ b/src/include/executor/execParallel.h
@@ -38,13 +38,13 @@ typedef struct ParallelExecutorInfo
} ParallelExecutorInfo;
extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate,
- EState *estate, Bitmapset *sendParam, int nworkers,
+ EState *estate, Bitmapset *sendParams, int nworkers,
int64 tuples_needed);
extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei);
extern void ExecParallelFinish(ParallelExecutorInfo *pei);
extern void ExecParallelCleanup(ParallelExecutorInfo *pei);
extern void ExecParallelReinitialize(PlanState *planstate,
- ParallelExecutorInfo *pei, Bitmapset *sendParam);
+ ParallelExecutorInfo *pei, Bitmapset *sendParams);
extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 82925b4b6..fc8a469f2 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -218,7 +218,7 @@ extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
- Index rti, TupleTableSlot *testslot);
+ Index rti, TupleTableSlot *inputslot);
extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
Plan *subplan, List *auxrowmarks, int epqParam);
extern void EvalPlanQualSetPlan(EPQState *epqstate,
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index b2c0c7486..697abe5fc 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -174,7 +174,7 @@ extern void *SPI_palloc(Size size);
extern void *SPI_repalloc(void *pointer, Size size);
extern void SPI_pfree(void *pointer);
extern Datum SPI_datumTransfer(Datum value, bool typByVal, int typLen);
-extern void SPI_freetuple(HeapTuple pointer);
+extern void SPI_freetuple(HeapTuple tuple);
extern void SPI_freetuptable(SPITupleTable *tuptable);
extern Portal SPI_cursor_open(const char *name, SPIPlanPtr plan,
diff --git a/src/include/fe_utils/parallel_slot.h b/src/include/fe_utils/parallel_slot.h
index 8ce63c937..199df9bb0 100644
--- a/src/include/fe_utils/parallel_slot.h
+++ b/src/include/fe_utils/parallel_slot.h
@@ -58,7 +58,7 @@ ParallelSlotClearHandler(ParallelSlot *slot)
slot->handler_context = NULL;
}
-extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *slots,
+extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *sa,
const char *dbname);
extern ParallelSlotArray *ParallelSlotsSetup(int numslots, ConnParams *cparams,
diff --git a/src/include/fe_utils/simple_list.h b/src/include/fe_utils/simple_list.h
index 9261a7b0a..757fd6ac5 100644
--- a/src/include/fe_utils/simple_list.h
+++ b/src/include/fe_utils/simple_list.h
@@ -65,6 +65,6 @@ extern void simple_string_list_destroy(SimpleStringList *list);
extern const char *simple_string_list_not_touched(SimpleStringList *list);
-extern void simple_ptr_list_append(SimplePtrList *list, void *val);
+extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
#endif /* SIMPLE_LIST_H */
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index fa4deb249..0927cb19b 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -24,7 +24,7 @@ extern PGDLLIMPORT int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);
/* Functions */
-extern const char *fmtId(const char *identifier);
+extern const char *fmtId(const char *rawid);
extern const char *fmtQualifiedId(const char *schema, const char *id);
extern char *formatPGVersionNumber(int version_number, bool include_minor,
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index dc3d819a1..10dbe3981 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -348,7 +348,7 @@ extern void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx);
* "VARIADIC NULL".
*/
extern int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start,
- bool convert_unknown, Datum **values,
+ bool convert_unknown, Datum **args,
Oid **types, bool **nulls);
#endif /* FUNCAPI_H */
diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h
index 90036f7bc..d06da8180 100644
--- a/src/include/libpq/hba.h
+++ b/src/include/libpq/hba.h
@@ -169,7 +169,7 @@ extern const char *hba_authname(UserAuth auth_method);
extern void hba_getauthmethod(hbaPort *port);
extern int check_usermap(const char *usermap_name,
const char *pg_role, const char *auth_user,
- bool case_sensitive);
+ bool case_insensitive);
extern HbaLine *parse_hba_line(TokenizedAuthLine *tok_line, int elevel);
extern IdentLine *parse_ident_line(TokenizedAuthLine *tok_line, int elevel);
extern bool pg_isblank(const char c);
diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h
index 6687c8f4c..0d7b43d83 100644
--- a/src/include/libpq/pqmq.h
+++ b/src/include/libpq/pqmq.h
@@ -19,6 +19,6 @@
extern void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh);
extern void pq_set_parallel_leader(pid_t pid, BackendId backend_id);
-extern void pq_parse_errornotice(StringInfo str, ErrorData *edata);
+extern void pq_parse_errornotice(StringInfo msg, ErrorData *edata);
#endif /* PQMQ_H */
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 1e8c3af36..284b86525 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -610,7 +610,7 @@ extern size_t pg_wchar_strlen(const pg_wchar *wstr);
extern int pg_mblen(const char *mbstr);
extern int pg_dsplen(const char *mbstr);
extern int pg_mbstrlen(const char *mbstr);
-extern int pg_mbstrlen_with_len(const char *mbstr, int len);
+extern int pg_mbstrlen_with_len(const char *mbstr, int limit);
extern int pg_mbcliplen(const char *mbstr, int len, int limit);
extern int pg_encoding_mbcliplen(int encoding, const char *mbstr,
int len, int limit);
@@ -641,7 +641,7 @@ extern int pg_do_encoding_conversion_buf(Oid proc,
int src_encoding,
int dest_encoding,
unsigned char *src, int srclen,
- unsigned char *dst, int dstlen,
+ unsigned char *dest, int destlen,
bool noError);
extern char *pg_client_to_server(const char *s, int len);
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 65cf4ba50..ee48e392e 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -352,7 +352,7 @@ extern bool InSecurityRestrictedOperation(void);
extern bool InNoForceRLSOperation(void);
extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
-extern void InitializeSessionUserId(const char *rolename, Oid useroid);
+extern void InitializeSessionUserId(const char *rolename, Oid roleid);
extern void InitializeSessionUserIdStandalone(void);
extern void SetSessionAuthorization(Oid userid, bool is_superuser);
extern Oid GetCurrentRoleId(void);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index cdd6debfa..a80f43e54 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -218,7 +218,7 @@ extern int16 *readAttrNumberCols(int numCols);
/*
* nodes/copyfuncs.c
*/
-extern void *copyObjectImpl(const void *obj);
+extern void *copyObjectImpl(const void *from);
/* cast result back to argument type, if supported by compiler */
#ifdef HAVE_TYPEOF
diff --git a/src/include/nodes/params.h b/src/include/nodes/params.h
index de2dd907e..543543d68 100644
--- a/src/include/nodes/params.h
+++ b/src/include/nodes/params.h
@@ -163,8 +163,8 @@ extern ParamListInfo copyParamList(ParamListInfo from);
extern Size EstimateParamListSpace(ParamListInfo paramLI);
extern void SerializeParamList(ParamListInfo paramLI, char **start_address);
extern ParamListInfo RestoreParamList(char **start_address);
-extern char *BuildParamLogString(ParamListInfo params, char **paramTextValues,
- int valueLen);
+extern char *BuildParamLogString(ParamListInfo params, char **knownTextValues,
+ int maxlen);
extern void ParamsErrorCallback(void *arg);
#endif /* PARAMS_H */
diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h
index 5e83b843d..91878e8b9 100644
--- a/src/include/nodes/value.h
+++ b/src/include/nodes/value.h
@@ -83,7 +83,7 @@ typedef struct BitString
extern Integer *makeInteger(int i);
extern Float *makeFloat(char *numericStr);
-extern Boolean *makeBoolean(bool var);
+extern Boolean *makeBoolean(bool val);
extern String *makeString(char *str);
extern BitString *makeBitString(char *str);
diff --git a/src/include/optimizer/appendinfo.h b/src/include/optimizer/appendinfo.h
index 5e80a741a..28568fab5 100644
--- a/src/include/optimizer/appendinfo.h
+++ b/src/include/optimizer/appendinfo.h
@@ -40,7 +40,7 @@ extern void get_translated_update_targetlist(PlannerInfo *root, Index relid,
List **update_colnos);
extern AppendRelInfo **find_appinfos_by_relids(PlannerInfo *root,
Relids relids, int *nappinfos);
-extern void add_row_identity_var(PlannerInfo *root, Var *rowid_var,
+extern void add_row_identity_var(PlannerInfo *root, Var *orig_var,
Index rtindex, const char *rowid_name);
extern void add_row_identity_columns(PlannerInfo *root, Index rtindex,
RangeTblEntry *target_rte,
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index 6c5203dc4..ff242d1b6 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -40,8 +40,8 @@ extern bool contain_leaked_vars(Node *clause);
extern Relids find_nonnullable_rels(Node *clause);
extern List *find_nonnullable_vars(Node *clause);
-extern List *find_forced_null_vars(Node *clause);
-extern Var *find_forced_null_var(Node *clause);
+extern List *find_forced_null_vars(Node *node);
+extern Var *find_forced_null_var(Node *node);
extern bool is_pseudo_constant_clause(Node *clause);
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index d11cdac7f..881386997 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -170,8 +170,8 @@ extern void add_child_rel_equivalences(PlannerInfo *root,
extern void add_child_join_rel_equivalences(PlannerInfo *root,
int nappinfos,
AppendRelInfo **appinfos,
- RelOptInfo *parent_rel,
- RelOptInfo *child_rel);
+ RelOptInfo *parent_joinrel,
+ RelOptInfo *child_joinrel);
extern List *generate_implied_equalities_for_column(PlannerInfo *root,
RelOptInfo *rel,
ec_matches_callback_type callback,
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 1566f435b..9dffdcfd1 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -115,6 +115,6 @@ extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
extern bool trivial_subqueryscan(SubqueryScan *plan);
extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
extern void record_plan_type_dependency(PlannerInfo *root, Oid typid);
-extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *root);
+extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *context);
#endif /* PLANMAIN_H */
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index dc379547c..3d3a5918c 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -43,7 +43,7 @@ extern List *transformInsertRow(ParseState *pstate, List *exprlist,
List *stmtcols, List *icolumns, List *attrnos,
bool strip_indirection);
extern List *transformUpdateTargetList(ParseState *pstate,
- List *targetList);
+ List *origTlist);
extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
extern Query *transformStmt(ParseState *pstate, Node *parseTree);
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index c56822f64..0856af5b4 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -19,7 +19,7 @@ extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
List *args, List *aggorder,
bool agg_distinct);
-extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *g);
+extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *p);
extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
WindowDef *windef);
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h
index e15b62290..7a57b199b 100644
--- a/src/include/parser/parse_oper.h
+++ b/src/include/parser/parse_oper.h
@@ -29,8 +29,8 @@ extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
/* Routines to find operators matching a name and given input types */
/* NB: the selected operator may require coercion of the input types! */
-extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2,
- bool noError, int location);
+extern Operator oper(ParseState *pstate, List *opname, Oid ltypeId,
+ Oid rtypeId, bool noError, int location);
extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
bool noError, int location);
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index de21c3c64..484db165d 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -88,7 +88,7 @@ extern ParseNamespaceItem *addRangeTableEntryForJoin(ParseState *pstate,
List *aliasvars,
List *leftcols,
List *rightcols,
- Alias *joinalias,
+ Alias *join_using_alias,
Alias *alias,
bool inFromCl);
extern ParseNamespaceItem *addRangeTableEntryForCTE(ParseState *pstate,
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index b1e3f1b84..1f5b706d8 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -98,7 +98,7 @@ typedef struct PartitionBoundInfoData
#define partition_bound_accepts_nulls(bi) ((bi)->null_index != -1)
#define partition_bound_has_default(bi) ((bi)->default_index != -1)
-extern int get_hash_partition_greatest_modulus(PartitionBoundInfo b);
+extern int get_hash_partition_greatest_modulus(PartitionBoundInfo bound);
extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
Oid *partcollation,
Datum *values, bool *isnull);
@@ -125,7 +125,7 @@ extern void check_new_partition_bound(char *relname, Relation parent,
PartitionBoundSpec *spec,
ParseState *pstate);
extern void check_default_partition_contents(Relation parent,
- Relation defaultRel,
+ Relation default_rel,
PartitionBoundSpec *new_spec);
extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc,
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index ac28f813b..ad7334a0d 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -417,7 +417,7 @@ extern long pgstat_report_stat(bool force);
extern void pgstat_force_next_flush(void);
extern void pgstat_reset_counters(void);
-extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objectid);
+extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objoid);
extern void pgstat_reset_of_kind(PgStat_Kind kind);
/* stats accessors */
@@ -474,7 +474,7 @@ extern void pgstat_report_connect(Oid dboid);
#define pgstat_count_conn_txn_idle_time(n) \
(pgStatTransactionIdleTime += (n))
-extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dbid);
+extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dboid);
/*
* Functions in pgstat_function.c
@@ -489,7 +489,7 @@ extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo,
extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu,
bool finalize);
-extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid funcid);
+extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid func_id);
extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
@@ -499,7 +499,7 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
extern void pgstat_create_relation(Relation rel);
extern void pgstat_drop_relation(Relation rel);
-extern void pgstat_copy_relation_stats(Relation dstrel, Relation srcrel);
+extern void pgstat_copy_relation_stats(Relation dst, Relation src);
extern void pgstat_init_relation(Relation rel);
extern void pgstat_assoc_relation(Relation rel);
@@ -571,7 +571,7 @@ extern void pgstat_twophase_postabort(TransactionId xid, uint16 info,
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry(Oid relid);
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry_ext(bool shared,
- Oid relid);
+ Oid reloid);
extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
diff --git a/src/include/pgtime.h b/src/include/pgtime.h
index 1c44be8ba..9ee590600 100644
--- a/src/include/pgtime.h
+++ b/src/include/pgtime.h
@@ -75,8 +75,8 @@ extern bool pg_tz_acceptable(pg_tz *tz);
/* these functions are in strftime.c */
-extern size_t pg_strftime(char *s, size_t max, const char *format,
- const struct pg_tm *tm);
+extern size_t pg_strftime(char *s, size_t maxsize, const char *format,
+ const struct pg_tm *t);
/* these functions and variables are in pgtz.c */
diff --git a/src/include/port.h b/src/include/port.h
index cec41eae7..7ee75994d 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -46,14 +46,14 @@ extern bool pg_set_block(pgsocket sock);
/* Portable path handling for Unix/Win32 (in path.c) */
-extern bool has_drive_prefix(const char *filename);
+extern bool has_drive_prefix(const char *path);
extern char *first_dir_separator(const char *filename);
extern char *last_dir_separator(const char *filename);
extern char *first_path_var_separator(const char *pathlist);
extern void join_path_components(char *ret_path,
const char *head, const char *tail);
extern void canonicalize_path(char *path);
-extern void make_native_path(char *path);
+extern void make_native_path(char *filename);
extern void cleanup_path(char *path);
extern bool path_contains_parent_reference(const char *path);
extern bool path_is_relative_and_below_cwd(const char *path);
@@ -479,7 +479,7 @@ extern pqsigfunc pqsignal(int signo, pqsigfunc func);
extern char *escape_single_quotes_ascii(const char *src);
/* common/wait_error.c */
-extern char *wait_result_to_str(int exit_status);
+extern char *wait_result_to_str(int exitstatus);
extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index a771ab8ff..7eaa4c97e 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -219,7 +219,7 @@ extern LogicalRepRelId logicalrep_read_update(StringInfo in,
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, TransactionId xid,
- Relation rel, TupleTableSlot *oldtuple,
+ Relation rel, TupleTableSlot *oldslot,
bool binary);
extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
@@ -235,7 +235,7 @@ extern void logicalrep_write_rel(StringInfo out, TransactionId xid,
extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
extern void logicalrep_write_typ(StringInfo out, TransactionId xid,
Oid typoid);
-extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
+extern void logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp);
extern void logicalrep_write_stream_start(StringInfo out, TransactionId xid,
bool first_segment);
extern TransactionId logicalrep_read_stream_start(StringInfo in,
@@ -243,7 +243,7 @@ extern TransactionId logicalrep_read_stream_start(StringInfo in,
extern void logicalrep_write_stream_stop(StringInfo out);
extern void logicalrep_write_stream_commit(StringInfo out, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn);
-extern TransactionId logicalrep_read_stream_commit(StringInfo out,
+extern TransactionId logicalrep_read_stream_commit(StringInfo in,
LogicalRepCommitData *commit_data);
extern void logicalrep_write_stream_abort(StringInfo out, TransactionId xid,
TransactionId subxid);
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index 8695901ba..d7902666b 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -655,11 +655,12 @@ extern void ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
TimestampTz commit_time,
RepOriginId origin_id, XLogRecPtr origin_lsn,
char *gid, bool is_commit);
-extern void ReorderBufferAssignChild(ReorderBuffer *, TransactionId, TransactionId, XLogRecPtr commit_lsn);
+extern void ReorderBufferAssignChild(ReorderBuffer *rb, TransactionId xid,
+ TransactionId subxid, XLogRecPtr lsn);
extern void ReorderBufferCommitChild(ReorderBuffer *, TransactionId, TransactionId,
XLogRecPtr commit_lsn, XLogRecPtr end_lsn);
extern void ReorderBufferAbort(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
-extern void ReorderBufferAbortOld(ReorderBuffer *, TransactionId xid);
+extern void ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid);
extern void ReorderBufferForget(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
extern void ReorderBufferInvalidate(ReorderBuffer *, TransactionId, XLogRecPtr lsn);
@@ -667,9 +668,10 @@ extern void ReorderBufferSetBaseSnapshot(ReorderBuffer *, TransactionId, XLogRec
extern void ReorderBufferAddSnapshot(ReorderBuffer *, TransactionId, XLogRecPtr lsn, struct SnapshotData *snap);
extern void ReorderBufferAddNewCommandId(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
CommandId cid);
-extern void ReorderBufferAddNewTupleCids(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
- RelFileLocator locator, ItemPointerData pt,
- CommandId cmin, CommandId cmax, CommandId combocid);
+extern void ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
+ RelFileLocator locator, ItemPointerData tid,
+ CommandId cmin, CommandId cmax,
+ CommandId combocid);
extern void ReorderBufferAddInvalidations(ReorderBuffer *, TransactionId, XLogRecPtr lsn,
Size nmsgs, SharedInvalidationMessage *msgs);
extern void ReorderBufferImmediateInvalidation(ReorderBuffer *, uint32 ninvalidations,
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index 8c9f3321d..9d68bfa64 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -195,7 +195,7 @@ extern void ReplicationSlotsShmemInit(void);
/* management of individual slots */
extern void ReplicationSlotCreate(const char *name, bool db_specific,
- ReplicationSlotPersistency p, bool two_phase);
+ ReplicationSlotPersistency persistency, bool two_phase);
extern void ReplicationSlotPersist(void);
extern void ReplicationSlotDrop(const char *name, bool nowait);
diff --git a/src/include/replication/snapbuild.h b/src/include/replication/snapbuild.h
index e6adea24f..f126ff2e0 100644
--- a/src/include/replication/snapbuild.h
+++ b/src/include/replication/snapbuild.h
@@ -59,24 +59,24 @@ struct xl_running_xacts;
extern void CheckPointSnapBuild(void);
-extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *cache,
+extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *reorder,
TransactionId xmin_horizon, XLogRecPtr start_lsn,
bool need_full_snapshot,
XLogRecPtr two_phase_at);
-extern void FreeSnapshotBuilder(SnapBuild *cache);
+extern void FreeSnapshotBuilder(SnapBuild *builder);
extern void SnapBuildSnapDecRefcount(Snapshot snap);
extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
-extern const char *SnapBuildExportSnapshot(SnapBuild *snapstate);
+extern const char *SnapBuildExportSnapshot(SnapBuild *builder);
extern void SnapBuildClearExportedSnapshot(void);
extern void SnapBuildResetExportedSnapshotState(void);
-extern SnapBuildState SnapBuildCurrentState(SnapBuild *snapstate);
+extern SnapBuildState SnapBuildCurrentState(SnapBuild *builder);
extern Snapshot SnapBuildGetOrBuildSnapshot(SnapBuild *builder,
TransactionId xid);
-extern bool SnapBuildXactNeedsSkip(SnapBuild *snapstate, XLogRecPtr ptr);
+extern bool SnapBuildXactNeedsSkip(SnapBuild *builder, XLogRecPtr ptr);
extern XLogRecPtr SnapBuildGetTwoPhaseAt(SnapBuild *builder);
extern void SnapBuildSetTwoPhaseAt(SnapBuild *builder, XLogRecPtr ptr);
@@ -86,7 +86,8 @@ extern void SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn,
extern bool SnapBuildProcessChange(SnapBuild *builder, TransactionId xid,
XLogRecPtr lsn);
extern void SnapBuildProcessNewCid(SnapBuild *builder, TransactionId xid,
- XLogRecPtr lsn, struct xl_heap_new_cid *cid);
+ XLogRecPtr lsn,
+ struct xl_heap_new_cid *xlrec);
extern void SnapBuildProcessRunningXacts(SnapBuild *builder, XLogRecPtr lsn,
struct xl_running_xacts *running);
extern void SnapBuildSerializationPoint(SnapBuild *builder, XLogRecPtr lsn);
diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h
index d99a21b07..8336a6e71 100644
--- a/src/include/replication/walsender.h
+++ b/src/include/replication/walsender.h
@@ -36,7 +36,7 @@ extern PGDLLIMPORT int wal_sender_timeout;
extern PGDLLIMPORT bool log_replication_commands;
extern void InitWalSender(void);
-extern bool exec_replication_command(const char *query_string);
+extern bool exec_replication_command(const char *cmd_string);
extern void WalSndErrorCleanup(void);
extern void WalSndResourceCleanup(bool isCommit);
extern void WalSndSignals(void);
diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index 98b9b3a28..f001ca41b 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -42,7 +42,7 @@ typedef enum ReplaceVarsNoMatchOption
extern void OffsetVarNodes(Node *node, int offset, int sublevels_up);
-extern void ChangeVarNodes(Node *node, int old_varno, int new_varno,
+extern void ChangeVarNodes(Node *node, int rt_index, int new_index,
int sublevels_up);
extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up,
int min_sublevels_up);
diff --git a/src/include/snowball/libstemmer/header.h b/src/include/snowball/libstemmer/header.h
index bf172d5b9..ef5a54640 100644
--- a/src/include/snowball/libstemmer/header.h
+++ b/src/include/snowball/libstemmer/header.h
@@ -45,7 +45,7 @@ extern int eq_v_b(struct SN_env * z, const symbol * p);
extern int find_among(struct SN_env * z, const struct among * v, int v_size);
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
-extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
+extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr);
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
extern int slice_from_v(struct SN_env * z, const symbol * p);
extern int slice_del(struct SN_env * z);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index bb7ef1240..0351927a2 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -102,8 +102,8 @@ extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalro
int numrows, HeapTuple *rows,
int natts, VacAttrStats **vacattrstats);
extern int ComputeExtStatisticsRows(Relation onerel,
- int natts, VacAttrStats **stats);
-extern bool statext_is_kind_built(HeapTuple htup, char kind);
+ int natts, VacAttrStats **vacattrstats);
+extern bool statext_is_kind_built(HeapTuple htup, char type);
extern Selectivity dependencies_clauselist_selectivity(PlannerInfo *root,
List *clauses,
int varRelid,
diff --git a/src/include/storage/barrier.h b/src/include/storage/barrier.h
index 57d2c52e7..4b16ab812 100644
--- a/src/include/storage/barrier.h
+++ b/src/include/storage/barrier.h
@@ -34,7 +34,7 @@ typedef struct Barrier
ConditionVariable condition_variable;
} Barrier;
-extern void BarrierInit(Barrier *barrier, int num_workers);
+extern void BarrierInit(Barrier *barrier, int participants);
extern bool BarrierArriveAndWait(Barrier *barrier, uint32 wait_event_info);
extern bool BarrierArriveAndDetach(Barrier *barrier);
extern bool BarrierArriveAndDetachExceptLast(Barrier *barrier);
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 6a947021a..2708c4b68 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -499,9 +499,9 @@ extern Size PageGetFreeSpace(Page page);
extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups);
extern Size PageGetExactFreeSpace(Page page);
extern Size PageGetHeapFreeSpace(Page page);
-extern void PageIndexTupleDelete(Page page, OffsetNumber offset);
+extern void PageIndexTupleDelete(Page page, OffsetNumber offnum);
extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems);
-extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offset);
+extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum);
extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
Item newtup, Size newsize);
extern char *PageSetChecksumCopy(Page page, BlockNumber blkno);
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index 2b4a8e0ff..5a48fccd9 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -117,11 +117,11 @@ extern int FileGetRawFlags(File file);
extern mode_t FileGetRawMode(File file);
/* Operations used for sharing named temporary files */
-extern File PathNameCreateTemporaryFile(const char *name, bool error_on_failure);
+extern File PathNameCreateTemporaryFile(const char *path, bool error_on_failure);
extern File PathNameOpenTemporaryFile(const char *path, int mode);
-extern bool PathNameDeleteTemporaryFile(const char *name, bool error_on_failure);
-extern void PathNameCreateTemporaryDir(const char *base, const char *name);
-extern void PathNameDeleteTemporaryDir(const char *name);
+extern bool PathNameDeleteTemporaryFile(const char *path, bool error_on_failure);
+extern void PathNameCreateTemporaryDir(const char *basedir, const char *directory);
+extern void PathNameDeleteTemporaryDir(const char *dirname);
extern void TempTablespacePath(char *path, Oid tablespace);
/* Operations that allow use of regular stdio --- USE WITH CAUTION */
@@ -177,7 +177,7 @@ extern int pg_fsync(int fd);
extern int pg_fsync_no_writethrough(int fd);
extern int pg_fsync_writethrough(int fd);
extern int pg_fdatasync(int fd);
-extern void pg_flush_data(int fd, off_t offset, off_t amount);
+extern void pg_flush_data(int fd, off_t offset, off_t nbytes);
extern ssize_t pg_pwritev_with_retry(int fd,
const struct iovec *iov,
int iovcnt,
@@ -185,8 +185,8 @@ extern ssize_t pg_pwritev_with_retry(int fd,
extern int pg_truncate(const char *path, off_t length);
extern void fsync_fname(const char *fname, bool isdir);
extern int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel);
-extern int durable_rename(const char *oldfile, const char *newfile, int loglevel);
-extern int durable_unlink(const char *fname, int loglevel);
+extern int durable_rename(const char *oldfile, const char *newfile, int elevel);
+extern int durable_unlink(const char *fname, int elevel);
extern void SyncDataDirectory(void);
extern int data_sync_elevel(int elevel);
diff --git a/src/include/storage/fsm_internals.h b/src/include/storage/fsm_internals.h
index a6f837217..819160c78 100644
--- a/src/include/storage/fsm_internals.h
+++ b/src/include/storage/fsm_internals.h
@@ -61,7 +61,7 @@ typedef FSMPageData *FSMPage;
#define SlotsPerFSMPage LeafNodesPerPage
/* Prototypes for functions in fsmpage.c */
-extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext,
+extern int fsm_search_avail(Buffer buf, uint8 minvalue, bool advancenext,
bool exclusive_lock_held);
extern uint8 fsm_get_avail(Page page, int slot);
extern uint8 fsm_get_max_avail(Page page);
diff --git a/src/include/storage/indexfsm.h b/src/include/storage/indexfsm.h
index 04c1a051b..129590863 100644
--- a/src/include/storage/indexfsm.h
+++ b/src/include/storage/indexfsm.h
@@ -18,8 +18,8 @@
#include "utils/relcache.h"
extern BlockNumber GetFreeIndexPage(Relation rel);
-extern void RecordFreeIndexPage(Relation rel, BlockNumber page);
-extern void RecordUsedIndexPage(Relation rel, BlockNumber page);
+extern void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock);
+extern void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock);
extern void IndexFreeSpaceMapVacuum(Relation rel);
diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h
index 8dfcb3944..dbef2ffb0 100644
--- a/src/include/storage/predicate.h
+++ b/src/include/storage/predicate.h
@@ -58,7 +58,7 @@ extern void RegisterPredicateLockingXid(TransactionId xid);
extern void PredicateLockRelation(Relation relation, Snapshot snapshot);
extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot);
extern void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot,
- TransactionId insert_xid);
+ TransactionId tuple_xid);
extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void TransferPredicateLocksToHeapRelation(Relation relation);
diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h
index dacef92f4..f5da98dc7 100644
--- a/src/include/storage/standby.h
+++ b/src/include/storage/standby.h
@@ -43,7 +43,7 @@ extern void StandbyDeadLockHandler(void);
extern void StandbyTimeoutHandler(void);
extern void StandbyLockTimeoutHandler(void);
extern void LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
- TimestampTz cur_ts, VirtualTransactionId *wait_list,
+ TimestampTz now, VirtualTransactionId *wait_list,
bool still_waiting);
/*
diff --git a/src/include/tcop/cmdtag.h b/src/include/tcop/cmdtag.h
index b9e8992a4..60e3179c7 100644
--- a/src/include/tcop/cmdtag.h
+++ b/src/include/tcop/cmdtag.h
@@ -53,6 +53,6 @@ extern const char *GetCommandTagName(CommandTag commandTag);
extern bool command_tag_display_rowcount(CommandTag commandTag);
extern bool command_tag_event_trigger_ok(CommandTag commandTag);
extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
-extern CommandTag GetCommandTagEnum(const char *tagname);
+extern CommandTag GetCommandTagEnum(const char *commandname);
#endif /* CMDTAG_H */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index c36c711da..fd73b3844 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -32,8 +32,8 @@ typedef struct TSVectorParseStateData *TSVectorParseState;
extern TSVectorParseState init_tsvector_parser(char *input, int flags);
extern void reset_tsvector_parser(TSVectorParseState state, char *input);
extern bool gettoken_tsvector(TSVectorParseState state,
- char **token, int *len,
- WordEntryPos **pos, int *poslen,
+ char **strval, int *lenval,
+ WordEntryPos **pos_ptr, int *poslen,
char **endptr);
extern void close_tsvector_parser(TSVectorParseState state);
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 3d6411197..9a4df3a5d 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -214,8 +214,8 @@ extern bool is_member_of_role_nosuper(Oid member, Oid role);
extern bool is_admin_of_role(Oid member, Oid role);
extern Oid select_best_admin(Oid member, Oid role);
extern void check_is_member_of_role(Oid member, Oid role);
-extern Oid get_role_oid(const char *rolename, bool missing_ok);
-extern Oid get_role_oid_or_public(const char *rolename);
+extern Oid get_role_oid(const char *rolname, bool missing_ok);
+extern Oid get_role_oid_or_public(const char *rolname);
extern Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok);
extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
@@ -285,7 +285,7 @@ extern AclResult pg_parameter_acl_aclcheck(Oid acl_oid, Oid roleid,
AclMode mode);
extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
-extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
+extern AclResult pg_largeobject_aclcheck_snapshot(Oid lobj_oid, Oid roleid,
AclMode mode, Snapshot snapshot);
extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
diff --git a/src/include/utils/attoptcache.h b/src/include/utils/attoptcache.h
index ee37af950..49ae64721 100644
--- a/src/include/utils/attoptcache.h
+++ b/src/include/utils/attoptcache.h
@@ -23,6 +23,6 @@ typedef struct AttributeOpts
float8 n_distinct_inherited;
} AttributeOpts;
-extern AttributeOpts *get_attribute_options(Oid spcid, int attnum);
+extern AttributeOpts *get_attribute_options(Oid attrelid, int attnum);
#endif /* ATTOPTCACHE_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 221c3e6c3..81631f164 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -47,10 +47,10 @@ extern int16 pg_strtoint16(const char *s);
extern int32 pg_strtoint32(const char *s);
extern int64 pg_strtoint64(const char *s);
extern int pg_itoa(int16 i, char *a);
-extern int pg_ultoa_n(uint32 l, char *a);
-extern int pg_ulltoa_n(uint64 l, char *a);
-extern int pg_ltoa(int32 l, char *a);
-extern int pg_lltoa(int64 ll, char *a);
+extern int pg_ultoa_n(uint32 value, char *a);
+extern int pg_ulltoa_n(uint64 value, char *a);
+extern int pg_ltoa(int32 value, char *a);
+extern int pg_lltoa(int64 value, char *a);
extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
extern char *pg_ultostr(char *str, uint32 value);
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 4527e8251..2cae346be 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -327,7 +327,7 @@ extern int DecodeTimezoneAbbrev(int field, char *lowtoken,
extern int DecodeSpecial(int field, char *lowtoken, int *val);
extern int DecodeUnits(int field, char *lowtoken, int *val);
-extern int j2day(int jd);
+extern int j2day(int date);
extern Node *TemporalSimplify(int32 max_precis, Node *node);
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index 4cbe6edf2..8f1b3dc5e 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -379,13 +379,13 @@ typedef struct JsonbIterator
extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
extern uint32 getJsonbLength(const JsonbContainer *jc, int index);
extern int compareJsonbContainers(JsonbContainer *a, JsonbContainer *b);
-extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *container,
uint32 flags,
JsonbValue *key);
extern JsonbValue *getKeyJsonValueFromContainer(JsonbContainer *container,
const char *keyVal, int keyLen,
JsonbValue *res);
-extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *container,
uint32 i);
extern JsonbValue *pushJsonbValue(JsonbParseState **pstate,
JsonbIteratorToken seq, JsonbValue *jbval);
diff --git a/src/include/utils/multirangetypes.h b/src/include/utils/multirangetypes.h
index 915330f99..bc3339205 100644
--- a/src/include/utils/multirangetypes.h
+++ b/src/include/utils/multirangetypes.h
@@ -64,7 +64,7 @@ extern bool multirange_ne_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr2);
extern bool multirange_contains_elem_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
- Datum elem);
+ Datum val);
extern bool multirange_contains_range_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
const RangeType *r);
@@ -115,11 +115,11 @@ extern MultirangeType *multirange_intersect_internal(Oid mltrngtypoid,
extern TypeCacheEntry *multirange_get_typcache(FunctionCallInfo fcinfo,
Oid mltrngtypid);
extern void multirange_deserialize(TypeCacheEntry *rangetyp,
- const MultirangeType *range,
+ const MultirangeType *multirange,
int32 *range_count,
RangeType ***ranges);
extern MultirangeType *make_multirange(Oid mltrngtypoid,
- TypeCacheEntry *typcache,
+ TypeCacheEntry *rangetyp,
int32 range_count, RangeType **ranges);
extern MultirangeType *make_empty_multirange(Oid mltrngtypoid,
TypeCacheEntry *rangetyp);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 3caa74dfe..09d355e81 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -85,6 +85,6 @@ extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2,
bool *have_error);
extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2,
bool *have_error);
-extern int32 numeric_int4_opt_error(Numeric num, bool *error);
+extern int32 numeric_int4_opt_error(Numeric num, bool *have_error);
#endif /* _PG_NUMERIC_H_ */
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 901d2041d..40a360285 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -567,7 +567,7 @@ extern void pgstat_relation_delete_pending_cb(PgStat_EntryRef *entry_ref);
*/
extern void pgstat_replslot_reset_timestamp_cb(PgStatShared_Common *header, TimestampTz ts);
-extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *tmp, NameData *name);
+extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *header, NameData *name);
extern bool pgstat_replslot_from_serialized_name_cb(const NameData *name, PgStat_HashKey *key);
@@ -579,7 +579,7 @@ extern void pgstat_attach_shmem(void);
extern void pgstat_detach_shmem(void);
extern PgStat_EntryRef *pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objoid,
- bool create, bool *found);
+ bool create, bool *created_entry);
extern bool pgstat_lock_entry(PgStat_EntryRef *entry_ref, bool nowait);
extern bool pgstat_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait);
extern void pgstat_unlock_entry(PgStat_EntryRef *entry_ref);
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h
index 993fad4fc..b62f1ea48 100644
--- a/src/include/utils/rangetypes.h
+++ b/src/include/utils/rangetypes.h
@@ -141,8 +141,8 @@ extern int range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1,
extern int range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1,
const RangeBound *b2);
extern int range_compare(const void *key1, const void *key2, void *arg);
-extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1,
- RangeBound bound2);
+extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound boundA,
+ RangeBound boundB);
extern RangeType *make_empty_range(TypeCacheEntry *typcache);
extern bool range_split_internal(TypeCacheEntry *typcache, const RangeType *r1,
const RangeType *r2, RangeType **output1,
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h
index a36ceba7a..0e2965ff9 100644
--- a/src/include/utils/regproc.h
+++ b/src/include/utils/regproc.h
@@ -28,7 +28,7 @@ extern char *format_operator_extended(Oid operator_oid, bits16 flags);
extern List *stringToQualifiedNameList(const char *string);
extern char *format_procedure(Oid procedure_oid);
extern char *format_procedure_qualified(Oid procedure_oid);
-extern void format_procedure_parts(Oid operator_oid, List **objnames,
+extern void format_procedure_parts(Oid procedure_oid, List **objnames,
List **objargs, bool missing_ok);
extern char *format_operator(Oid operator_oid);
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index ba35d6b3b..73106b6fc 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -50,7 +50,7 @@ extern Oid RelationGetReplicaIndex(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);
extern List *RelationGetDummyIndexExpressions(Relation relation);
extern List *RelationGetIndexPredicate(Relation relation);
-extern Datum *RelationGetIndexRawAttOptions(Relation relation);
+extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
typedef enum IndexAttrBitmapKind
diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h
index 2bb2e255f..92f1f779a 100644
--- a/src/include/utils/relmapper.h
+++ b/src/include/utils/relmapper.h
@@ -37,7 +37,7 @@ typedef struct xl_relmap_update
extern RelFileNumber RelationMapOidToFilenumber(Oid relationId, bool shared);
-extern Oid RelationMapFilenumberToOid(RelFileNumber relationId, bool shared);
+extern Oid RelationMapFilenumberToOid(RelFileNumber filenumber, bool shared);
extern RelFileNumber RelationMapOidToFilenumberForDatabase(char *dbpath,
Oid relationId);
extern void RelationMapCopy(Oid dbid, Oid tsid, char *srcdbpath,
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index d485b9bfc..49af4ed2e 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -181,11 +181,11 @@ extern double ineq_histogram_selectivity(PlannerInfo *root,
Oid collation,
Datum constval, Oid consttype);
extern double var_eq_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Datum constval, bool constisnull,
bool varonleft, bool negate);
extern double var_eq_non_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Node *other,
bool varonleft, bool negate);
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 06eafdf11..9f4dd5360 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -169,7 +169,7 @@ extern bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
/* Support for catalog timetravel for logical decoding */
struct HTAB;
extern struct HTAB *HistoricSnapshotGetTupleCids(void);
-extern void SetupHistoricSnapshot(Snapshot snapshot_now, struct HTAB *tuplecids);
+extern void SetupHistoricSnapshot(Snapshot historic_snapshot, struct HTAB *tuplecids);
extern void TeardownHistoricSnapshot(bool is_error);
extern bool HistoricSnapshotActive(void);
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index edf3a9731..820c08941 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -83,10 +83,10 @@ extern pg_time_t timestamptz_to_time_t(TimestampTz t);
extern const char *timestamptz_to_str(TimestampTz t);
-extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *dt);
+extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result);
extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm,
fsec_t *fsec, const char **tzn, pg_tz *attimezone);
-extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec);
+extern void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec);
extern void interval2itm(Interval span, struct pg_itm *itm);
extern int itm2interval(struct pg_itm *itm, Interval *span);
diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c
index dbad77643..ed16f93ac 100644
--- a/src/backend/access/brin/brin_minmax_multi.c
+++ b/src/backend/access/brin/brin_minmax_multi.c
@@ -223,7 +223,8 @@ typedef struct SerializedRanges
static SerializedRanges *brin_range_serialize(Ranges *range);
-static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range);
+static Ranges *brin_range_deserialize(int maxvalues,
+ SerializedRanges *serialized);
/*
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 503cda46e..7e355585a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -420,13 +420,13 @@ heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
* ----------------
*/
Datum
-nocachegetattr(HeapTuple tuple,
+nocachegetattr(HeapTuple tup,
int attnum,
TupleDesc tupleDesc)
{
- HeapTupleHeader tup = tuple->t_data;
+ HeapTupleHeader td = tup->t_data;
char *tp; /* ptr to data part of tuple */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ bits8 *bp = td->t_bits; /* ptr to null bitmap in tuple */
bool slow = false; /* do we have to walk attrs? */
int off; /* current offset within data */
@@ -441,7 +441,7 @@ nocachegetattr(HeapTuple tuple,
attnum--;
- if (!HeapTupleNoNulls(tuple))
+ if (!HeapTupleNoNulls(tup))
{
/*
* there's a null somewhere in the tuple
@@ -470,7 +470,7 @@ nocachegetattr(HeapTuple tuple,
}
}
- tp = (char *) tup + tup->t_hoff;
+ tp = (char *) td + td->t_hoff;
if (!slow)
{
@@ -489,7 +489,7 @@ nocachegetattr(HeapTuple tuple,
* target. If there aren't any, it's safe to cheaply initialize the
* cached offsets for these attrs.
*/
- if (HeapTupleHasVarWidth(tuple))
+ if (HeapTupleHasVarWidth(tup))
{
int j;
@@ -565,7 +565,7 @@ nocachegetattr(HeapTuple tuple,
{
Form_pg_attribute att = TupleDescAttr(tupleDesc, i);
- if (HeapTupleHasNulls(tuple) && att_isnull(i, bp))
+ if (HeapTupleHasNulls(tup) && att_isnull(i, bp))
{
usecache = false;
continue; /* this cannot be the target att */
diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c
index c6c7dfe4c..538e3880c 100644
--- a/src/backend/access/gist/gistbuildbuffers.c
+++ b/src/backend/access/gist/gistbuildbuffers.c
@@ -31,9 +31,9 @@ static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer);
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple item);
+ IndexTuple itup);
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple *item);
+ IndexTuple *itup);
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 588716606..eb811d751 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -108,7 +108,7 @@ static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status
static void index_delete_sort(TM_IndexDeleteOp *delstate);
static int bottomup_sort_and_shrink(TM_IndexDeleteOp *delstate);
static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup);
-static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_required,
+static HeapTuple ExtractReplicaIdentity(Relation relation, HeapTuple tp, bool key_required,
bool *copy);
diff --git a/src/backend/access/heap/visibilitymap.c b/src/backend/access/heap/visibilitymap.c
index ed72eb7b6..93aa5bad6 100644
--- a/src/backend/access/heap/visibilitymap.c
+++ b/src/backend/access/heap/visibilitymap.c
@@ -137,7 +137,7 @@ static void vm_extend(Relation rel, BlockNumber vm_nblocks);
* any I/O. Returns true if any bits have been cleared and false otherwise.
*/
bool
-visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
+visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
int mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -152,21 +152,21 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
elog(DEBUG1, "vm_clear %s %d", RelationGetRelationName(rel), heapBlk);
#endif
- if (!BufferIsValid(buf) || BufferGetBlockNumber(buf) != mapBlock)
+ if (!BufferIsValid(vmbuf) || BufferGetBlockNumber(vmbuf) != mapBlock)
elog(ERROR, "wrong buffer passed to visibilitymap_clear");
- LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
- map = PageGetContents(BufferGetPage(buf));
+ LockBuffer(vmbuf, BUFFER_LOCK_EXCLUSIVE);
+ map = PageGetContents(BufferGetPage(vmbuf));
if (map[mapByte] & mask)
{
map[mapByte] &= ~mask;
- MarkBufferDirty(buf);
+ MarkBufferDirty(vmbuf);
cleared = true;
}
- LockBuffer(buf, BUFFER_LOCK_UNLOCK);
+ LockBuffer(vmbuf, BUFFER_LOCK_UNLOCK);
return cleared;
}
@@ -180,27 +180,27 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
* shouldn't hold a lock on the heap page while doing that. Then, call
* visibilitymap_set to actually set the bit.
*
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by
* an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
* the bit for heapBlk.
*
* If the page doesn't exist in the map file yet, it is extended.
*/
void
-visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
/* Reuse the old pinned buffer if possible */
- if (BufferIsValid(*buf))
+ if (BufferIsValid(*vmbuf))
{
- if (BufferGetBlockNumber(*buf) == mapBlock)
+ if (BufferGetBlockNumber(*vmbuf) == mapBlock)
return;
- ReleaseBuffer(*buf);
+ ReleaseBuffer(*vmbuf);
}
- *buf = vm_readbuf(rel, mapBlock, true);
+ *vmbuf = vm_readbuf(rel, mapBlock, true);
}
/*
@@ -314,11 +314,11 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
* Are all tuples on heapBlk visible to all or are marked frozen, according
* to the visibility map?
*
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by an
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by an
* earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
* the bit for heapBlk, or InvalidBuffer. The caller is responsible for
- * releasing *buf after it's done testing and setting bits.
+ * releasing *vmbuf after it's done testing and setting bits.
*
* NOTE: This function is typically called without a lock on the heap page,
* so somebody else could change the bit just after we look at it. In fact,
@@ -328,7 +328,7 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
* all concurrency issues!
*/
uint8
-visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
uint32 mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -341,23 +341,23 @@ visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
#endif
/* Reuse the old pinned buffer if possible */
- if (BufferIsValid(*buf))
+ if (BufferIsValid(*vmbuf))
{
- if (BufferGetBlockNumber(*buf) != mapBlock)
+ if (BufferGetBlockNumber(*vmbuf) != mapBlock)
{
- ReleaseBuffer(*buf);
- *buf = InvalidBuffer;
+ ReleaseBuffer(*vmbuf);
+ *vmbuf = InvalidBuffer;
}
}
- if (!BufferIsValid(*buf))
+ if (!BufferIsValid(*vmbuf))
{
- *buf = vm_readbuf(rel, mapBlock, false);
- if (!BufferIsValid(*buf))
+ *vmbuf = vm_readbuf(rel, mapBlock, false);
+ if (!BufferIsValid(*vmbuf))
return false;
}
- map = PageGetContents(BufferGetPage(*buf));
+ map = PageGetContents(BufferGetPage(*vmbuf));
/*
* A single byte read is atomic. There could be memory-ordering effects
diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c
index b3d1a6c3f..094b24c7c 100644
--- a/src/backend/access/table/tableam.c
+++ b/src/backend/access/table/tableam.c
@@ -172,19 +172,18 @@ table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan,
}
TableScanDesc
-table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
+table_beginscan_parallel(Relation relation, ParallelTableScanDesc pscan)
{
Snapshot snapshot;
uint32 flags = SO_TYPE_SEQSCAN |
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
- Assert(RelationGetRelid(relation) == parallel_scan->phs_relid);
+ Assert(RelationGetRelid(relation) == pscan->phs_relid);
- if (!parallel_scan->phs_snapshot_any)
+ if (!pscan->phs_snapshot_any)
{
/* Snapshot was serialized -- restore it */
- snapshot = RestoreSnapshot((char *) parallel_scan +
- parallel_scan->phs_snapshot_off);
+ snapshot = RestoreSnapshot((char *) pscan + pscan->phs_snapshot_off);
RegisterSnapshot(snapshot);
flags |= SO_TEMP_SNAPSHOT;
}
@@ -195,7 +194,7 @@ table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
}
return relation->rd_tableam->scan_begin(relation, snapshot, 0, NULL,
- parallel_scan, flags);
+ pscan, flags);
}
diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c
index bbb542b32..6db9a1fca 100644
--- a/src/backend/access/transam/generic_xlog.c
+++ b/src/backend/access/transam/generic_xlog.c
@@ -69,7 +69,7 @@ struct GenericXLogState
};
static void writeFragment(PageData *pageData, OffsetNumber offset,
- OffsetNumber len, const char *data);
+ OffsetNumber length, const char *data);
static void computeRegionDelta(PageData *pageData,
const char *curpage, const char *targetpage,
int targetStart, int targetEnd,
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index ec57f56ad..a7383f553 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1214,14 +1214,14 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
* range, that is, greater to or equal than oldestMultiXactId, and less than
* nextMXact. Otherwise, an error is raised.
*
- * onlyLock must be set to true if caller is certain that the given multi
+ * isLockOnly must be set to true if caller is certain that the given multi
* is used only to lock tuples; can be false without loss of correctness,
* but passing a true means we can return quickly without checking for
* old updates.
*/
int
GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
- bool from_pgupgrade, bool onlyLock)
+ bool from_pgupgrade, bool isLockOnly)
{
int pageno;
int prev_pageno;
@@ -1263,7 +1263,7 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
* we can skip checking if the value is older than our oldest visible
* multi. It cannot possibly still be running.
*/
- if (onlyLock &&
+ if (isLockOnly &&
MultiXactIdPrecedes(multi, OldestVisibleMXactId[MyBackendId]))
{
debug_elog2(DEBUG2, "GetMembers: a locker-only multi is too old");
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 50f092d7e..5eec4df47 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -354,7 +354,7 @@ static void AtSubStart_Memory(void);
static void AtSubStart_ResourceOwner(void);
static void ShowTransactionState(const char *str);
-static void ShowTransactionStateRec(const char *str, TransactionState state);
+static void ShowTransactionStateRec(const char *str, TransactionState s);
static const char *BlockStateAsString(TBlockState blockState);
static const char *TransStateAsString(TransState state);
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 81d339d57..eb0430fe9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -648,7 +648,7 @@ static void XLogReportParameters(void);
static int LocalSetXLogInsertAllowed(void);
static void CreateEndOfRecoveryRecord(void);
static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn,
- XLogRecPtr missingContrecPtr,
+ XLogRecPtr pagePtr,
TimeLineID newTLI);
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo);
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index c4fbc37c7..c2d4ab271 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -47,7 +47,7 @@ static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
int reqLen);
static void XLogReaderInvalReadState(XLogReaderState *state);
-static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool non_blocking);
+static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index b20974bbe..6c7b05847 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -104,17 +104,17 @@ typedef struct
bool binary_upgrade_record_init_privs = false;
static void ExecGrantStmt_oids(InternalGrant *istmt);
-static void ExecGrant_Relation(InternalGrant *grantStmt);
-static void ExecGrant_Database(InternalGrant *grantStmt);
-static void ExecGrant_Fdw(InternalGrant *grantStmt);
-static void ExecGrant_ForeignServer(InternalGrant *grantStmt);
-static void ExecGrant_Function(InternalGrant *grantStmt);
-static void ExecGrant_Language(InternalGrant *grantStmt);
-static void ExecGrant_Largeobject(InternalGrant *grantStmt);
-static void ExecGrant_Namespace(InternalGrant *grantStmt);
-static void ExecGrant_Tablespace(InternalGrant *grantStmt);
-static void ExecGrant_Type(InternalGrant *grantStmt);
-static void ExecGrant_Parameter(InternalGrant *grantStmt);
+static void ExecGrant_Relation(InternalGrant *istmt);
+static void ExecGrant_Database(InternalGrant *istmt);
+static void ExecGrant_Fdw(InternalGrant *istmt);
+static void ExecGrant_ForeignServer(InternalGrant *istmt);
+static void ExecGrant_Function(InternalGrant *istmt);
+static void ExecGrant_Language(InternalGrant *istmt);
+static void ExecGrant_Largeobject(InternalGrant *istmt);
+static void ExecGrant_Namespace(InternalGrant *istmt);
+static void ExecGrant_Tablespace(InternalGrant *istmt);
+static void ExecGrant_Type(InternalGrant *istmt);
+static void ExecGrant_Parameter(InternalGrant *istmt);
static void SetDefaultACLsInSchemas(InternalDefaultACL *iacls, List *nspnames);
static void SetDefaultACL(InternalDefaultACL *iacls);
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 6ff48bb18..b5cb21fe5 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -125,9 +125,9 @@ static bool have_createdb_privilege(void);
static void remove_dbtablespaces(Oid db_id);
static bool check_db_file_conflict(Oid db_id);
static int errdetail_busy_db(int notherbackends, int npreparedxacts);
-static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dboid, Oid src_tsid,
+static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
Oid dst_tsid);
-static List *ScanSourceDatabasePgClass(Oid srctbid, Oid srcdbid, char *srcpath);
+static List *ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath);
static List *ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid,
Oid dbid, char *srcpath,
List *rlocatorlist, Snapshot snapshot);
@@ -136,8 +136,8 @@ static CreateDBRelInfo *ScanSourceDatabasePgClassTuple(HeapTupleData *tuple,
char *srcpath);
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid,
bool isRedo);
-static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dboid, Oid src_tsid,
- Oid dst_tsid);
+static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
+ Oid src_tsid, Oid dst_tsid);
static void recovery_create_dbdir(char *path, bool only_tblspc);
/*
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 635d05405..441f29d68 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -94,7 +94,7 @@ static void AlterEventTriggerOwner_internal(Relation rel,
static void error_duplicate_filter_variable(const char *defname);
static Datum filter_list_to_array(List *filterlist);
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
- Oid evtOwner, Oid funcoid, List *tags);
+ Oid evtOwner, Oid funcoid, List *taglist);
static void validate_ddl_tags(const char *filtervar, List *taglist);
static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 053d2ca5a..f86983c66 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -111,7 +111,7 @@ static void show_incremental_sort_info(IncrementalSortState *incrsortstate,
static void show_hash_info(HashState *hashstate, ExplainState *es);
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
ExplainState *es);
-static void show_hashagg_info(AggState *hashstate, ExplainState *es);
+static void show_hashagg_info(AggState *aggstate, ExplainState *es);
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
ExplainState *es);
static void show_instrumentation_count(const char *qlabel, int which,
diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c
index b97b8b043..b0747ce29 100644
--- a/src/backend/commands/lockcmds.c
+++ b/src/backend/commands/lockcmds.c
@@ -29,7 +29,7 @@
#include "utils/syscache.h"
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait);
-static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
+static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid);
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid,
Oid oldrelid, void *arg);
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index a583aa430..134610497 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -285,16 +285,16 @@ RenameSchema(const char *oldname, const char *newname)
}
void
-AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
+AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId)
{
HeapTuple tup;
Relation rel;
rel = table_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
+ tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(schemaoid));
if (!HeapTupleIsValid(tup))
- elog(ERROR, "cache lookup failed for schema %u", oid);
+ elog(ERROR, "cache lookup failed for schema %u", schemaoid);
AlterSchemaOwner_internal(tup, rel, newOwnerId);
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e3233a8f3..6c52edd9b 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -550,7 +550,7 @@ static ObjectAddress ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
AlterTableCmd *cmd, LOCKMODE lockmode);
static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab);
static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab);
-static void RememberStatisticsForRebuilding(Oid indoid, AlteredTableInfo *tab);
+static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab);
static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab,
LOCKMODE lockmode);
static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
@@ -610,7 +610,7 @@ static void ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partPa
List **partexprs, Oid *partopclass, Oid *partcollation, char strategy);
static void CreateInheritance(Relation child_rel, Relation parent_rel);
static void RemoveInheritance(Relation child_rel, Relation parent_rel,
- bool allow_detached);
+ bool expect_detached);
static ObjectAddress ATExecAttachPartition(List **wqueue, Relation rel,
PartitionCmd *cmd,
AlterTableUtilityContext *context);
@@ -627,7 +627,7 @@ static ObjectAddress ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab,
static void DetachPartitionFinalize(Relation rel, Relation partRel,
bool concurrent, Oid defaultPartOid);
static ObjectAddress ATExecDetachPartitionFinalize(Relation rel, RangeVar *name);
-static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation rel,
+static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
RangeVar *name);
static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 5ad18d2de..6f5a5262c 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -86,8 +86,8 @@ static bool GetTupleForTrigger(EState *estate,
ItemPointer tid,
LockTupleMode lockmode,
TupleTableSlot *oldslot,
- TupleTableSlot **newSlot,
- TM_FailureData *tmfpd);
+ TupleTableSlot **epqslot,
+ TM_FailureData *tmfdp);
static bool TriggerEnabled(EState *estate, ResultRelInfo *relinfo,
Trigger *trigger, TriggerEvent event,
Bitmapset *modifiedCols,
@@ -101,7 +101,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
ResultRelInfo *src_partinfo,
ResultRelInfo *dst_partinfo,
int event, bool row_trigger,
- TupleTableSlot *oldtup, TupleTableSlot *newtup,
+ TupleTableSlot *oldslot, TupleTableSlot *newslot,
List *recheckIndexes, Bitmapset *modifiedCols,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
@@ -3871,7 +3871,7 @@ static void TransitionTableAddTuple(EState *estate,
Tuplestorestate *tuplestore);
static void AfterTriggerFreeQuery(AfterTriggersQueryData *qs);
static SetConstraintState SetConstraintStateCreate(int numalloc);
-static SetConstraintState SetConstraintStateCopy(SetConstraintState state);
+static SetConstraintState SetConstraintStateCopy(SetConstraintState origstate);
static SetConstraintState SetConstraintStateAddItem(SetConstraintState state,
Oid tgoid, bool tgisdeferred);
static void cancel_prior_stmt_triggers(Oid relid, CmdType cmdType, int tgevent);
diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c
index 6a8735edf..1f1181b56 100644
--- a/src/backend/executor/execIndexing.c
+++ b/src/backend/executor/execIndexing.c
@@ -130,7 +130,7 @@ static bool check_exclusion_or_unique_constraint(Relation heap, Relation index,
Datum *values, bool *isnull,
EState *estate, bool newIndex,
CEOUC_WAIT_MODE waitMode,
- bool errorOK,
+ bool violationOK,
ItemPointer conflictTid);
static bool index_recheck_constraint(Relation index, Oid *constr_procs,
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index f1fd7f7e8..99512826c 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -126,9 +126,9 @@ typedef struct ExecParallelInitializeDSMContext
/* Helper functions that run in the parallel leader. */
static char *ExecSerializePlan(Plan *plan, EState *estate);
-static bool ExecParallelEstimate(PlanState *node,
+static bool ExecParallelEstimate(PlanState *planstate,
ExecParallelEstimateContext *e);
-static bool ExecParallelInitializeDSM(PlanState *node,
+static bool ExecParallelInitializeDSM(PlanState *planstate,
ExecParallelInitializeDSMContext *d);
static shm_mq_handle **ExecParallelSetupTupleQueues(ParallelContext *pcxt,
bool reinitialize);
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 933c30490..fe74e4981 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -396,7 +396,7 @@ static void prepare_projection_slot(AggState *aggstate,
TupleTableSlot *slot,
int currentSet);
static void finalize_aggregates(AggState *aggstate,
- AggStatePerAgg peragg,
+ AggStatePerAgg peraggs,
AggStatePerGroup pergroup);
static TupleTableSlot *project_aggregates(AggState *aggstate);
static void find_cols(AggState *aggstate, Bitmapset **aggregated,
@@ -407,12 +407,11 @@ static void build_hash_table(AggState *aggstate, int setno, long nbuckets);
static void hashagg_recompile_expressions(AggState *aggstate, bool minslot,
bool nullcheck);
static long hash_choose_num_buckets(double hashentrysize,
- long estimated_nbuckets,
- Size memory);
+ long ngroups, Size memory);
static int hash_choose_num_partitions(double input_groups,
double hashentrysize,
int used_bits,
- int *log2_npartittions);
+ int *log2_npartitions);
static void initialize_hash_entry(AggState *aggstate,
TupleHashTable hashtable,
TupleHashEntry entry);
@@ -432,11 +431,11 @@ static HashAggBatch *hashagg_batch_new(LogicalTape *input_tape, int setno,
int64 input_tuples, double input_card,
int used_bits);
static MinimalTuple hashagg_batch_read(HashAggBatch *batch, uint32 *hashp);
-static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *lts,
+static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *tapeset,
int used_bits, double input_groups,
double hashentrysize);
static Size hashagg_spill_tuple(AggState *aggstate, HashAggSpill *spill,
- TupleTableSlot *slot, uint32 hash);
+ TupleTableSlot *inputslot, uint32 hash);
static void hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill,
int setno);
static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 77dd1dae8..6622b202c 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -62,9 +62,9 @@ static HashJoinTuple ExecParallelHashTupleAlloc(HashJoinTable hashtable,
dsa_pointer *shared);
static void MultiExecPrivateHash(HashState *node);
static void MultiExecParallelHash(HashState *node);
-static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable hashtable,
int bucketno);
-static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable hashtable,
HashJoinTuple tuple);
static inline void ExecParallelHashPushTuple(dsa_pointer_atomic *head,
HashJoinTuple tuple,
@@ -73,7 +73,7 @@ static void ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch
static void ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable);
static void ExecParallelHashRepartitionFirst(HashJoinTable hashtable);
static void ExecParallelHashRepartitionRest(HashJoinTable hashtable);
-static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable table,
+static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable hashtable,
dsa_pointer *shared);
static bool ExecParallelHashTuplePrealloc(HashJoinTable hashtable,
int batchno,
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 87403e247..2718c2113 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -145,7 +145,7 @@ static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
TupleTableSlot *tupleSlot);
static bool ExecHashJoinNewBatch(HashJoinState *hjstate);
static bool ExecParallelHashJoinNewBatch(HashJoinState *hjstate);
-static void ExecParallelHashJoinPartitionOuter(HashJoinState *node);
+static void ExecParallelHashJoinPartitionOuter(HashJoinState *hjstate);
/* ----------------------------------------------------------------
@@ -1502,11 +1502,11 @@ ExecHashJoinInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
* ----------------------------------------------------------------
*/
void
-ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt)
+ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
{
int plan_node_id = state->js.ps.plan->plan_node_id;
ParallelHashJoinState *pstate =
- shm_toc_lookup(cxt->toc, plan_node_id, false);
+ shm_toc_lookup(pcxt->toc, plan_node_id, false);
/*
* It would be possible to reuse the shared hash table in single-batch
diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index d1b97d46b..972e024db 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -1229,10 +1229,10 @@ ExecIncrementalSortInitializeDSM(IncrementalSortState *node, ParallelContext *pc
* ----------------------------------------------------------------
*/
void
-ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pwcxt)
+ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pcxt)
{
node->shared_info =
- shm_toc_lookup(pwcxt->toc, node->ss.ps.plan->plan_node_id, true);
+ shm_toc_lookup(pcxt->toc, node->ss.ps.plan->plan_node_id, true);
node->am_worker = true;
}
diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c
index d2bceb97c..7bfe02464 100644
--- a/src/backend/executor/nodeMemoize.c
+++ b/src/backend/executor/nodeMemoize.c
@@ -133,8 +133,8 @@ typedef struct MemoizeEntry
static uint32 MemoizeHash_hash(struct memoize_hash *tb,
const MemoizeKey *key);
static bool MemoizeHash_equal(struct memoize_hash *tb,
- const MemoizeKey *params1,
- const MemoizeKey *params2);
+ const MemoizeKey *key1,
+ const MemoizeKey *key2);
#define SH_PREFIX memoize
#define SH_ELEMENT_TYPE MemoizeEntry
diff --git a/src/backend/lib/bloomfilter.c b/src/backend/lib/bloomfilter.c
index 465ca7cf6..3ef67d35a 100644
--- a/src/backend/lib/bloomfilter.c
+++ b/src/backend/lib/bloomfilter.c
@@ -55,7 +55,7 @@ static int my_bloom_power(uint64 target_bitset_bits);
static int optimal_k(uint64 bitset_bits, int64 total_elems);
static void k_hashes(bloom_filter *filter, uint32 *hashes, unsigned char *elem,
size_t len);
-static inline uint32 mod_m(uint32 a, uint64 m);
+static inline uint32 mod_m(uint32 val, uint64 m);
/*
* Create Bloom filter in caller's memory context. We aim for a false positive
diff --git a/src/backend/lib/integerset.c b/src/backend/lib/integerset.c
index 41d3abdb0..345cd1b3a 100644
--- a/src/backend/lib/integerset.c
+++ b/src/backend/lib/integerset.c
@@ -264,9 +264,9 @@ static void intset_update_upper(IntegerSet *intset, int level,
intset_node *child, uint64 child_key);
static void intset_flush_buffered_values(IntegerSet *intset);
-static int intset_binsrch_uint64(uint64 value, uint64 *arr, int arr_elems,
+static int intset_binsrch_uint64(uint64 item, uint64 *arr, int arr_elems,
bool nextkey);
-static int intset_binsrch_leaf(uint64 value, leaf_item *arr, int arr_elems,
+static int intset_binsrch_leaf(uint64 item, leaf_item *arr, int arr_elems,
bool nextkey);
static uint64 simple8b_encode(const uint64 *ints, int *num_encoded, uint64 base);
diff --git a/src/backend/optimizer/geqo/geqo_selection.c b/src/backend/optimizer/geqo/geqo_selection.c
index 50f678a49..fd3f6894d 100644
--- a/src/backend/optimizer/geqo/geqo_selection.c
+++ b/src/backend/optimizer/geqo/geqo_selection.c
@@ -42,7 +42,7 @@
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_selection.h"
-static int linear_rand(PlannerInfo *root, int max, double bias);
+static int linear_rand(PlannerInfo *root, int pool_size, double bias);
/*
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 5012bfe14..6d5718ee4 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -75,7 +75,8 @@ static List *build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
static List *get_relation_statistics(RelOptInfo *rel, Relation relation);
static void set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
Relation relation);
-static PartitionScheme find_partition_scheme(PlannerInfo *root, Relation rel);
+static PartitionScheme find_partition_scheme(PlannerInfo *root,
+ Relation relation);
static void set_baserel_partition_key_exprs(Relation relation,
RelOptInfo *rel);
static void set_baserel_partition_constraint(Relation relation,
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index ea3378431..581a6cbf8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -205,8 +205,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args,
static List *mergeTableFuncParameters(List *func_args, List *columns);
static TypeName *TableFuncTypeName(List *columns);
static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner);
-static RangeVar *makeRangeVarFromQualifiedName(char *name, List *rels,
- int location,
+static RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location,
core_yyscan_t yyscanner);
static void SplitColQualList(List *qualList,
List **constraintList, CollateClause **collClause,
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 061d0bcc5..202a38f81 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -67,7 +67,7 @@ static ParseNamespaceItem *transformRangeSubselect(ParseState *pstate,
static ParseNamespaceItem *transformRangeFunction(ParseState *pstate,
RangeFunction *r);
static ParseNamespaceItem *transformRangeTableFunc(ParseState *pstate,
- RangeTableFunc *t);
+ RangeTableFunc *rtf);
static TableSampleClause *transformRangeTableSample(ParseState *pstate,
RangeTableSample *rts);
static ParseNamespaceItem *getNSItemForSpecialRelationTypes(ParseState *pstate,
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 6d283006e..bd068bba0 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -139,7 +139,7 @@ static void transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd);
static List *transformPartitionRangeBounds(ParseState *pstate, List *blist,
Relation parent);
static void validateInfiniteBounds(ParseState *pstate, List *blist);
-static Const *transformPartitionBoundValue(ParseState *pstate, Node *con,
+static Const *transformPartitionBoundValue(ParseState *pstate, Node *val,
const char *colName, Oid colType, int32 colTypmod,
Oid partCollation);
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 57c9b5181..7f74ed212 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -104,7 +104,7 @@ static PartitionBoundInfo create_list_bounds(PartitionBoundSpec **boundspecs,
static PartitionBoundInfo create_range_bounds(PartitionBoundSpec **boundspecs,
int nparts, PartitionKey key, int **mapping);
static PartitionBoundInfo merge_list_bounds(FmgrInfo *partsupfunc,
- Oid *collations,
+ Oid *partcollation,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel,
JoinType jointype,
@@ -123,8 +123,8 @@ static void free_partition_map(PartitionMap *map);
static bool is_dummy_partition(RelOptInfo *rel, int part_index);
static int merge_matching_partitions(PartitionMap *outer_map,
PartitionMap *inner_map,
- int outer_part,
- int inner_part,
+ int outer_index,
+ int inner_index,
int *next_index);
static int process_outer_partition(PartitionMap *outer_map,
PartitionMap *inner_map,
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index de1184ad7..383bc4776 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -414,7 +414,7 @@ static void report_fork_failure_to_client(Port *port, int errnum);
static CAC_state canAcceptConnections(int backend_type);
static bool RandomCancelKey(int32 *cancel_key);
static void signal_child(pid_t pid, int signal);
-static bool SignalSomeChildren(int signal, int targets);
+static bool SignalSomeChildren(int signal, int target);
static void TerminateChildren(int signal);
#define SignalChildren(sig) SignalSomeChildren(sig, BACKEND_TYPE_ALL)
@@ -2598,9 +2598,9 @@ ConnCreate(int serverFd)
* to do here.
*/
static void
-ConnFree(Port *conn)
+ConnFree(Port *port)
{
- free(conn);
+ free(port);
}
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 89cf9f938..7d41aabd5 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -250,7 +250,7 @@ static void ReorderBufferSerializeChange(ReorderBuffer *rb, ReorderBufferTXN *tx
static Size ReorderBufferRestoreChanges(ReorderBuffer *rb, ReorderBufferTXN *txn,
TXNEntryFile *file, XLogSegNo *segno);
static void ReorderBufferRestoreChange(ReorderBuffer *rb, ReorderBufferTXN *txn,
- char *change);
+ char *data);
static void ReorderBufferRestoreCleanup(ReorderBuffer *rb, ReorderBufferTXN *txn);
static void ReorderBufferTruncateTXN(ReorderBuffer *rb, ReorderBufferTXN *txn,
bool txn_prepared);
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 62e0ffecd..03b13ae67 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -44,7 +44,7 @@ static void pgoutput_begin_txn(LogicalDecodingContext *ctx,
static void pgoutput_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pgoutput_change(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, Relation rel,
+ ReorderBufferTXN *txn, Relation relation,
ReorderBufferChange *change);
static void pgoutput_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, int nrelations, Relation relations[],
@@ -212,7 +212,7 @@ typedef struct PGOutputTxnData
/* Map used to remember which relation schemas we sent. */
static HTAB *RelationSyncCache = NULL;
-static void init_rel_sync_cache(MemoryContext decoding_context);
+static void init_rel_sync_cache(MemoryContext cachectx);
static void cleanup_rel_sync_cache(TransactionId xid, bool is_commit);
static RelationSyncEntry *get_rel_sync_entry(PGOutputData *data,
Relation relation);
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 8fec1cb4a..0bd003118 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -108,7 +108,7 @@ static void ReplicationSlotDropPtr(ReplicationSlot *slot);
/* internal persistency functions */
static void RestoreSlotFromDisk(const char *name);
static void CreateSlotOnDisk(ReplicationSlot *slot);
-static void SaveSlotToPath(ReplicationSlot *slot, const char *path, int elevel);
+static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel);
/*
* Report shared-memory space needed by ReplicationSlotsShmemInit.
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index ee05e230e..ab97e71dd 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -83,7 +83,7 @@ static void statext_store(Oid statOid, bool inh,
MVNDistinct *ndistinct, MVDependencies *dependencies,
MCVList *mcv, Datum exprs, VacAttrStats **stats);
static int statext_compute_stattarget(int stattarget,
- int natts, VacAttrStats **stats);
+ int nattrs, VacAttrStats **stats);
/* Information needed to analyze a single simple expression. */
typedef struct AnlExprData
@@ -99,7 +99,7 @@ static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs);
static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
static AnlExprData *build_expr_data(List *exprs, int stattarget);
-static StatsBuildData *make_build_data(Relation onerel, StatExtEntry *stat,
+static StatsBuildData *make_build_data(Relation rel, StatExtEntry *stat,
int numrows, HeapTuple *rows,
VacAttrStats **stats, int stattarget);
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e898ffad7..5b0e531f9 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -459,7 +459,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
)
-static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence,
+static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence,
ForkNumber forkNum, BlockNumber blockNum,
ReadBufferMode mode, BufferAccessStrategy strategy,
bool *hit);
@@ -493,7 +493,7 @@ static void RelationCopyStorageUsingBuffer(RelFileLocator srclocator,
static void AtProcExit_Buffers(int code, Datum arg);
static void CheckForBufferLeaks(void);
static int rlocator_comparator(const void *p1, const void *p2);
-static inline int buffertag_comparator(const BufferTag *a, const BufferTag *b);
+static inline int buffertag_comparator(const BufferTag *ba, const BufferTag *bb);
static inline int ckpt_buforder_comparator(const CkptSortItem *a, const CkptSortItem *b);
static int ts_ckpt_progress_comparator(Datum a, Datum b, void *arg);
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index 562ac5b43..5f2a4805d 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -446,7 +446,7 @@ static void SerialSetActiveSerXmin(TransactionId xid);
static uint32 predicatelock_hash(const void *key, Size keysize);
static void SummarizeOldestCommittedSxact(void);
-static Snapshot GetSafeSnapshot(Snapshot snapshot);
+static Snapshot GetSafeSnapshot(Snapshot origSnapshot);
static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot,
VirtualTransactionId *sourcevxid,
int sourcepid);
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 3deac496e..9939e6aee 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -121,7 +121,7 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */
/* local routines */
-static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum,
+static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum,
bool isRedo);
static MdfdVec *mdopenfork(SMgrRelation reln, ForkNumber forknum, int behavior);
static void register_dirty_segment(SMgrRelation reln, ForkNumber forknum,
@@ -135,9 +135,9 @@ static void _fdvec_resize(SMgrRelation reln,
int nseg);
static char *_mdfd_segpath(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno);
-static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno, int oflags);
-static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber blkno, bool skipFsync, int behavior);
static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum,
MdfdVec *seg);
@@ -179,16 +179,16 @@ mdexists(SMgrRelation reln, ForkNumber forkNum)
* If isRedo is true, it's okay for the relation to exist already.
*/
void
-mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
+mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
{
MdfdVec *mdfd;
char *path;
File fd;
- if (isRedo && reln->md_num_open_segs[forkNum] > 0)
+ if (isRedo && reln->md_num_open_segs[forknum] > 0)
return; /* created and opened already... */
- Assert(reln->md_num_open_segs[forkNum] == 0);
+ Assert(reln->md_num_open_segs[forknum] == 0);
/*
* We may be using the target table space for the first time in this
@@ -203,7 +203,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
reln->smgr_rlocator.locator.dbOid,
isRedo);
- path = relpath(reln->smgr_rlocator, forkNum);
+ path = relpath(reln->smgr_rlocator, forknum);
fd = PathNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
@@ -225,8 +225,8 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
pfree(path);
- _fdvec_resize(reln, forkNum, 1);
- mdfd = &reln->md_seg_fds[forkNum][0];
+ _fdvec_resize(reln, forknum, 1);
+ mdfd = &reln->md_seg_fds[forknum][0];
mdfd->mdfd_vfd = fd;
mdfd->mdfd_segno = 0;
}
@@ -237,7 +237,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
* Note that we're passed a RelFileLocatorBackend --- by the time this is called,
* there won't be an SMgrRelation hashtable entry anymore.
*
- * forkNum can be a fork number to delete a specific fork, or InvalidForkNumber
+ * forknum can be a fork number to delete a specific fork, or InvalidForkNumber
* to delete all forks.
*
* For regular relations, we don't unlink the first segment file of the rel,
@@ -278,16 +278,16 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
* we are usually not in a transaction anymore when this is called.
*/
void
-mdunlink(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
/* Now do the per-fork work */
- if (forkNum == InvalidForkNumber)
+ if (forknum == InvalidForkNumber)
{
- for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++)
- mdunlinkfork(rlocator, forkNum, isRedo);
+ for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
+ mdunlinkfork(rlocator, forknum, isRedo);
}
else
- mdunlinkfork(rlocator, forkNum, isRedo);
+ mdunlinkfork(rlocator, forknum, isRedo);
}
/*
@@ -315,18 +315,18 @@ do_truncate(const char *path)
}
static void
-mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
char *path;
int ret;
BlockNumber segno = 0;
- path = relpath(rlocator, forkNum);
+ path = relpath(rlocator, forknum);
/*
* Delete or truncate the first segment.
*/
- if (isRedo || forkNum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
+ if (isRedo || forknum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
{
if (!RelFileLocatorBackendIsTemp(rlocator))
{
@@ -334,7 +334,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
ret = do_truncate(path);
/* Forget any pending sync requests for the first segment */
- register_forget_request(rlocator, forkNum, 0 /* first seg */ );
+ register_forget_request(rlocator, forknum, 0 /* first seg */ );
}
else
ret = 0;
@@ -367,7 +367,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
*/
if (!IsBinaryUpgrade)
{
- register_unlink_segment(rlocator, forkNum, 0 /* first seg */ );
+ register_unlink_segment(rlocator, forknum, 0 /* first seg */ );
++segno;
}
}
@@ -403,7 +403,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
* Forget any pending sync requests for this segment before we
* try to unlink.
*/
- register_forget_request(rlocator, forkNum, segno);
+ register_forget_request(rlocator, forknum, segno);
}
if (unlink(segpath) < 0)
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 43fff50d4..350039cc8 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -32,7 +32,7 @@
#include "utils/memutils.h"
#include "utils/tzparser.h"
-static int DecodeNumber(int flen, char *field, bool haveTextMonth,
+static int DecodeNumber(int flen, char *str, bool haveTextMonth,
int fmask, int *tmask,
struct pg_tm *tm, fsec_t *fsec, bool *is2digits);
static int DecodeNumberField(int len, char *str,
@@ -281,26 +281,26 @@ static const datetkn *abbrevcache[MAXDATEFIELDS] = {NULL};
*/
int
-date2j(int y, int m, int d)
+date2j(int year, int month, int day)
{
int julian;
int century;
- if (m > 2)
+ if (month > 2)
{
- m += 1;
- y += 4800;
+ month += 1;
+ year += 4800;
}
else
{
- m += 13;
- y += 4799;
+ month += 13;
+ year += 4799;
}
- century = y / 100;
- julian = y * 365 - 32167;
- julian += y / 4 - century + century / 4;
- julian += 7834 * m / 256 + d;
+ century = year / 100;
+ julian = year * 365 - 32167;
+ julian += year / 4 - century + century / 4;
+ julian += 7834 * month / 256 + day;
return julian;
} /* date2j() */
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f1b632ef3..d78002b90 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -90,7 +90,7 @@ static inline float8 line_sl(LINE *line);
static inline float8 line_invsl(LINE *line);
static bool line_interpt_line(Point *result, LINE *l1, LINE *l2);
static bool line_contain_point(LINE *line, Point *point);
-static float8 line_closept_point(Point *result, LINE *line, Point *pt);
+static float8 line_closept_point(Point *result, LINE *line, Point *point);
/* Routines for line segments */
static inline void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
@@ -98,8 +98,8 @@ static inline float8 lseg_sl(LSEG *lseg);
static inline float8 lseg_invsl(LSEG *lseg);
static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line);
static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2);
-static int lseg_crossing(float8 x, float8 y, float8 px, float8 py);
-static bool lseg_contain_point(LSEG *lseg, Point *point);
+static int lseg_crossing(float8 x, float8 y, float8 prev_x, float8 prev_y);
+static bool lseg_contain_point(LSEG *lseg, Point *pt);
static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt);
static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line);
static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg);
@@ -115,7 +115,7 @@ static bool box_contain_point(BOX *box, Point *point);
static bool box_contain_box(BOX *contains_box, BOX *contained_box);
static bool box_contain_lseg(BOX *box, LSEG *lseg);
static bool box_interpt_lseg(Point *result, BOX *box, LSEG *lseg);
-static float8 box_closept_point(Point *result, BOX *box, Point *point);
+static float8 box_closept_point(Point *result, BOX *box, Point *pt);
static float8 box_closept_lseg(Point *result, BOX *box, LSEG *lseg);
/* Routines for circles */
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c
index 60442758b..e5cc4c945 100644
--- a/src/backend/utils/adt/jsonb_util.c
+++ b/src/backend/utils/adt/jsonb_util.c
@@ -57,14 +57,15 @@ static short padBufferToInt(StringInfo buffer);
static JsonbIterator *iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent);
static JsonbIterator *freeAndGetParent(JsonbIterator *it);
static JsonbParseState *pushState(JsonbParseState **pstate);
-static void appendKey(JsonbParseState *pstate, JsonbValue *scalarVal);
+static void appendKey(JsonbParseState *pstate, JsonbValue *string);
static void appendValue(JsonbParseState *pstate, JsonbValue *scalarVal);
static void appendElement(JsonbParseState *pstate, JsonbValue *scalarVal);
static int lengthCompareJsonbStringValue(const void *a, const void *b);
static int lengthCompareJsonbString(const char *val1, int len1,
const char *val2, int len2);
-static int lengthCompareJsonbPair(const void *a, const void *b, void *arg);
-static void uniqueifyJsonbObject(JsonbValue *object);
+static int lengthCompareJsonbPair(const void *a, const void *b, void *binequal);
+static void uniqueifyJsonbObject(JsonbValue *object, bool unique_keys,
+ bool skip_nulls);
static JsonbValue *pushJsonbValueScalar(JsonbParseState **pstate,
JsonbIteratorToken seq,
JsonbValue *scalarVal);
@@ -1394,22 +1395,22 @@ JsonbHashScalarValueExtended(const JsonbValue *scalarVal, uint64 *hash,
* Are two scalar JsonbValues of the same type a and b equal?
*/
static bool
-equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+equalsJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return true;
case jbvString:
- return lengthCompareJsonbStringValue(aScalar, bScalar) == 0;
+ return lengthCompareJsonbStringValue(a, b) == 0;
case jbvNumeric:
return DatumGetBool(DirectFunctionCall2(numeric_eq,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- return aScalar->val.boolean == bScalar->val.boolean;
+ return a->val.boolean == b->val.boolean;
default:
elog(ERROR, "invalid jsonb scalar type");
@@ -1426,28 +1427,28 @@ equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
* operators, where a lexical sort order is generally expected.
*/
static int
-compareJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+compareJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return 0;
case jbvString:
- return varstr_cmp(aScalar->val.string.val,
- aScalar->val.string.len,
- bScalar->val.string.val,
- bScalar->val.string.len,
+ return varstr_cmp(a->val.string.val,
+ a->val.string.len,
+ b->val.string.val,
+ b->val.string.len,
DEFAULT_COLLATION_OID);
case jbvNumeric:
return DatumGetInt32(DirectFunctionCall2(numeric_cmp,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- if (aScalar->val.boolean == bScalar->val.boolean)
+ if (a->val.boolean == b->val.boolean)
return 0;
- else if (aScalar->val.boolean > bScalar->val.boolean)
+ else if (a->val.boolean > b->val.boolean)
return 1;
else
return -1;
@@ -1608,13 +1609,13 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
}
static void
-convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbArray(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerhead;
int nElems = val->val.array.nElems;
/* Remember where in the buffer this array starts. */
@@ -1627,15 +1628,15 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nElems | JB_FARRAY;
+ containerhead = nElems | JB_FARRAY;
if (val->val.array.rawScalar)
{
Assert(nElems == 1);
Assert(level == 0);
- header |= JB_FSCALAR;
+ containerhead |= JB_FSCALAR;
}
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ appendToBuffer(buffer, (char *) &containerhead, sizeof(uint32));
/* Reserve space for the JEntries of the elements. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nElems);
@@ -1688,17 +1689,17 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbObject(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerheader;
int nPairs = val->val.object.nPairs;
/* Remember where in the buffer this object starts. */
@@ -1711,8 +1712,8 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nPairs | JB_FOBJECT;
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ containerheader = nPairs | JB_FOBJECT;
+ appendToBuffer(buffer, (char *) &containerheader, sizeof(uint32));
/* Reserve space for the JEntries of the keys and values. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nPairs * 2);
@@ -1804,11 +1805,11 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
+convertJsonbScalar(StringInfo buffer, JEntry *header, JsonbValue *scalarVal)
{
int numlen;
short padlen;
@@ -1816,13 +1817,13 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
switch (scalarVal->type)
{
case jbvNull:
- *jentry = JENTRY_ISNULL;
+ *header = JENTRY_ISNULL;
break;
case jbvString:
appendToBuffer(buffer, scalarVal->val.string.val, scalarVal->val.string.len);
- *jentry = scalarVal->val.string.len;
+ *header = scalarVal->val.string.len;
break;
case jbvNumeric:
@@ -1831,11 +1832,11 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
appendToBuffer(buffer, (char *) scalarVal->val.numeric, numlen);
- *jentry = JENTRY_ISNUMERIC | (padlen + numlen);
+ *header = JENTRY_ISNUMERIC | (padlen + numlen);
break;
case jbvBool:
- *jentry = (scalarVal->val.boolean) ?
+ *header = (scalarVal->val.boolean) ?
JENTRY_ISBOOL_TRUE : JENTRY_ISBOOL_FALSE;
break;
@@ -1851,7 +1852,7 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
len = strlen(buf);
appendToBuffer(buffer, buf, len);
- *jentry = len;
+ *header = len;
}
break;
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 9f4192e07..9abc0c062 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -225,7 +225,7 @@ static JsonPathExecResult appendBoolResult(JsonPathExecContext *cxt,
static void getJsonPathItem(JsonPathExecContext *cxt, JsonPathItem *item,
JsonbValue *value);
static void getJsonPathVariable(JsonPathExecContext *cxt,
- JsonPathItem *variable, Jsonb *vars, JsonbValue *value);
+ JsonPathItem *variable, JsonbValue *value);
static int JsonbArraySize(JsonbValue *jb);
static JsonPathBool executeComparison(JsonPathItem *cmp, JsonbValue *lv,
JsonbValue *rv, void *p);
@@ -252,7 +252,7 @@ static int JsonbType(JsonbValue *jb);
static JsonbValue *getScalar(JsonbValue *scalar, enum jbvType type);
static JsonbValue *wrapItemsInArray(const JsonValueList *items);
static int compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
- bool useTz, bool *have_error);
+ bool useTz, bool *cast_error);
/****************** User interface to JsonPath executor ********************/
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 920a63b00..85ee9ec42 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -499,7 +499,7 @@ static void zero_var(NumericVar *var);
static const char *set_var_from_str(const char *str, const char *cp,
NumericVar *dest);
-static void set_var_from_num(Numeric value, NumericVar *dest);
+static void set_var_from_num(Numeric num, NumericVar *dest);
static void init_var_from_num(Numeric num, NumericVar *dest);
static void set_var_from_var(const NumericVar *value, NumericVar *dest);
static char *get_str_from_var(const NumericVar *var);
@@ -510,7 +510,7 @@ static void numericvar_deserialize(StringInfo buf, NumericVar *var);
static Numeric duplicate_numeric(Numeric num);
static Numeric make_result(const NumericVar *var);
-static Numeric make_result_opt_error(const NumericVar *var, bool *error);
+static Numeric make_result_opt_error(const NumericVar *var, bool *have_error);
static void apply_typmod(NumericVar *var, int32 typmod);
static void apply_typmod_special(Numeric num, int32 typmod);
@@ -591,7 +591,7 @@ static void compute_bucket(Numeric operand, Numeric bound1, Numeric bound2,
const NumericVar *count_var, bool reversed_bounds,
NumericVar *result_var);
-static void accum_sum_add(NumericSumAccum *accum, const NumericVar *var1);
+static void accum_sum_add(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_rescale(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_carry(NumericSumAccum *accum);
static void accum_sum_reset(NumericSumAccum *accum);
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index aa4c53e0a..b09cb4905 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -55,14 +55,14 @@ typedef struct RangeIOData
static RangeIOData *get_range_io_data(FunctionCallInfo fcinfo, Oid rngtypid,
IOFuncSelector func);
static char range_parse_flags(const char *flags_str);
-static void range_parse(const char *input_str, char *flags, char **lbound_str,
+static void range_parse(const char *string, char *flags, char **lbound_str,
char **ubound_str);
static const char *range_parse_bound(const char *string, const char *ptr,
char **bound_str, bool *infinite);
static char *range_deparse(char flags, const char *lbound_str,
const char *ubound_str);
static char *range_bound_escape(const char *value);
-static Size datum_compute_size(Size sz, Datum datum, bool typbyval,
+static Size datum_compute_size(Size data_length, Datum val, bool typbyval,
char typalign, int16 typlen, char typstorage);
static Pointer datum_write(Pointer ptr, Datum datum, bool typbyval,
char typalign, int16 typlen, char typstorage);
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 51b3fdc9a..1d503e7e0 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -196,7 +196,7 @@ static void ri_GenerateQual(StringInfo buf,
Oid opoid,
const char *rightop, Oid rightoptype);
static void ri_GenerateQualCollation(StringInfo buf, Oid collation);
-static int ri_NullCheck(TupleDesc tupdesc, TupleTableSlot *slot,
+static int ri_NullCheck(TupleDesc tupDesc, TupleTableSlot *slot,
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
static void ri_BuildQueryKey(RI_QueryKey *key,
const RI_ConstraintInfo *riinfo,
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 021b760f4..9799647e1 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -2034,9 +2034,9 @@ time2t(const int hour, const int min, const int sec, const fsec_t fsec)
}
static Timestamp
-dt2local(Timestamp dt, int tz)
+dt2local(Timestamp dt, int timezone)
{
- dt -= (tz * USECS_PER_SEC);
+ dt -= (timezone * USECS_PER_SEC);
return dt;
}
diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c
index e7345e141..626656860 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -137,7 +137,7 @@ static RelMapFile pending_local_updates;
/* non-export function prototypes */
static void apply_map_update(RelMapFile *map, Oid relationId,
- RelFileNumber filenumber, bool add_okay);
+ RelFileNumber fileNumber, bool add_okay);
static void merge_map_updates(RelMapFile *map, const RelMapFile *updates,
bool add_okay);
static void load_relmap_file(bool shared, bool lock_held);
diff --git a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
index 93493d415..25791e23e 100644
--- a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
+++ b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
@@ -54,8 +54,8 @@ static int sjis2mic(const unsigned char *sjis, unsigned char *p, int len, bool n
static int mic2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_jp2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
static int mic2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int euc_jp2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int sjis2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
+static int euc_jp2sjis(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int sjis2euc_jp(const unsigned char *sjis, unsigned char *p, int len, bool noError);
Datum
euc_jp_to_sjis(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
index e00a2ca41..88e0deb5e 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
@@ -41,7 +41,7 @@ PG_FUNCTION_INFO_V1(mic_to_big5);
*/
static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError);
-static int big52euc_tw(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
diff --git a/src/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c
index a67487e5f..6e75acda2 100644
--- a/src/backend/utils/misc/queryjumble.c
+++ b/src/backend/utils/misc/queryjumble.c
@@ -45,7 +45,8 @@ int compute_query_id = COMPUTE_QUERY_ID_AUTO;
/* True when compute_query_id is ON, or AUTO and a module requests them */
bool query_id_enabled = false;
-static uint64 compute_utility_query_id(const char *str, int query_location, int query_len);
+static uint64 compute_utility_query_id(const char *query_text,
+ int query_location, int query_len);
static void AppendJumble(JumbleState *jstate,
const unsigned char *item, Size size);
static void JumbleQueryInternal(JumbleState *jstate, Query *query);
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 9b504c974..f1f2ddac1 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -680,9 +680,9 @@ FreeSnapshot(Snapshot snapshot)
* with active refcount=1. Otherwise, only increment the refcount.
*/
void
-PushActiveSnapshot(Snapshot snap)
+PushActiveSnapshot(Snapshot snapshot)
{
- PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
+ PushActiveSnapshotWithLevel(snapshot, GetCurrentTransactionNestLevel());
}
/*
@@ -694,11 +694,11 @@ PushActiveSnapshot(Snapshot snap)
* must not be deeper than the current top of the snapshot stack.
*/
void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
+PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
{
ActiveSnapshotElt *newactive;
- Assert(snap != InvalidSnapshot);
+ Assert(snapshot != InvalidSnapshot);
Assert(ActiveSnapshot == NULL || snap_level >= ActiveSnapshot->as_level);
newactive = MemoryContextAlloc(TopTransactionContext, sizeof(ActiveSnapshotElt));
@@ -707,10 +707,11 @@ PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
* Checking SecondarySnapshot is probably useless here, but it seems
* better to be sure.
*/
- if (snap == CurrentSnapshot || snap == SecondarySnapshot || !snap->copied)
- newactive->as_snap = CopySnapshot(snap);
+ if (snapshot == CurrentSnapshot || snapshot == SecondarySnapshot ||
+ !snapshot->copied)
+ newactive->as_snap = CopySnapshot(snapshot);
else
- newactive->as_snap = snap;
+ newactive->as_snap = snapshot;
newactive->as_next = ActiveSnapshot;
newactive->as_level = snap_level;
@@ -2119,20 +2120,20 @@ HistoricSnapshotGetTupleCids(void)
* SerializedSnapshotData.
*/
Size
-EstimateSnapshotSpace(Snapshot snap)
+EstimateSnapshotSpace(Snapshot snapshot)
{
Size size;
- Assert(snap != InvalidSnapshot);
- Assert(snap->snapshot_type == SNAPSHOT_MVCC);
+ Assert(snapshot != InvalidSnapshot);
+ Assert(snapshot->snapshot_type == SNAPSHOT_MVCC);
/* We allocate any XID arrays needed in the same palloc block. */
size = add_size(sizeof(SerializedSnapshotData),
- mul_size(snap->xcnt, sizeof(TransactionId)));
- if (snap->subxcnt > 0 &&
- (!snap->suboverflowed || snap->takenDuringRecovery))
+ mul_size(snapshot->xcnt, sizeof(TransactionId)));
+ if (snapshot->subxcnt > 0 &&
+ (!snapshot->suboverflowed || snapshot->takenDuringRecovery))
size = add_size(size,
- mul_size(snap->subxcnt, sizeof(TransactionId)));
+ mul_size(snapshot->subxcnt, sizeof(TransactionId)));
return size;
}
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index e00837eca..b46ee1098 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -275,7 +275,7 @@ static char *escape_quotes_bki(const char *src);
static int locale_date_order(const char *locale);
static void check_locale_name(int category, const char *locale,
char **canonname);
-static bool check_locale_encoding(const char *locale, int encoding);
+static bool check_locale_encoding(const char *locale, int user_enc);
static void setlocales(void);
static void usage(const char *progname);
void setup_pgdata(void);
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index f064cff4a..0afc79413 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -63,7 +63,7 @@ static DIR *get_destination_dir(char *dest_folder);
static void close_destination_dir(DIR *dest_dir, char *dest_folder);
static XLogRecPtr FindStreamingStart(uint32 *tli);
static void StreamLog(void);
-static bool stop_streaming(XLogRecPtr segendpos, uint32 timeline,
+static bool stop_streaming(XLogRecPtr xlogpos, uint32 timeline,
bool segment_finished);
static void
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 8638f81f3..1537ef47e 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -44,7 +44,7 @@ extern bool RunIdentifySystem(PGconn *conn, char **sysid,
extern void AppendPlainCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
- char *option_value);
+ char *option_name);
extern void AppendStringCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
char *option_name, char *option_value);
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
index 54a853bd4..e6277c463 100644
--- a/src/bin/pg_rewind/file_ops.h
+++ b/src/bin/pg_rewind/file_ops.h
@@ -17,8 +17,8 @@ extern void write_target_range(char *buf, off_t begin, size_t size);
extern void close_target_file(void);
extern void remove_target_file(const char *path, bool missing_ok);
extern void truncate_target_file(const char *path, off_t newsize);
-extern void create_target(file_entry_t *t);
-extern void remove_target(file_entry_t *t);
+extern void create_target(file_entry_t *entry);
+extern void remove_target(file_entry_t *entry);
extern void sync_target_dir(void);
extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h
index 8b4b50a33..80c276285 100644
--- a/src/bin/pg_rewind/pg_rewind.h
+++ b/src/bin/pg_rewind/pg_rewind.h
@@ -37,7 +37,7 @@ extern uint64 fetch_done;
extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
int tliIndex, XLogRecPtr endpoint,
const char *restoreCommand);
-extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
+extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
int tliIndex,
XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
XLogRecPtr *lastchkptredo,
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 53ea348e2..f18cf9712 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -23,7 +23,7 @@ static void free_db_and_rel_infos(DbInfoArr *db_arr);
static void get_db_infos(ClusterInfo *cluster);
static void get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo);
static void free_rel_infos(RelInfoArr *rel_arr);
-static void print_db_infos(DbInfoArr *dbinfo);
+static void print_db_infos(DbInfoArr *db_arr);
static void print_rel_infos(RelInfoArr *rel_arr);
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index 63d02719a..2c0d285de 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -134,7 +134,7 @@ static void verify_backup_file(verifier_context *context,
static void report_extra_backup_files(verifier_context *context);
static void verify_backup_checksums(verifier_context *context);
static void verify_file_checksum(verifier_context *context,
- manifest_file *m, char *pathname);
+ manifest_file *m, char *fullpath);
static void parse_required_wal(verifier_context *context,
char *pg_waldump_path,
char *wal_directory,
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index abbdc443a..40903bc16 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -158,10 +158,10 @@ extern char *expr_scanner_get_substring(PsqlScanState state,
extern int expr_scanner_get_lineno(PsqlScanState state, int offset);
extern void syntax_error(const char *source, int lineno, const char *line,
- const char *cmd, const char *msg,
- const char *more, int col) pg_attribute_noreturn();
+ const char *command, const char *msg,
+ const char *more, int column) pg_attribute_noreturn();
-extern bool strtoint64(const char *str, bool errorOK, int64 *pi);
-extern bool strtodouble(const char *str, bool errorOK, double *pd);
+extern bool strtoint64(const char *str, bool errorOK, int64 *result);
+extern bool strtodouble(const char *str, bool errorOK, double *dv);
#endif /* PGBENCH_H */
diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h
index 7872c71f5..bd051e09c 100644
--- a/src/bin/psql/describe.h
+++ b/src/bin/psql/describe.h
@@ -127,16 +127,16 @@ bool describeSubscriptions(const char *pattern, bool verbose);
/* \dAc */
extern bool listOperatorClasses(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAf */
extern bool listOperatorFamilies(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAo */
-extern bool listOpFamilyOperators(const char *accessMethod_pattern,
+extern bool listOpFamilyOperators(const char *access_method_pattern,
const char *family_pattern, bool verbose);
/* \dAp */
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 84a1be72f..9d91ad87c 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -18,7 +18,7 @@
extern void splitTableColumnsSpec(const char *spec, int encoding,
char **table, const char **columns);
-extern void appendQualifiedRelation(PQExpBuffer buf, const char *name,
+extern void appendQualifiedRelation(PQExpBuffer buf, const char *spec,
PGconn *conn, bool echo);
extern bool yesno_prompt(const char *question);
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 917b19e0e..746e9b4f1 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -381,7 +381,7 @@ static void closePGconn(PGconn *conn);
static void release_conn_addrinfo(PGconn *conn);
static void sendTerminateConn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
-static PQconninfoOption *parse_connection_string(const char *conninfo,
+static PQconninfoOption *parse_connection_string(const char *connstr,
PQExpBuffer errorMessage, bool use_defaults);
static int uri_prefix_length(const char *connstr);
static bool recognized_connection_string(const char *connstr);
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index bb874f7f5..ca0b184af 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2808,7 +2808,7 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* PQgetline - gets a newline-terminated string from the backend.
*
* Chiefly here so that applications can use "COPY <rel> to stdout"
- * and read the output string. Returns a null-terminated string in s.
+ * and read the output string. Returns a null-terminated string in 'string'.
*
* XXX this routine is now deprecated, because it can't handle binary data.
* If called during a COPY BINARY we return EOF.
@@ -2828,11 +2828,11 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* 1 in other cases (i.e., the buffer was filled before \n is reached)
*/
int
-PQgetline(PGconn *conn, char *s, int maxlen)
+PQgetline(PGconn *conn, char *string, int maxlen)
{
- if (!s || maxlen <= 0)
+ if (!string || maxlen <= 0)
return EOF;
- *s = '\0';
+ *string = '\0';
/* maxlen must be at least 3 to hold the \. terminator! */
if (maxlen < 3)
return EOF;
@@ -2840,7 +2840,7 @@ PQgetline(PGconn *conn, char *s, int maxlen)
if (!conn)
return EOF;
- return pqGetline3(conn, s, maxlen);
+ return pqGetline3(conn, string, maxlen);
}
/*
@@ -2892,9 +2892,9 @@ PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
* send failure.
*/
int
-PQputline(PGconn *conn, const char *s)
+PQputline(PGconn *conn, const char *string)
{
- return PQputnbytes(conn, s, strlen(s));
+ return PQputnbytes(conn, string, strlen(string));
}
/*
diff --git a/src/interfaces/libpq/fe-secure-common.h b/src/interfaces/libpq/fe-secure-common.h
index d18db7138..415a93898 100644
--- a/src/interfaces/libpq/fe-secure-common.h
+++ b/src/interfaces/libpq/fe-secure-common.h
@@ -22,8 +22,8 @@ extern int pq_verify_peer_name_matches_certificate_name(PGconn *conn,
const char *namedata, size_t namelen,
char **store_name);
extern int pq_verify_peer_name_matches_certificate_ip(PGconn *conn,
- const unsigned char *addrdata,
- size_t addrlen,
+ const unsigned char *ipdata,
+ size_t iplen,
char **store_name);
extern bool pq_verify_peer_name_matches_certificate(PGconn *conn);
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index 3798bb3f1..02ab604ec 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -68,7 +68,7 @@
static int verify_cb(int ok, X509_STORE_CTX *ctx);
static int openssl_verify_peer_name_matches_certificate_name(PGconn *conn,
- ASN1_STRING *name,
+ ASN1_STRING *name_entry,
char **store_name);
static int openssl_verify_peer_name_matches_certificate_ip(PGconn *conn,
ASN1_OCTET_STRING *addr_entry,
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index 7986445f1..f7a5db4c2 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -483,7 +483,7 @@ extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
/* Deprecated routines for copy in/out */
-extern int PQgetline(PGconn *conn, char *string, int length);
+extern int PQgetline(PGconn *conn, char *string, int maxlen);
extern int PQputline(PGconn *conn, const char *string);
extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
@@ -591,7 +591,7 @@ extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_lengt
extern void PQprint(FILE *fout, /* output stream */
const PGresult *res,
- const PQprintOpt *ps); /* option structure */
+ const PQprintOpt *po); /* option structure */
/*
* really old printing routines
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 7bd2a9fff..a64734294 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -374,7 +374,7 @@ static ParamListInfo setup_param_list(PLpgSQL_execstate *estate,
PLpgSQL_expr *expr);
static ParamExternData *plpgsql_param_fetch(ParamListInfo params,
int paramid, bool speculative,
- ParamExternData *workspace);
+ ParamExternData *prm);
static void plpgsql_param_compile(ParamListInfo params, Param *param,
ExprState *state,
Datum *resv, bool *resnull);
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index e51c03610..14f20e2d2 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = {
* ScanKeywordLookup(), except we want case-sensitive matching.
*/
int
-ScanCKeywordLookup(const char *str)
+ScanCKeywordLookup(const char *text)
{
size_t len;
int h;
@@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str)
* Reject immediately if too long to be any keyword. This saves useless
* hashing work on long strings.
*/
- len = strlen(str);
+ len = strlen(text);
if (len > ScanCKeywords.max_kw_len)
return -1;
@@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str)
* Compute the hash function. Since it's a perfect hash, we need only
* match to the specific keyword it identifies.
*/
- h = ScanCKeywords_hash_func(str, len);
+ h = ScanCKeywords_hash_func(text, len);
/* An out-of-range result implies no match */
if (h < 0 || h >= ScanCKeywords.num_keywords)
@@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str)
kw = GetScanKeyword(h, &ScanCKeywords);
- if (strcmp(kw, str) == 0)
+ if (strcmp(kw, text) == 0)
return ScanCKeywordTokens[h];
return -1;
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index cf8aadd0b..6c0b8a27b 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -4,7 +4,7 @@
#include "preproc_extern.h"
-static void output_escaped_str(char *cmd, bool quoted);
+static void output_escaped_str(char *str, bool quoted);
void
output_line_number(void)
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 6be59b719..732556a0a 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -75,8 +75,8 @@ extern int base_yylex(void);
extern void base_yyerror(const char *);
extern void *mm_alloc(size_t);
extern char *mm_strdup(const char *);
-extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
-extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
+extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
+extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
extern void output_get_descr_header(char *);
extern void output_get_descr(char *, char *);
extern void output_set_descr_header(char *);
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 0ea6ead2d..10d5499ec 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -128,11 +128,11 @@ static void leapadd(zic_t, int, int);
static void adjleap(void);
static void associate(void);
static void dolink(const char *, const char *, bool);
-static char **getfields(char *buf);
+static char **getfields(char *cp);
static zic_t gethms(const char *string, const char *errstring);
static zic_t getsave(char *, bool *);
static void inexpires(char **, int);
-static void infile(const char *filename);
+static void infile(const char *name);
static void inleap(char **fields, int nfields);
static void inlink(char **fields, int nfields);
static void inrule(char **fields, int nfields);
@@ -144,9 +144,9 @@ static bool itssymlink(char const *);
static bool is_alpha(char a);
static char lowerit(char);
static void mkdirs(char const *, bool);
-static void newabbr(const char *abbr);
+static void newabbr(const char *string);
static zic_t oadd(zic_t t1, zic_t t2);
-static void outzone(const struct zone *zp, ptrdiff_t ntzones);
+static void outzone(const struct zone *zpfirst, ptrdiff_t zonecount);
static zic_t rpytime(const struct rule *rp, zic_t wantedy);
static void rulesub(struct rule *rp,
const char *loyearp, const char *hiyearp,
@@ -304,8 +304,8 @@ struct lookup
const int l_value;
};
-static struct lookup const *byword(const char *string,
- const struct lookup *lp);
+static struct lookup const *byword(const char *word,
+ const struct lookup *table);
static struct lookup const zi_line_codes[] = {
{"Rule", LC_RULE},
--
2.34.1
On Fri, Sep 16, 2022 at 11:59 PM Michael Paquier <michael@paquier.xyz> wrote:
If check_usermap() is used in a bugfix, that could be a risk, so this
bit warrants a backpatch in my opinion.
Makes sense. Committed and backpatched a fix for check_usermap() just now
Thanks
--
Peter Geoghegan
On Sun, 18 Sept 2022 at 07:59, Peter Geoghegan <pg@bowt.ie> wrote:
Attached revision adds a new, third patch. This fixes all the warnings
from clang-tidy's "readability-named-parameter" check. The extent of
the code churn seems acceptable to me.
+1 to the idea of aligning the parameter names between function
declarations and definitions.
I had a look at the v2-0001 patch and noted down a few things while reading:
1. In getJsonPathVariable you seem to have mistakenly removed a
parameter from the declaration.
2. You changed the name of the parameter in the definition of
ScanCKeywordLookup(). Is it not better to keep the existing name there
so that that function is consistent with ScanKeywordLookup()?
3. Why did you rename the parameter in the definition of
nocachegetattr()? Wouldn't it be better just to rename in the
declaration. To me, "tup" does not really seem better than "tuple"
here.
4. In the definition of ExecIncrementalSortInitializeWorker() you've
renamed pwcxt to pcxt, but it seems that the other *InitializeWorker()
functions call this pwcxt. Is it better to keep those consistent? I
understand that you've done this for consistency with *InitializeDSM()
and *Estimate() functions, but I'd rather see it remain consistent
with the other *InitializeWorker() functions instead. (I'd not be
against a wider rename so all those functions use the same name.)
5. In md.c I see you've renamed a few "forkNum" variables to
"formnum". Maybe it's worth also doing the same in mdexists().
mdcreate() is also external and got the rename, so I'm not quite sure
why mdexists() would be left.
David
On Sun, Sep 18, 2022 at 4:38 PM David Rowley <dgrowleyml@gmail.com> wrote:
1. In getJsonPathVariable you seem to have mistakenly removed a
parameter from the declaration.
That was left behind following a recent rebase. Will fix.
Every other issue you've raised is some variant of:
"I see that you've made a subjective decision to resolve this
particular inconsistency on the declaration side by following this
particular approach. Why did you do it that way?"
This is perfectly reasonable, and it's possible that I made clear
mistakes in some individual cases. But overall it's not surprising
that somebody else wouldn't handle it in exactly the same way. There
is no question that some of these decisions are a little arbitrary.
2. You changed the name of the parameter in the definition of
ScanCKeywordLookup(). Is it not better to keep the existing name there
so that that function is consistent with ScanKeywordLookup()?
Because it somehow felt slightly preferable than introducing a .h
level inconsistency between ScanECPGKeywordLookup() and
ScanCKeywordLookup(). This is about as hard to justify as justifying
why one prefers a slightly different shade of beige when comparing two
pages from a book of wallpaper samples.
3. Why did you rename the parameter in the definition of
nocachegetattr()? Wouldn't it be better just to rename in the
declaration. To me, "tup" does not really seem better than "tuple"
here.
Again, greater consistency at the .h level won out here. Granted it's
still not perfectly consistent, since I didn't take that to its
logical conclusion and make sure that the .h file was consistent,
because then we'd be talking about why I did that. :-)
4. In the definition of ExecIncrementalSortInitializeWorker() you've
renamed pwcxt to pcxt, but it seems that the other *InitializeWorker()
functions call this pwcxt. Is it better to keep those consistent? I
understand that you've done this for consistency with *InitializeDSM()
and *Estimate() functions, but I'd rather see it remain consistent
with the other *InitializeWorker() functions instead. (I'd not be
against a wider rename so all those functions use the same name.)
Again, I was looking at this at the level of the .h file (in this case
nodeIncrementalSort.h). It never occurred to me to consider other
*InitializeWorker() functions.
Offhand I think that we should change all of the other
*InitializeWorker() functions. I think that things got like this
because somebody randomly made one of them pwcxt at some point, which
was copied later on.
5. In md.c I see you've renamed a few "forkNum" variables to
"formnum". Maybe it's worth also doing the same in mdexists().
mdcreate() is also external and got the rename, so I'm not quite sure
why mdexists() would be left.
Yeah, I think that we might as well be perfectly consistent.
Making automated refactoring tools work better here is of course a
goal of mine -- which is especially useful for making everything
consistent at the whole-interface (or header file) level. I wasn't
sure how much of that to do up front vs in a later commit.
--
Peter Geoghegan
On Sun, Sep 18, 2022 at 5:08 PM Peter Geoghegan <pg@bowt.ie> wrote:
Again, I was looking at this at the level of the .h file (in this case
nodeIncrementalSort.h). It never occurred to me to consider other
*InitializeWorker() functions.Offhand I think that we should change all of the other
*InitializeWorker() functions. I think that things got like this
because somebody randomly made one of them pwcxt at some point, which
was copied later on.
On second thought I definitely got this wrong (it's not subjective
after all). I didn't notice that there are actually 2 different
datatypes involved here, justifying a different naming convention for
each. In other words, the problem really was in the .h file, not in
the .c file, so I should simply fix the declaration of
ExecIncrementalSortInitializeWorker() and call it a day.
There is no reason why ExecIncrementalSortInitializeWorker() ought to
be consistent with other functions that appear in the same header
file, since (if you squint) you'll notice that the data types are also
different.
--
Peter Geoghegan
On Sun, Sep 18, 2022 at 5:08 PM Peter Geoghegan <pg@bowt.ie> wrote:
That was left behind following a recent rebase. Will fix.
Attached revision fixes this issue, plus the
ExecIncrementalSortInitializeWorker() issue.
It also adds a lot more fixes which were missed earlier because I
didn't use "strict" when running clang-tidy from the command line
(just in my editor). This includes a fix for the mdexists() issue that
you highlighted.
I expect that this patch series will bitrot frequently, so there is no
good reason to not post revisions frequently.
The general structure of the patchset is now a little more worked out.
Although it's still not close to being commitable, it should give you
a better idea of the kind of structure that I'm aiming for. I think
that this should be broken into a few different parts based on the
area of the codebase affected (not the type of check used). Even that
aspect needs more work, because there is still one massive patch --
this is now the sixth and final patch.
It seems like a good idea to at least have separate commits for both
the regex code and the timezone code, since these are "quasi-vendored"
areas of the code base.
--
Peter Geoghegan
Attachments:
v3-0001-Harmonize-parameter-names-in-regex-code.patchapplication/octet-stream; name=v3-0001-Harmonize-parameter-names-in-regex-code.patchDownload
From 4127c63ca0c0dd55450f8d7156f92495e62a974d Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 17 Sep 2022 15:37:16 -0700
Subject: [PATCH v3 1/6] Harmonize parameter names in regex code.
---
src/include/regex/regex.h | 14 +-
src/backend/regex/regcomp.c | 342 +++++++++++++----------
src/backend/regex/regexec.c | 65 +++--
src/backend/utils/adt/regexp.c | 2 +-
src/test/modules/test_regex/test_regex.c | 2 +-
5 files changed, 241 insertions(+), 184 deletions(-)
diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h
index 0455ae806..1297abec6 100644
--- a/src/include/regex/regex.h
+++ b/src/include/regex/regex.h
@@ -171,11 +171,15 @@ typedef struct
*/
/* regcomp.c */
-extern int pg_regcomp(regex_t *, const pg_wchar *, size_t, int, Oid);
-extern int pg_regexec(regex_t *, const pg_wchar *, size_t, size_t, rm_detail_t *, size_t, regmatch_t[], int);
-extern int pg_regprefix(regex_t *, pg_wchar **, size_t *);
-extern void pg_regfree(regex_t *);
-extern size_t pg_regerror(int, const regex_t *, char *, size_t);
+extern int pg_regcomp(regex_t *re, const pg_wchar *string, size_t len,
+ int flags, Oid collation);
+extern int pg_regexec(regex_t *re, const pg_wchar *string, size_t len,
+ size_t search_start, rm_detail_t *details,
+ size_t nmatch, regmatch_t pmatch[], int flags);
+extern int pg_regprefix(regex_t *re, pg_wchar **string, size_t *slength);
+extern void pg_regfree(regex_t *re);
+extern size_t pg_regerror(int errcode, const regex_t *preg, char *errbuf,
+ size_t errbuf_size);
/* regexp.c */
extern regex_t *RE_compile_and_cache(text *text_re, int cflags, Oid collation);
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c
index 473738040..e6ff3653a 100644
--- a/src/backend/regex/regcomp.c
+++ b/src/backend/regex/regcomp.c
@@ -38,158 +38,200 @@
* forward declarations, up here so forward datatypes etc. are defined early
*/
/* === regcomp.c === */
-static void moresubs(struct vars *, int);
-static int freev(struct vars *, int);
-static void makesearch(struct vars *, struct nfa *);
-static struct subre *parse(struct vars *, int, int, struct state *, struct state *);
-static struct subre *parsebranch(struct vars *, int, int, struct state *, struct state *, int);
-static struct subre *parseqatom(struct vars *, int, int, struct state *, struct state *, struct subre *);
-static void nonword(struct vars *, int, struct state *, struct state *);
-static void word(struct vars *, int, struct state *, struct state *);
-static void charclass(struct vars *, enum char_classes,
- struct state *, struct state *);
-static void charclasscomplement(struct vars *, enum char_classes,
- struct state *, struct state *);
-static int scannum(struct vars *);
-static void repeat(struct vars *, struct state *, struct state *, int, int);
-static void bracket(struct vars *, struct state *, struct state *);
-static void cbracket(struct vars *, struct state *, struct state *);
-static void brackpart(struct vars *, struct state *, struct state *, bool *);
-static const chr *scanplain(struct vars *);
-static void onechr(struct vars *, chr, struct state *, struct state *);
-static void optimizebracket(struct vars *, struct state *, struct state *);
-static void wordchrs(struct vars *);
-static void processlacon(struct vars *, struct state *, struct state *, int,
- struct state *, struct state *);
-static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
-static void freesubre(struct vars *, struct subre *);
-static void freesubreandsiblings(struct vars *, struct subre *);
-static void freesrnode(struct vars *, struct subre *);
-static void removecaptures(struct vars *, struct subre *);
-static int numst(struct subre *, int);
-static void markst(struct subre *);
-static void cleanst(struct vars *);
-static long nfatree(struct vars *, struct subre *, FILE *);
-static long nfanode(struct vars *, struct subre *, int, FILE *);
-static int newlacon(struct vars *, struct state *, struct state *, int);
-static void freelacons(struct subre *, int);
-static void rfree(regex_t *);
+static void moresubs(struct vars *v, int wanted);
+static int freev(struct vars *v, int err);
+static void makesearch(struct vars *v, struct nfa *nfa);
+static struct subre *parse(struct vars *v, int stopper, int type,
+ struct state *init, struct state *final);
+static struct subre *parsebranch(struct vars *v, int stopper, int type,
+ struct state *left, struct state *right,
+ int partial);
+static struct subre *parseqatom(struct vars *v, int stopper, int type,
+ struct state *lp, struct state *rp,
+ struct subre *top);
+static void nonword(struct vars *v, int dir, struct state *lp,
+ struct state *rp);
+static void word(struct vars *v, int dir, struct state *lp, struct state *rp);
+static void charclass(struct vars *v, enum char_classes cls, struct state *lp,
+ struct state *rp);
+static void charclasscomplement(struct vars *v, enum char_classes cls,
+ struct state *lp, struct state *rp);
+static int scannum(struct vars *v);
+static void repeat(struct vars *v, struct state *lp, struct state *rp,
+ int m, int n);
+static void bracket(struct vars *v, struct state *lp, struct state *rp);
+static void cbracket(struct vars *v, struct state *lp, struct state *rp);
+static void brackpart(struct vars *v, struct state *lp, struct state *rp,
+ bool *have_cclassc);
+static const chr *scanplain(struct vars *v);
+static void onechr(struct vars *v, chr c, struct state *lp, struct state *rp);
+static void optimizebracket(struct vars *v, struct state *lp, struct state *rp);
+static void wordchrs(struct vars *v);
+static void processlacon(struct vars *v, struct state *begin,
+ struct state *end, int latype,
+ struct state *lp, struct state *rp);
+static struct subre *subre(struct vars *v, int op, int flags,
+ struct state *begin, struct state *end);
+static void freesubre(struct vars *v, struct subre *sr);
+static void freesubreandsiblings(struct vars *v, struct subre *sr);
+static void freesrnode(struct vars *v, struct subre *sr);
+static void removecaptures(struct vars *v, struct subre *t);
+static int numst(struct subre *t, int start);
+static void markst(struct subre *t);
+static void cleanst(struct vars *v);
+static long nfatree(struct vars *v, struct subre *t, FILE *f);
+static long nfanode(struct vars *v, struct subre *t,
+ int converttosearch, FILE *f);
+static int newlacon(struct vars *v, struct state *begin, struct state *end,
+ int latype);
+static void freelacons(struct subre *subs, int n);
+static void rfree(regex_t *re);
static int rcancelrequested(void);
static int rstacktoodeep(void);
#ifdef REG_DEBUG
-static void dump(regex_t *, FILE *);
-static void dumpst(struct subre *, FILE *, int);
-static void stdump(struct subre *, FILE *, int);
-static const char *stid(struct subre *, char *, size_t);
+static void dump(regex_t *re, FILE *f);
+static void dumpst(struct subre *t, FILE *f, int nfapresent);
+static void stdump(struct subre *t, FILE *f, int nfapresent);
+static const char *stid(struct subre *t, char *buf, size_t bufsize);
#endif
/* === regc_lex.c === */
-static void lexstart(struct vars *);
-static void prefixes(struct vars *);
-static int next(struct vars *);
-static int lexescape(struct vars *);
-static chr lexdigits(struct vars *, int, int, int);
-static int brenext(struct vars *, chr);
-static void skip(struct vars *);
+static void lexstart(struct vars *v);
+static void prefixes(struct vars *v);
+static int next(struct vars *v);
+static int lexescape(struct vars *v);
+static chr lexdigits(struct vars *v, int base, int minlen, int maxlen);
+static int brenext(struct vars *v, chr c);
+static void skip(struct vars *v);
static chr newline(void);
-static chr chrnamed(struct vars *, const chr *, const chr *, chr);
+static chr chrnamed(struct vars *v, const chr *startp, const chr *endp,
+ chr lastresort);
/* === regc_color.c === */
-static void initcm(struct vars *, struct colormap *);
-static void freecm(struct colormap *);
-static color maxcolor(struct colormap *);
-static color newcolor(struct colormap *);
-static void freecolor(struct colormap *, color);
-static color pseudocolor(struct colormap *);
-static color subcolor(struct colormap *, chr);
-static color subcolorhi(struct colormap *, color *);
-static color newsub(struct colormap *, color);
-static int newhicolorrow(struct colormap *, int);
-static void newhicolorcols(struct colormap *);
-static void subcolorcvec(struct vars *, struct cvec *, struct state *, struct state *);
-static void subcoloronechr(struct vars *, chr, struct state *, struct state *, color *);
-static void subcoloronerange(struct vars *, chr, chr, struct state *, struct state *, color *);
-static void subcoloronerow(struct vars *, int, struct state *, struct state *, color *);
-static void okcolors(struct nfa *, struct colormap *);
-static void colorchain(struct colormap *, struct arc *);
-static void uncolorchain(struct colormap *, struct arc *);
-static void rainbow(struct nfa *, struct colormap *, int, color, struct state *, struct state *);
-static void colorcomplement(struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *);
+static void initcm(struct vars *v, struct colormap *cm);
+static void freecm(struct colormap *cm);
+static color maxcolor(struct colormap *cm);
+static color newcolor(struct colormap *cm);
+static void freecolor(struct colormap *cm, color co);
+static color pseudocolor(struct colormap *cm);
+static color subcolor(struct colormap *cm, chr c);
+static color subcolorhi(struct colormap *cm, color *pco);
+static color newsub(struct colormap *cm, color co);
+static int newhicolorrow(struct colormap *cm, int oldrow);
+static void newhicolorcols(struct colormap *cm);
+static void subcolorcvec(struct vars *v, struct cvec *cv, struct state *lp,
+ struct state *rp);
+static void subcoloronechr(struct vars *v, chr ch, struct state *lp,
+ struct state *rp, color *lastsubcolor);
+static void subcoloronerange(struct vars *v, chr from, chr to,
+ struct state *lp, struct state *rp,
+ color *lastsubcolor);
+static void subcoloronerow(struct vars *v, int rownum, struct state *lp,
+ struct state *rp, color *lastsubcolor);
+static void okcolors(struct nfa *nfa, struct colormap *cm);
+static void colorchain(struct colormap *cm, struct arc *a);
+static void uncolorchain(struct colormap *cm, struct arc *a);
+static void rainbow(struct nfa *nfa, struct colormap *cm, int type, color but,
+ struct state *from, struct state *to);
+static void colorcomplement(struct nfa *nfa, struct colormap *cm, int type,
+ struct state *of, struct state *from,
+ struct state *to);
#ifdef REG_DEBUG
-static void dumpcolors(struct colormap *, FILE *);
-static void dumpchr(chr, FILE *);
+static void dumpcolors(struct colormap *cm, FILE *f);
+static void dumpchr(chr c, FILE *f);
#endif
/* === regc_nfa.c === */
-static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *);
-static void freenfa(struct nfa *);
-static struct state *newstate(struct nfa *);
-static struct state *newfstate(struct nfa *, int flag);
-static void dropstate(struct nfa *, struct state *);
-static void freestate(struct nfa *, struct state *);
-static void newarc(struct nfa *, int, color, struct state *, struct state *);
-static void createarc(struct nfa *, int, color, struct state *, struct state *);
-static struct arc *allocarc(struct nfa *);
-static void freearc(struct nfa *, struct arc *);
-static void changearcsource(struct arc *, struct state *);
-static void changearctarget(struct arc *, struct state *);
-static int hasnonemptyout(struct state *);
-static struct arc *findarc(struct state *, int, color);
-static void cparc(struct nfa *, struct arc *, struct state *, struct state *);
-static void sortins(struct nfa *, struct state *);
-static int sortins_cmp(const void *, const void *);
-static void sortouts(struct nfa *, struct state *);
-static int sortouts_cmp(const void *, const void *);
-static void moveins(struct nfa *, struct state *, struct state *);
-static void copyins(struct nfa *, struct state *, struct state *);
-static void mergeins(struct nfa *, struct state *, struct arc **, int);
-static void moveouts(struct nfa *, struct state *, struct state *);
-static void copyouts(struct nfa *, struct state *, struct state *);
-static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int);
-static void delsub(struct nfa *, struct state *, struct state *);
-static void deltraverse(struct nfa *, struct state *, struct state *);
-static void dupnfa(struct nfa *, struct state *, struct state *, struct state *, struct state *);
-static void duptraverse(struct nfa *, struct state *, struct state *);
-static void removeconstraints(struct nfa *, struct state *, struct state *);
-static void removetraverse(struct nfa *, struct state *);
-static void cleartraverse(struct nfa *, struct state *);
-static struct state *single_color_transition(struct state *, struct state *);
-static void specialcolors(struct nfa *);
-static long optimize(struct nfa *, FILE *);
-static void pullback(struct nfa *, FILE *);
-static int pull(struct nfa *, struct arc *, struct state **);
-static void pushfwd(struct nfa *, FILE *);
-static int push(struct nfa *, struct arc *, struct state **);
+static struct nfa *newnfa(struct vars *v, struct colormap *cm,
+ struct nfa *parent);
+static void freenfa(struct nfa *nfa);
+static struct state *newstate(struct nfa *nfa);
+static struct state *newfstate(struct nfa *nfa, int flag);
+static void dropstate(struct nfa *nfa, struct state *s);
+static void freestate(struct nfa *nfa, struct state *s);
+static void newarc(struct nfa *nfa, int t, color co,
+ struct state *from, struct state *to);
+static void createarc(struct nfa *nfa, int t, color co,
+ struct state *from, struct state *to);
+static struct arc *allocarc(struct nfa *nfa);
+static void freearc(struct nfa *nfa, struct arc *victim);
+static void changearcsource(struct arc *a, struct state *newfrom);
+static void changearctarget(struct arc *a, struct state *newto);
+static int hasnonemptyout(struct state *s);
+static struct arc *findarc(struct state *s, int type, color co);
+static void cparc(struct nfa *nfa, struct arc *oa,
+ struct state *from, struct state *to);
+static void sortins(struct nfa *nfa, struct state *s);
+static int sortins_cmp(const void *a, const void *b);
+static void sortouts(struct nfa *nfa, struct state *s);
+static int sortouts_cmp(const void *a, const void *b);
+static void moveins(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void copyins(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void mergeins(struct nfa *nfa, struct state *s,
+ struct arc **arcarray, int arccount);
+static void moveouts(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void copyouts(struct nfa *nfa, struct state *oldState,
+ struct state *newState);
+static void cloneouts(struct nfa *nfa, struct state *old, struct state *from,
+ struct state *to, int type);
+static void delsub(struct nfa *nfa, struct state *lp, struct state *rp);
+static void deltraverse(struct nfa *nfa, struct state *leftend,
+ struct state *s);
+static void dupnfa(struct nfa *nfa, struct state *start, struct state *stop,
+ struct state *from, struct state *to);
+static void duptraverse(struct nfa *nfa, struct state *s, struct state *stmp);
+static void removeconstraints(struct nfa *nfa, struct state *start, struct state *stop);
+static void removetraverse(struct nfa *nfa, struct state *s);
+static void cleartraverse(struct nfa *nfa, struct state *s);
+static struct state *single_color_transition(struct state *s1,
+ struct state *s2);
+static void specialcolors(struct nfa *nfa);
+static long optimize(struct nfa *nfa, FILE *f);
+static void pullback(struct nfa *nfa, FILE *f);
+static int pull(struct nfa *nfa, struct arc *con,
+ struct state **intermediates);
+static void pushfwd(struct nfa *nfa, FILE *f);
+static int push(struct nfa *nfa, struct arc *con,
+ struct state **intermediates);
#define INCOMPATIBLE 1 /* destroys arc */
#define SATISFIED 2 /* constraint satisfied */
#define COMPATIBLE 3 /* compatible but not satisfied yet */
#define REPLACEARC 4 /* replace arc's color with constraint color */
static int combine(struct nfa *nfa, struct arc *con, struct arc *a);
-static void fixempties(struct nfa *, FILE *);
-static struct state *emptyreachable(struct nfa *, struct state *,
- struct state *, struct arc **);
-static int isconstraintarc(struct arc *);
-static int hasconstraintout(struct state *);
-static void fixconstraintloops(struct nfa *, FILE *);
-static int findconstraintloop(struct nfa *, struct state *);
-static void breakconstraintloop(struct nfa *, struct state *);
-static void clonesuccessorstates(struct nfa *, struct state *, struct state *,
- struct state *, struct arc *,
- char *, char *, int);
-static void cleanup(struct nfa *);
-static void markreachable(struct nfa *, struct state *, struct state *, struct state *);
-static void markcanreach(struct nfa *, struct state *, struct state *, struct state *);
-static long analyze(struct nfa *);
-static void checkmatchall(struct nfa *);
-static bool checkmatchall_recurse(struct nfa *, struct state *, bool **);
-static bool check_out_colors_match(struct state *, color, color);
-static bool check_in_colors_match(struct state *, color, color);
-static void compact(struct nfa *, struct cnfa *);
-static void carcsort(struct carc *, size_t);
-static int carc_cmp(const void *, const void *);
-static void freecnfa(struct cnfa *);
-static void dumpnfa(struct nfa *, FILE *);
+static void fixempties(struct nfa *nfa, FILE *f);
+static struct state *emptyreachable(struct nfa *nfa, struct state *s,
+ struct state *lastfound,
+ struct arc **inarcsorig);
+static int isconstraintarc(struct arc *a);
+static int hasconstraintout(struct state *s);
+static void fixconstraintloops(struct nfa *nfa, FILE *f);
+static int findconstraintloop(struct nfa *nfa, struct state *s);
+static void breakconstraintloop(struct nfa *nfa, struct state *sinitial);
+static void clonesuccessorstates(struct nfa *nfa, struct state *ssource,
+ struct state *sclone,
+ struct state *spredecessor,
+ struct arc *refarc, char *curdonemap,
+ char *outerdonemap, int nstates);
+static void cleanup(struct nfa *nfa);
+static void markreachable(struct nfa *nfa, struct state *s,
+ struct state *okay, struct state *mark);
+static void markcanreach(struct nfa *nfa, struct state *s, struct state *okay,
+ struct state *mark);
+static long analyze(struct nfa *nfa);
+static void checkmatchall(struct nfa *nfa);
+static bool checkmatchall_recurse(struct nfa *nfa, struct state *s,
+ bool **haspaths);
+static bool check_out_colors_match(struct state *s, color co1, color co2);
+static bool check_in_colors_match(struct state *s, color co1, color co2);
+static void compact(struct nfa *nfa, struct cnfa *cnfa);
+static void carcsort(struct carc *first, size_t n);
+static int carc_cmp(const void *a, const void *b);
+static void freecnfa(struct cnfa *cnfa);
+static void dumpnfa(struct nfa *nfa, FILE *f);
#ifdef REG_DEBUG
static void dumpstate(struct state *, FILE *);
@@ -199,12 +241,12 @@ static void dumpcnfa(struct cnfa *, FILE *);
static void dumpcstate(int, struct cnfa *, FILE *);
#endif
/* === regc_cvec.c === */
-static struct cvec *newcvec(int, int);
-static struct cvec *clearcvec(struct cvec *);
-static void addchr(struct cvec *, chr);
-static void addrange(struct cvec *, chr, chr);
-static struct cvec *getcvec(struct vars *, int, int);
-static void freecvec(struct cvec *);
+static struct cvec *newcvec(int nchrs, int nranges);
+static struct cvec *clearcvec(struct cvec *cv);
+static void addchr(struct cvec *cv, chr c);
+static void addrange(struct cvec *cv, chr from, chr to);
+static struct cvec *getcvec(struct vars *v, int nchrs, int nranges);
+static void freecvec(struct cvec *cv);
/* === regc_pg_locale.c === */
static int pg_wc_isdigit(pg_wchar c);
@@ -221,16 +263,18 @@ static pg_wchar pg_wc_toupper(pg_wchar c);
static pg_wchar pg_wc_tolower(pg_wchar c);
/* === regc_locale.c === */
-static chr element(struct vars *, const chr *, const chr *);
-static struct cvec *range(struct vars *, chr, chr, int);
-static int before(chr, chr);
-static struct cvec *eclass(struct vars *, chr, int);
-static enum char_classes lookupcclass(struct vars *, const chr *, const chr *);
-static struct cvec *cclasscvec(struct vars *, enum char_classes, int);
-static int cclass_column_index(struct colormap *, chr);
-static struct cvec *allcases(struct vars *, chr);
-static int cmp(const chr *, const chr *, size_t);
-static int casecmp(const chr *, const chr *, size_t);
+static chr element(struct vars *v, const chr *startp, const chr *endp);
+static struct cvec *range(struct vars *v, chr a, chr b, int cases);
+static int before(chr x, chr y);
+static struct cvec *eclass(struct vars *v, chr c, int cases);
+static enum char_classes lookupcclass(struct vars *v, const chr *startp,
+ const chr *endp);
+static struct cvec *cclasscvec(struct vars *v, enum char_classes cclasscode,
+ int cases);
+static int cclass_column_index(struct colormap *cm, chr c);
+static struct cvec *allcases(struct vars *v, chr c);
+static int cmp(const chr *x, const chr *y, size_t len);
+static int casecmp(const chr *x, const chr *y, size_t len);
/* internal variables, bundled for easy passing around */
diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c
index 927154436..29c364f3d 100644
--- a/src/backend/regex/regexec.c
+++ b/src/backend/regex/regexec.c
@@ -137,36 +137,45 @@ struct vars
* forward declarations
*/
/* === regexec.c === */
-static struct dfa *getsubdfa(struct vars *, struct subre *);
-static struct dfa *getladfa(struct vars *, int);
-static int find(struct vars *, struct cnfa *, struct colormap *);
-static int cfind(struct vars *, struct cnfa *, struct colormap *);
-static int cfindloop(struct vars *, struct cnfa *, struct colormap *, struct dfa *, struct dfa *, chr **);
-static void zapallsubs(regmatch_t *, size_t);
-static void zaptreesubs(struct vars *, struct subre *);
-static void subset(struct vars *, struct subre *, chr *, chr *);
-static int cdissect(struct vars *, struct subre *, chr *, chr *);
-static int ccondissect(struct vars *, struct subre *, chr *, chr *);
-static int crevcondissect(struct vars *, struct subre *, chr *, chr *);
-static int cbrdissect(struct vars *, struct subre *, chr *, chr *);
-static int caltdissect(struct vars *, struct subre *, chr *, chr *);
-static int citerdissect(struct vars *, struct subre *, chr *, chr *);
-static int creviterdissect(struct vars *, struct subre *, chr *, chr *);
+static struct dfa *getsubdfa(struct vars *v, struct subre *t);
+static struct dfa *getladfa(struct vars *v, int n);
+static int find(struct vars *v, struct cnfa *cnfa, struct colormap *cm);
+static int cfind(struct vars *v, struct cnfa *cnfa, struct colormap *cm);
+static int cfindloop(struct vars *v, struct cnfa *cnfa, struct colormap *cm,
+ struct dfa *d, struct dfa *s, chr **coldp);
+static void zapallsubs(regmatch_t *p, size_t n);
+static void zaptreesubs(struct vars *v, struct subre *t);
+static void subset(struct vars *v, struct subre *sub, chr *begin, chr *end);
+static int cdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int ccondissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int crevcondissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int cbrdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int caltdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int citerdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
+static int creviterdissect(struct vars *v, struct subre *t, chr *begin, chr *end);
/* === rege_dfa.c === */
-static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *);
-static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, chr **, int *);
-static int matchuntil(struct vars *, struct dfa *, chr *, struct sset **, chr **);
-static chr *dfa_backref(struct vars *, struct dfa *, chr *, chr *, chr *, bool);
-static chr *lastcold(struct vars *, struct dfa *);
-static struct dfa *newdfa(struct vars *, struct cnfa *, struct colormap *, struct smalldfa *);
-static void freedfa(struct dfa *);
-static unsigned hash(unsigned *, int);
-static struct sset *initialize(struct vars *, struct dfa *, chr *);
-static struct sset *miss(struct vars *, struct dfa *, struct sset *, color, chr *, chr *);
-static int lacon(struct vars *, struct cnfa *, chr *, color);
-static struct sset *getvacant(struct vars *, struct dfa *, chr *, chr *);
-static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *);
+static chr *longest(struct vars *v, struct dfa *d,
+ chr *start, chr *stop, int *hitstopp);
+static chr *shortest(struct vars *v, struct dfa *d, chr *start, chr *min,
+ chr *max, chr **coldp, int *hitstopp);
+static int matchuntil(struct vars *v, struct dfa *d, chr *probe,
+ struct sset **lastcss, chr **lastcp);
+static chr *dfa_backref(struct vars *v, struct dfa *d, chr *start,
+ chr *min, chr *max, bool shortest);
+static chr *lastcold(struct vars *v, struct dfa *d);
+static struct dfa *newdfa(struct vars *v, struct cnfa *cnfa,
+ struct colormap *cm, struct smalldfa *sml);
+static void freedfa(struct dfa *d);
+static unsigned hash(unsigned *uv, int n);
+static struct sset *initialize(struct vars *v, struct dfa *d, chr *start);
+static struct sset *miss(struct vars *v, struct dfa *d, struct sset *css,
+ color co, chr *cp, chr *start);
+static int lacon(struct vars *v, struct cnfa *pcnfa, chr *cp, color co);
+static struct sset *getvacant(struct vars *v, struct dfa *d, chr *cp,
+ chr *start);
+static struct sset *pickss(struct vars *v, struct dfa *d, chr *cp,
+ chr *start);
/*
diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c
index dcf6681ef..b6e0a4136 100644
--- a/src/backend/utils/adt/regexp.c
+++ b/src/backend/utils/adt/regexp.c
@@ -112,7 +112,7 @@ static cached_re_str re_array[MAX_CACHED_RES]; /* cached re's */
/* Local functions */
static regexp_matches_ctx *setup_regexp_matches(text *orig_str, text *pattern,
- pg_re_flags *flags,
+ pg_re_flags *re_flags,
int start_search,
Oid collation,
bool use_subpatterns,
diff --git a/src/test/modules/test_regex/test_regex.c b/src/test/modules/test_regex/test_regex.c
index e23a0bd0d..a6d99a029 100644
--- a/src/test/modules/test_regex/test_regex.c
+++ b/src/test/modules/test_regex/test_regex.c
@@ -60,7 +60,7 @@ static void test_re_compile(text *text_re, int cflags, Oid collation,
static void parse_test_flags(test_re_flags *flags, text *opts);
static test_regex_ctx *setup_test_matches(text *orig_str,
regex_t *cpattern,
- test_re_flags *flags,
+ test_re_flags *re_flags,
Oid collation,
bool use_subpatterns);
static ArrayType *build_test_info_result(regex_t *cpattern,
--
2.34.1
v3-0004-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchapplication/octet-stream; name=v3-0004-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchDownload
From 062587ef037bc6cc157a16abc19b5c2e8a9a6ede Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 22:19:51 -0700
Subject: [PATCH v3 4/6] Harmonize parameter names in pg_dump/pg_dumpall.
---
src/bin/pg_dump/common.c | 2 +-
src/bin/pg_dump/parallel.c | 4 +-
src/bin/pg_dump/pg_backup.h | 30 +--
src/bin/pg_dump/pg_backup_archiver.c | 53 +++---
src/bin/pg_dump/pg_backup_archiver.h | 6 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_db.c | 14 +-
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_tar.c | 4 +-
src/bin/pg_dump/pg_dump.c | 254 +++++++++++++-------------
src/bin/pg_dump/pg_dump.h | 6 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
12 files changed, 192 insertions(+), 191 deletions(-)
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 395f817fa..44fa52cc5 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -79,7 +79,7 @@ typedef struct _catalogIdMapEntry
static catalogid_hash *catalogIdHash = NULL;
-static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables,
+static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables);
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c8a70d9bc..1c194ceb4 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -325,9 +325,9 @@ getThreadLocalPQExpBuffer(void)
* as soon as they've created the ArchiveHandle.
*/
void
-on_exit_close_archive(Archive *AHX)
+on_exit_close_archive(Archive *A)
{
- shutdown_info.AHX = AHX;
+ shutdown_info.AHX = A;
on_exit_nicely(archive_close_connection, &shutdown_info);
}
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fcc5f6bd0..b31ce1c44 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -270,33 +270,33 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods.
*/
-typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+typedef int (*DataDumperPtr) (Archive *A, const void *userArg);
-typedef void (*SetupWorkerPtrType) (Archive *AH);
+typedef void (*SetupWorkerPtrType) (Archive *A);
/*
* Main archiver interface.
*/
-extern void ConnectDatabase(Archive *AHX,
+extern void ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect);
-extern void DisconnectDatabase(Archive *AHX);
-extern PGconn *GetConnection(Archive *AHX);
+extern void DisconnectDatabase(Archive *A);
+extern PGconn *GetConnection(Archive *A);
/* Called to write *data* to the archive */
-extern void WriteData(Archive *AH, const void *data, size_t dLen);
+extern void WriteData(Archive *A, const void *data, size_t dLen);
-extern int StartBlob(Archive *AH, Oid oid);
-extern int EndBlob(Archive *AH, Oid oid);
+extern int StartBlob(Archive *A, Oid oid);
+extern int EndBlob(Archive *A, Oid oid);
-extern void CloseArchive(Archive *AH);
+extern void CloseArchive(Archive *A);
-extern void SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt);
+extern void SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt);
-extern void ProcessArchiveRestoreOptions(Archive *AH);
+extern void ProcessArchiveRestoreOptions(Archive *A);
-extern void RestoreArchive(Archive *AH);
+extern void RestoreArchive(Archive *A);
/* Open an existing archive */
extern Archive *OpenArchive(const char *FileSpec, const ArchiveFormat fmt);
@@ -307,7 +307,7 @@ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt,
SetupWorkerPtrType setupDumpWorker);
/* The --list option */
-extern void PrintTOCSummary(Archive *AH);
+extern void PrintTOCSummary(Archive *A);
extern RestoreOptions *NewRestoreOptions(void);
@@ -316,13 +316,13 @@ extern void InitDumpOptions(DumpOptions *opts);
extern DumpOptions *dumpOptionsFromRestoreOptions(RestoreOptions *ropt);
/* Rearrange and filter TOC entries */
-extern void SortTocFromFile(Archive *AHX);
+extern void SortTocFromFile(Archive *A);
/* Convenience functions used only when writing DATA */
extern void archputs(const char *s, Archive *AH);
extern int archprintf(Archive *AH, const char *fmt,...) pg_attribute_printf(2, 3);
-#define appendStringLiteralAH(buf,str,AH) \
+#define appendStringLiteralArchive(buf,str,AH) \
appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings)
#endif /* PG_BACKUP_H */
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 233198afc..0f3f90bf2 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -261,10 +261,10 @@ OpenArchive(const char *FileSpec, const ArchiveFormat fmt)
/* Public */
void
-CloseArchive(Archive *AHX)
+CloseArchive(Archive *A)
{
int res = 0;
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ClosePtr(AH);
@@ -281,22 +281,22 @@ CloseArchive(Archive *AHX)
/* Public */
void
-SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt)
+SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt)
{
/* Caller can omit dump options, in which case we synthesize them */
if (dopt == NULL && ropt != NULL)
dopt = dumpOptionsFromRestoreOptions(ropt);
/* Save options for later access */
- AH->dopt = dopt;
- AH->ropt = ropt;
+ A->dopt = dopt;
+ A->ropt = ropt;
}
/* Public */
void
-ProcessArchiveRestoreOptions(Archive *AHX)
+ProcessArchiveRestoreOptions(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -349,9 +349,9 @@ ProcessArchiveRestoreOptions(Archive *AHX)
/* Public */
void
-RestoreArchive(Archive *AHX)
+RestoreArchive(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
bool parallel_mode;
TocEntry *te;
@@ -415,10 +415,10 @@ RestoreArchive(Archive *AHX)
* restore; allow the attempt regardless of the version of the restore
* target.
*/
- AHX->minRemoteVersion = 0;
- AHX->maxRemoteVersion = 9999999;
+ A->minRemoteVersion = 0;
+ A->maxRemoteVersion = 9999999;
- ConnectDatabase(AHX, &ropt->cparams, false);
+ ConnectDatabase(A, &ropt->cparams, false);
/*
* If we're talking to the DB directly, don't send comments since they
@@ -479,7 +479,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- StartTransaction(AHX);
+ StartTransaction(A);
else
ahprintf(AH, "BEGIN;\n\n");
}
@@ -724,7 +724,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- CommitTransaction(AHX);
+ CommitTransaction(A);
else
ahprintf(AH, "COMMIT;\n\n");
}
@@ -1031,9 +1031,9 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te)
/* Public */
void
-WriteData(Archive *AHX, const void *data, size_t dLen)
+WriteData(Archive *A, const void *data, size_t dLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->currToc)
pg_fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
@@ -1052,10 +1052,9 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
/* Public */
TocEntry *
-ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
- ArchiveOpts *opts)
+ArchiveEntry(Archive *A, CatalogId catalogId, DumpId dumpId, ArchiveOpts *opts)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
TocEntry *newToc;
newToc = (TocEntry *) pg_malloc0(sizeof(TocEntry));
@@ -1110,9 +1109,9 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
/* Public */
void
-PrintTOCSummary(Archive *AHX)
+PrintTOCSummary(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -1214,9 +1213,9 @@ PrintTOCSummary(Archive *AHX)
/* Called by a dumper to signal start of a BLOB */
int
-StartBlob(Archive *AHX, Oid oid)
+StartBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->StartBlobPtr)
pg_fatal("large-object output not supported in chosen format");
@@ -1228,9 +1227,9 @@ StartBlob(Archive *AHX, Oid oid)
/* Called by a dumper to signal end of a BLOB */
int
-EndBlob(Archive *AHX, Oid oid)
+EndBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->EndBlobPtr)
AH->EndBlobPtr(AH, AH->currToc, oid);
@@ -1358,9 +1357,9 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
***********/
void
-SortTocFromFile(Archive *AHX)
+SortTocFromFile(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
FILE *fh;
StringInfoData linebuf;
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 084cd87e8..12b84e2e6 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -404,7 +404,7 @@ struct _tocEntry
};
extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
-extern void on_exit_close_archive(Archive *AHX);
+extern void on_exit_close_archive(Archive *A);
extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
@@ -428,7 +428,7 @@ typedef struct _archiveOpts
} ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */
-extern TocEntry *ArchiveEntry(Archive *AHX, CatalogId catalogId,
+extern TocEntry *ArchiveEntry(Archive *A, CatalogId catalogId,
DumpId dumpId, ArchiveOpts *opts);
extern void WriteHead(ArchiveHandle *AH);
@@ -457,7 +457,7 @@ extern bool checkSeek(FILE *fp);
extern size_t WriteInt(ArchiveHandle *AH, int i);
extern int ReadInt(ArchiveHandle *AH);
extern char *ReadStr(ArchiveHandle *AH);
-extern size_t WriteStr(ArchiveHandle *AH, const char *s);
+extern size_t WriteStr(ArchiveHandle *AH, const char *c);
int ReadOffset(ArchiveHandle *, pgoff_t *);
size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 1023fea01..a0a55a1ed 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -40,7 +40,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 28baa68fd..a2cb5cbe8 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -98,7 +98,7 @@ ReconnectToServer(ArchiveHandle *AH, const char *dbname)
/*
* Make, or remake, a database connection with the given parameters.
*
- * The resulting connection handle is stored in AHX->connection.
+ * The resulting connection handle is stored in AH->connection.
*
* An interactive password prompt is automatically issued if required.
* We store the results of that in AHX->savedPassword.
@@ -107,11 +107,11 @@ ReconnectToServer(ArchiveHandle *AH, const char *dbname)
* username never does change, so one savedPassword is sufficient.
*/
void
-ConnectDatabase(Archive *AHX,
+ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
trivalue prompt_password;
char *password;
bool new_pass;
@@ -222,9 +222,9 @@ ConnectDatabase(Archive *AHX,
* have one running.
*/
void
-DisconnectDatabase(Archive *AHX)
+DisconnectDatabase(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
char errbuf[1];
if (!AH->connection)
@@ -251,9 +251,9 @@ DisconnectDatabase(Archive *AHX)
}
PGconn *
-GetConnection(Archive *AHX)
+GetConnection(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
return AH->connection;
}
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 3f46f7988..798182b6f 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -67,7 +67,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 7960b81c0..402b93c61 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -46,7 +46,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
@@ -97,7 +97,7 @@ typedef struct
static void _LoadBlobs(ArchiveHandle *AH);
static TAR_MEMBER *tarOpen(ArchiveHandle *AH, const char *filename, char mode);
-static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
+static void tarClose(ArchiveHandle *AH, TAR_MEMBER *th);
#ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 67b6d9079..b5fc060ce 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -159,7 +159,7 @@ static int nseclabels = 0;
(obj)->dobj.name)
static void help(const char *progname);
-static void setup_connection(Archive *AH,
+static void setup_connection(Archive *A,
const char *dumpencoding, const char *dumpsnapshot,
char *use_role);
static ArchiveFormat parseArchiveFormat(const char *format, ArchiveMode *mode);
@@ -221,7 +221,7 @@ static void dumpFunc(Archive *fout, const FuncInfo *finfo);
static void dumpCast(Archive *fout, const CastInfo *cast);
static void dumpTransform(Archive *fout, const TransformInfo *transform);
static void dumpOpr(Archive *fout, const OprInfo *oprinfo);
-static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *oprinfo);
+static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *aminfo);
static void dumpOpclass(Archive *fout, const OpclassInfo *opcinfo);
static void dumpOpfamily(Archive *fout, const OpfamilyInfo *opfinfo);
static void dumpCollation(Archive *fout, const CollInfo *collinfo);
@@ -232,7 +232,7 @@ static void dumpTrigger(Archive *fout, const TriggerInfo *tginfo);
static void dumpEventTrigger(Archive *fout, const EventTriggerInfo *evtinfo);
static void dumpTable(Archive *fout, const TableInfo *tbinfo);
static void dumpTableSchema(Archive *fout, const TableInfo *tbinfo);
-static void dumpTableAttach(Archive *fout, const TableAttachInfo *tbinfo);
+static void dumpTableAttach(Archive *fout, const TableAttachInfo *attachinfo);
static void dumpAttrDef(Archive *fout, const AttrDefInfo *adinfo);
static void dumpSequence(Archive *fout, const TableInfo *tbinfo);
static void dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo);
@@ -287,12 +287,12 @@ static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
static void dumpPublicationTable(Archive *fout, const PublicationRelInfo *pubrinfo);
static void dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo);
-static void dumpDatabase(Archive *AH);
+static void dumpDatabase(Archive *fout);
static void dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
const char *dbname, Oid dboid);
-static void dumpEncoding(Archive *AH);
-static void dumpStdStrings(Archive *AH);
-static void dumpSearchPath(Archive *AH);
+static void dumpEncoding(Archive *A);
+static void dumpStdStrings(Archive *A);
+static void dumpSearchPath(Archive *A);
static void binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
PQExpBuffer upgrade_buffer,
Oid pg_type_oid,
@@ -315,7 +315,7 @@ static bool nonemptyReloptions(const char *reloptions);
static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
const char *prefix, Archive *fout);
static char *get_synchronized_snapshot(Archive *fout);
-static void setupDumpWorker(Archive *AHX);
+static void setupDumpWorker(Archive *A);
static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
@@ -1069,14 +1069,14 @@ help(const char *progname)
}
static void
-setup_connection(Archive *AH, const char *dumpencoding,
+setup_connection(Archive *A, const char *dumpencoding,
const char *dumpsnapshot, char *use_role)
{
- DumpOptions *dopt = AH->dopt;
- PGconn *conn = GetConnection(AH);
+ DumpOptions *dopt = A->dopt;
+ PGconn *conn = GetConnection(A);
const char *std_strings;
- PQclear(ExecuteSqlQueryForSingleRow(AH, ALWAYS_SECURE_SEARCH_PATH_SQL));
+ PQclear(ExecuteSqlQueryForSingleRow(A, ALWAYS_SECURE_SEARCH_PATH_SQL));
/*
* Set the client encoding if requested.
@@ -1092,18 +1092,18 @@ setup_connection(Archive *AH, const char *dumpencoding,
* Get the active encoding and the standard_conforming_strings setting, so
* we know how to escape strings.
*/
- AH->encoding = PQclientEncoding(conn);
+ A->encoding = PQclientEncoding(conn);
std_strings = PQparameterStatus(conn, "standard_conforming_strings");
- AH->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
+ A->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
/*
* Set the role if requested. In a parallel dump worker, we'll be passed
* use_role == NULL, but AH->use_role is already set (if user specified it
* originally) and we should use that.
*/
- if (!use_role && AH->use_role)
- use_role = AH->use_role;
+ if (!use_role && A->use_role)
+ use_role = A->use_role;
/* Set the role if requested */
if (use_role)
@@ -1111,19 +1111,19 @@ setup_connection(Archive *AH, const char *dumpencoding,
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query, "SET ROLE %s", fmtId(use_role));
- ExecuteSqlStatement(AH, query->data);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
/* save it for possible later use by parallel workers */
- if (!AH->use_role)
- AH->use_role = pg_strdup(use_role);
+ if (!A->use_role)
+ A->use_role = pg_strdup(use_role);
}
/* Set the datestyle to ISO to ensure the dump's portability */
- ExecuteSqlStatement(AH, "SET DATESTYLE = ISO");
+ ExecuteSqlStatement(A, "SET DATESTYLE = ISO");
/* Likewise, avoid using sql_standard intervalstyle */
- ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
+ ExecuteSqlStatement(A, "SET INTERVALSTYLE = POSTGRES");
/*
* Use an explicitly specified extra_float_digits if it has been provided.
@@ -1136,54 +1136,54 @@ setup_connection(Archive *AH, const char *dumpencoding,
appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits);
- ExecuteSqlStatement(AH, q->data);
+ ExecuteSqlStatement(A, q->data);
destroyPQExpBuffer(q);
}
else
- ExecuteSqlStatement(AH, "SET extra_float_digits TO 3");
+ ExecuteSqlStatement(A, "SET extra_float_digits TO 3");
/*
* Disable synchronized scanning, to prevent unpredictable changes in row
* ordering across a dump and reload.
*/
- ExecuteSqlStatement(AH, "SET synchronize_seqscans TO off");
+ ExecuteSqlStatement(A, "SET synchronize_seqscans TO off");
/*
* Disable timeouts if supported.
*/
- ExecuteSqlStatement(AH, "SET statement_timeout = 0");
- if (AH->remoteVersion >= 90300)
- ExecuteSqlStatement(AH, "SET lock_timeout = 0");
- if (AH->remoteVersion >= 90600)
- ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
+ ExecuteSqlStatement(A, "SET statement_timeout = 0");
+ if (A->remoteVersion >= 90300)
+ ExecuteSqlStatement(A, "SET lock_timeout = 0");
+ if (A->remoteVersion >= 90600)
+ ExecuteSqlStatement(A, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.
*/
if (quote_all_identifiers)
- ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ ExecuteSqlStatement(A, "SET quote_all_identifiers = true");
/*
* Adjust row-security mode, if supported.
*/
- if (AH->remoteVersion >= 90500)
+ if (A->remoteVersion >= 90500)
{
if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security = on");
+ ExecuteSqlStatement(A, "SET row_security = on");
else
- ExecuteSqlStatement(AH, "SET row_security = off");
+ ExecuteSqlStatement(A, "SET row_security = off");
}
/*
* Initialize prepared-query state to "nothing prepared". We do this here
* so that a parallel dump worker will have its own state.
*/
- AH->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
+ A->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
- ExecuteSqlStatement(AH, "BEGIN");
+ ExecuteSqlStatement(A, "BEGIN");
/*
* To support the combination of serializable_deferrable with the jobs
@@ -1193,12 +1193,12 @@ setup_connection(Archive *AH, const char *dumpencoding,
* REPEATABLE READ transaction provides the appropriate integrity
* guarantees. This is a kluge, but safe for back-patching.
*/
- if (dopt->serializable_deferrable && AH->sync_snapshot_id == NULL)
- ExecuteSqlStatement(AH,
+ if (dopt->serializable_deferrable && A->sync_snapshot_id == NULL)
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
- ExecuteSqlStatement(AH,
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ, READ ONLY");
@@ -1208,28 +1208,28 @@ setup_connection(Archive *AH, const char *dumpencoding,
* is already set (if the server can handle it) and we should use that.
*/
if (dumpsnapshot)
- AH->sync_snapshot_id = pg_strdup(dumpsnapshot);
+ A->sync_snapshot_id = pg_strdup(dumpsnapshot);
- if (AH->sync_snapshot_id)
+ if (A->sync_snapshot_id)
{
PQExpBuffer query = createPQExpBuffer();
appendPQExpBufferStr(query, "SET TRANSACTION SNAPSHOT ");
- appendStringLiteralConn(query, AH->sync_snapshot_id, conn);
- ExecuteSqlStatement(AH, query->data);
+ appendStringLiteralConn(query, A->sync_snapshot_id, conn);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
}
- else if (AH->numWorkers > 1)
+ else if (A->numWorkers > 1)
{
- if (AH->isStandby && AH->remoteVersion < 100000)
+ if (A->isStandby && A->remoteVersion < 100000)
pg_fatal("parallel dumps from standby servers are not supported by this server version");
- AH->sync_snapshot_id = get_synchronized_snapshot(AH);
+ A->sync_snapshot_id = get_synchronized_snapshot(A);
}
}
/* Set up connection for a parallel worker process */
static void
-setupDumpWorker(Archive *AH)
+setupDumpWorker(Archive *A)
{
/*
* We want to re-select all the same values the leader connection is
@@ -1237,8 +1237,8 @@ setupDumpWorker(Archive *AH)
* AH->sync_snapshot_id and AH->use_role, but we need to translate the
* inherited encoding value back to a string to pass to setup_connection.
*/
- setup_connection(AH,
- pg_encoding_to_char(AH->encoding),
+ setup_connection(A,
+ pg_encoding_to_char(A->encoding),
NULL,
NULL);
}
@@ -2320,9 +2320,9 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
default:
/* All other types are printed as string literals. */
resetPQExpBuffer(q);
- appendStringLiteralAH(q,
- PQgetvalue(res, tuple, field),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, tuple, field),
+ fout);
archputs(q->data, fout);
break;
}
@@ -2920,7 +2920,7 @@ dumpDatabase(Archive *fout)
if (strlen(encoding) > 0)
{
appendPQExpBufferStr(creaQry, " ENCODING = ");
- appendStringLiteralAH(creaQry, encoding, fout);
+ appendStringLiteralArchive(creaQry, encoding, fout);
}
appendPQExpBufferStr(creaQry, " LOCALE_PROVIDER = ");
@@ -2935,25 +2935,25 @@ dumpDatabase(Archive *fout)
if (strlen(collate) > 0 && strcmp(collate, ctype) == 0)
{
appendPQExpBufferStr(creaQry, " LOCALE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
else
{
if (strlen(collate) > 0)
{
appendPQExpBufferStr(creaQry, " LC_COLLATE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
if (strlen(ctype) > 0)
{
appendPQExpBufferStr(creaQry, " LC_CTYPE = ");
- appendStringLiteralAH(creaQry, ctype, fout);
+ appendStringLiteralArchive(creaQry, ctype, fout);
}
}
if (iculocale)
{
appendPQExpBufferStr(creaQry, " ICU_LOCALE = ");
- appendStringLiteralAH(creaQry, iculocale, fout);
+ appendStringLiteralArchive(creaQry, iculocale, fout);
}
/*
@@ -2965,9 +2965,9 @@ dumpDatabase(Archive *fout)
if (!PQgetisnull(res, 0, i_datcollversion))
{
appendPQExpBufferStr(creaQry, " COLLATION_VERSION = ");
- appendStringLiteralAH(creaQry,
- PQgetvalue(res, 0, i_datcollversion),
- fout);
+ appendStringLiteralArchive(creaQry,
+ PQgetvalue(res, 0, i_datcollversion),
+ fout);
}
}
@@ -3021,7 +3021,7 @@ dumpDatabase(Archive *fout)
* database.
*/
appendPQExpBuffer(dbQry, "COMMENT ON DATABASE %s IS ", qdatname);
- appendStringLiteralAH(dbQry, comment, fout);
+ appendStringLiteralArchive(dbQry, comment, fout);
appendPQExpBufferStr(dbQry, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -3100,7 +3100,7 @@ dumpDatabase(Archive *fout)
*/
appendPQExpBufferStr(delQry, "UPDATE pg_catalog.pg_database "
"SET datistemplate = false WHERE datname = ");
- appendStringLiteralAH(delQry, datname, fout);
+ appendStringLiteralArchive(delQry, datname, fout);
appendPQExpBufferStr(delQry, ";\n");
}
@@ -3118,7 +3118,7 @@ dumpDatabase(Archive *fout)
"SET datfrozenxid = '%u', datminmxid = '%u'\n"
"WHERE datname = ",
frozenxid, minmxid);
- appendStringLiteralAH(creaQry, datname, fout);
+ appendStringLiteralArchive(creaQry, datname, fout);
appendPQExpBufferStr(creaQry, ";\n");
}
@@ -3270,18 +3270,18 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
* dumpEncoding: put the correct encoding into the archive
*/
static void
-dumpEncoding(Archive *AH)
+dumpEncoding(Archive *A)
{
- const char *encname = pg_encoding_to_char(AH->encoding);
+ const char *encname = pg_encoding_to_char(A->encoding);
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving encoding = %s", encname);
appendPQExpBufferStr(qry, "SET client_encoding = ");
- appendStringLiteralAH(qry, encname, AH);
+ appendStringLiteralArchive(qry, encname, A);
appendPQExpBufferStr(qry, ";\n");
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "ENCODING",
.description = "ENCODING",
.section = SECTION_PRE_DATA,
@@ -3295,9 +3295,9 @@ dumpEncoding(Archive *AH)
* dumpStdStrings: put the correct escape string behavior into the archive
*/
static void
-dumpStdStrings(Archive *AH)
+dumpStdStrings(Archive *A)
{
- const char *stdstrings = AH->std_strings ? "on" : "off";
+ const char *stdstrings = A->std_strings ? "on" : "off";
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving standard_conforming_strings = %s",
@@ -3306,7 +3306,7 @@ dumpStdStrings(Archive *AH)
appendPQExpBuffer(qry, "SET standard_conforming_strings = '%s';\n",
stdstrings);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "STDSTRINGS",
.description = "STDSTRINGS",
.section = SECTION_PRE_DATA,
@@ -3319,7 +3319,7 @@ dumpStdStrings(Archive *AH)
* dumpSearchPath: record the active search_path in the archive
*/
static void
-dumpSearchPath(Archive *AH)
+dumpSearchPath(Archive *A)
{
PQExpBuffer qry = createPQExpBuffer();
PQExpBuffer path = createPQExpBuffer();
@@ -3335,7 +3335,7 @@ dumpSearchPath(Archive *AH)
* listing schemas that may appear in search_path but not actually exist,
* which seems like a prudent exclusion.
*/
- res = ExecuteSqlQueryForSingleRow(AH,
+ res = ExecuteSqlQueryForSingleRow(A,
"SELECT pg_catalog.current_schemas(false)");
if (!parsePGArray(PQgetvalue(res, 0, 0), &schemanames, &nschemanames))
@@ -3355,19 +3355,19 @@ dumpSearchPath(Archive *AH)
}
appendPQExpBufferStr(qry, "SELECT pg_catalog.set_config('search_path', ");
- appendStringLiteralAH(qry, path->data, AH);
+ appendStringLiteralArchive(qry, path->data, A);
appendPQExpBufferStr(qry, ", false);\n");
pg_log_info("saving search_path = %s", path->data);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "SEARCHPATH",
.description = "SEARCHPATH",
.section = SECTION_PRE_DATA,
.createStmt = qry->data));
/* Also save it in AH->searchpath, in case we're doing plain text dump */
- AH->searchpath = pg_strdup(qry->data);
+ A->searchpath = pg_strdup(qry->data);
free(schemanames);
PQclear(res);
@@ -4593,7 +4593,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, "CREATE SUBSCRIPTION %s CONNECTION ",
qsubname);
- appendStringLiteralAH(query, subinfo->subconninfo, fout);
+ appendStringLiteralArchive(query, subinfo->subconninfo, fout);
/* Build list of quoted publications and append them to query. */
if (!parsePGArray(subinfo->subpublications, &pubnames, &npubnames))
@@ -4610,7 +4610,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, " PUBLICATION %s WITH (connect = false, slot_name = ", publications->data);
if (subinfo->subslotname)
- appendStringLiteralAH(query, subinfo->subslotname, fout);
+ appendStringLiteralArchive(query, subinfo->subslotname, fout);
else
appendPQExpBufferStr(query, "NONE");
@@ -9506,7 +9506,7 @@ dumpCommentExtended(Archive *fout, const char *type,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, comments->descr, fout);
+ appendStringLiteralArchive(query, comments->descr, fout);
appendPQExpBufferStr(query, ";\n");
appendPQExpBuffer(tag, "%s %s", type, name);
@@ -9596,7 +9596,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
resetPQExpBuffer(query);
appendPQExpBuffer(query, "COMMENT ON %s %s IS ", reltypename,
fmtQualifiedDumpable(tbinfo));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -9621,7 +9621,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
fmtQualifiedDumpable(tbinfo));
appendPQExpBuffer(query, "%s IS ",
fmtId(tbinfo->attnames[objsubid - 1]));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -10131,12 +10131,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_create_empty_extension(");
- appendStringLiteralAH(q, extinfo->dobj.name, fout);
+ appendStringLiteralArchive(q, extinfo->dobj.name, fout);
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, extinfo->namespace, fout);
+ appendStringLiteralArchive(q, extinfo->namespace, fout);
appendPQExpBufferStr(q, ", ");
appendPQExpBuffer(q, "%s, ", extinfo->relocatable ? "true" : "false");
- appendStringLiteralAH(q, extinfo->extversion, fout);
+ appendStringLiteralArchive(q, extinfo->extversion, fout);
appendPQExpBufferStr(q, ", ");
/*
@@ -10145,12 +10145,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
* preserved in binary upgrade.
*/
if (strlen(extinfo->extconfig) > 2)
- appendStringLiteralAH(q, extinfo->extconfig, fout);
+ appendStringLiteralArchive(q, extinfo->extconfig, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
if (strlen(extinfo->extcondition) > 2)
- appendStringLiteralAH(q, extinfo->extcondition, fout);
+ appendStringLiteralArchive(q, extinfo->extcondition, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
@@ -10165,7 +10165,7 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
{
if (n++ > 0)
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, extobj->name, fout);
+ appendStringLiteralArchive(q, extobj->name, fout);
}
}
appendPQExpBufferStr(q, "]::pg_catalog.text[]");
@@ -10300,7 +10300,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
if (i > 0)
appendPQExpBufferChar(q, ',');
appendPQExpBufferStr(q, "\n ");
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
}
}
@@ -10323,7 +10323,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
"SELECT pg_catalog.binary_upgrade_set_next_pg_enum_oid('%u'::pg_catalog.oid);\n",
enum_oid);
appendPQExpBuffer(q, "ALTER TYPE %s ADD VALUE ", qualtypname);
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
appendPQExpBufferStr(q, ";\n\n");
}
}
@@ -10748,7 +10748,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, ",\n DEFAULT = ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -10764,7 +10764,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (strcmp(typcategory, "U") != 0)
{
appendPQExpBufferStr(q, ",\n CATEGORY = ");
- appendStringLiteralAH(q, typcategory, fout);
+ appendStringLiteralArchive(q, typcategory, fout);
}
if (strcmp(typispreferred, "t") == 0)
@@ -10773,7 +10773,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (typdelim && strcmp(typdelim, ",") != 0)
{
appendPQExpBufferStr(q, ",\n DELIMITER = ");
- appendStringLiteralAH(q, typdelim, fout);
+ appendStringLiteralArchive(q, typdelim, fout);
}
if (*typalign == TYPALIGN_CHAR)
@@ -10931,7 +10931,7 @@ dumpDomain(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, " DEFAULT ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -11151,9 +11151,9 @@ dumpCompositeType(Archive *fout, const TypeInfo *tyinfo)
"SET attlen = %s, "
"attalign = '%s', attbyval = false\n"
"WHERE attname = ", attlen, attalign);
- appendStringLiteralAH(dropped, attname, fout);
+ appendStringLiteralArchive(dropped, attname, fout);
appendPQExpBufferStr(dropped, "\n AND attrelid = ");
- appendStringLiteralAH(dropped, qualtypname, fout);
+ appendStringLiteralArchive(dropped, qualtypname, fout);
appendPQExpBufferStr(dropped, "::pg_catalog.regclass;\n");
appendPQExpBuffer(dropped, "ALTER TYPE %s ",
@@ -11283,7 +11283,7 @@ dumpCompositeTypeColComments(Archive *fout, const TypeInfo *tyinfo,
appendPQExpBuffer(query, "COMMENT ON COLUMN %s.",
fmtQualifiedDumpable(tyinfo));
appendPQExpBuffer(query, "%s IS ", fmtId(attname));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -11700,7 +11700,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
else if (probin[0] != '\0')
{
appendPQExpBufferStr(asPart, "AS ");
- appendStringLiteralAH(asPart, probin, fout);
+ appendStringLiteralArchive(asPart, probin, fout);
if (prosrc[0] != '\0')
{
appendPQExpBufferStr(asPart, ", ");
@@ -11711,7 +11711,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
*/
if (dopt->disable_dollar_quoting ||
(strchr(prosrc, '\'') == NULL && strchr(prosrc, '\\') == NULL))
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11721,7 +11721,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
appendPQExpBufferStr(asPart, "AS ");
/* with no bin, dollar quote src unconditionally if allowed */
if (dopt->disable_dollar_quoting)
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11892,13 +11892,13 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
{
if (nameptr != namelist)
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, *nameptr, fout);
+ appendStringLiteralArchive(q, *nameptr, fout);
}
}
pg_free(namelist);
}
else
- appendStringLiteralAH(q, pos, fout);
+ appendStringLiteralArchive(q, pos, fout);
}
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
@@ -13181,7 +13181,7 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (colliculocale != NULL)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, colliculocale, fout);
+ appendStringLiteralArchive(q, colliculocale, fout);
}
else
{
@@ -13191,14 +13191,14 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (strcmp(collcollate, collctype) == 0)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
}
else
{
appendPQExpBufferStr(q, ", lc_collate = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
appendPQExpBufferStr(q, ", lc_ctype = ");
- appendStringLiteralAH(q, collctype, fout);
+ appendStringLiteralArchive(q, collctype, fout);
}
}
@@ -13214,9 +13214,9 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (!PQgetisnull(res, 0, i_collversion))
{
appendPQExpBufferStr(q, ", version = ");
- appendStringLiteralAH(q,
- PQgetvalue(res, 0, i_collversion),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, 0, i_collversion),
+ fout);
}
}
@@ -13310,9 +13310,9 @@ dumpConversion(Archive *fout, const ConvInfo *convinfo)
appendPQExpBuffer(q, "CREATE %sCONVERSION %s FOR ",
(condefault) ? "DEFAULT " : "",
fmtQualifiedDumpable(convinfo));
- appendStringLiteralAH(q, conforencoding, fout);
+ appendStringLiteralArchive(q, conforencoding, fout);
appendPQExpBufferStr(q, " TO ");
- appendStringLiteralAH(q, contoencoding, fout);
+ appendStringLiteralArchive(q, contoencoding, fout);
/* regproc output is already sufficiently quoted */
appendPQExpBuffer(q, " FROM %s;\n", conproc);
@@ -13567,7 +13567,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_agginitval))
{
appendPQExpBufferStr(details, ",\n INITCOND = ");
- appendStringLiteralAH(details, agginitval, fout);
+ appendStringLiteralArchive(details, agginitval, fout);
}
if (strcmp(aggfinalfn, "-") != 0)
@@ -13623,7 +13623,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_aggminitval))
{
appendPQExpBufferStr(details, ",\n MINITCOND = ");
- appendStringLiteralAH(details, aggminitval, fout);
+ appendStringLiteralArchive(details, aggminitval, fout);
}
if (strcmp(aggmfinalfn, "-") != 0)
@@ -14168,12 +14168,12 @@ dumpForeignServer(Archive *fout, const ForeignServerInfo *srvinfo)
if (srvinfo->srvtype && strlen(srvinfo->srvtype) > 0)
{
appendPQExpBufferStr(q, " TYPE ");
- appendStringLiteralAH(q, srvinfo->srvtype, fout);
+ appendStringLiteralArchive(q, srvinfo->srvtype, fout);
}
if (srvinfo->srvversion && strlen(srvinfo->srvversion) > 0)
{
appendPQExpBufferStr(q, " VERSION ");
- appendStringLiteralAH(q, srvinfo->srvversion, fout);
+ appendStringLiteralArchive(q, srvinfo->srvversion, fout);
}
appendPQExpBufferStr(q, " FOREIGN DATA WRAPPER ");
@@ -14589,7 +14589,7 @@ dumpSecLabel(Archive *fout, const char *type, const char *name,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, labels[i].label, fout);
+ appendStringLiteralArchive(query, labels[i].label, fout);
appendPQExpBufferStr(query, ";\n");
}
@@ -14672,7 +14672,7 @@ dumpTableSecLabel(Archive *fout, const TableInfo *tbinfo, const char *reltypenam
}
appendPQExpBuffer(query, "SECURITY LABEL FOR %s ON %s IS ",
fmtId(provider), target->data);
- appendStringLiteralAH(query, label, fout);
+ appendStringLiteralArchive(query, label, fout);
appendPQExpBufferStr(query, ";\n");
}
if (query->len > 0)
@@ -15488,11 +15488,11 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "\n-- set missing value.\n");
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_set_missing_value(");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass,");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attmissingval[j], fout);
appendPQExpBufferStr(q, ");\n\n");
}
}
@@ -15535,9 +15535,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"WHERE attname = ",
tbinfo->attlen[j],
tbinfo->attalign[j]);
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->relkind == RELKIND_RELATION ||
@@ -15556,9 +15556,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_attribute\n"
"SET attislocal = false\n"
"WHERE attname = ");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
}
@@ -15584,9 +15584,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_constraint\n"
"SET conislocal = false\n"
"WHERE contype = 'c' AND conname = ");
- appendStringLiteralAH(q, constr->dobj.name, fout);
+ appendStringLiteralArchive(q, constr->dobj.name, fout);
appendPQExpBufferStr(q, "\n AND conrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -15629,7 +15629,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"SET relfrozenxid = '%u', relminmxid = '%u'\n"
"WHERE oid = ",
tbinfo->frozenxid, tbinfo->minmxid);
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->toast_oid)
@@ -15661,7 +15661,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_class\n"
"SET relispopulated = 't'\n"
"WHERE oid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -16910,7 +16910,7 @@ dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo)
resetPQExpBuffer(query);
appendPQExpBufferStr(query, "SELECT pg_catalog.setval(");
- appendStringLiteralAH(query, fmtQualifiedDumpable(tbinfo), fout);
+ appendStringLiteralArchive(query, fmtQualifiedDumpable(tbinfo), fout);
appendPQExpBuffer(query, ", %s, %s);\n",
last, (called ? "true" : "false"));
@@ -17072,7 +17072,7 @@ dumpTrigger(Archive *fout, const TriggerInfo *tginfo)
if (findx > 0)
appendPQExpBufferStr(query, ", ");
- appendStringLiteralAH(query, p, fout);
+ appendStringLiteralArchive(query, p, fout);
p += tlen + 1;
}
free(tgargs);
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 69ee939d4..427f5d45f 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -705,8 +705,8 @@ extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
extern TypeInfo *getTypes(Archive *fout, int *numTypes);
extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
-extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
-extern OprInfo *getOperators(Archive *fout, int *numOperators);
+extern AggInfo *getAggregates(Archive *fout, int *numAggs);
+extern OprInfo *getOperators(Archive *fout, int *numOprs);
extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
@@ -723,7 +723,7 @@ extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
-extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
+extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 69ae027bd..083012ca3 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -72,8 +72,10 @@ static void buildShSecLabels(PGconn *conn,
const char *catalog_name, Oid objectId,
const char *objtype, const char *objname,
PQExpBuffer buffer);
-static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
- const char *pguser, trivalue prompt_password, bool fail_on_error);
+static PGconn *connectDatabase(const char *dbname,
+ const char *connection_string, const char *pghost,
+ const char *pgport, const char *pguser,
+ trivalue prompt_password, bool fail_on_error);
static char *constructConnStr(const char **keywords, const char **values);
static PGresult *executeQuery(PGconn *conn, const char *query);
static void executeCommand(PGconn *conn, const char *query);
--
2.34.1
v3-0005-Harmonize-parameter-names-in-jsonb-code.patchapplication/octet-stream; name=v3-0005-Harmonize-parameter-names-in-jsonb-code.patchDownload
From fdc1383992c3211c12efcaf38b4a29dba0cd1e5a Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 17 Sep 2022 18:19:39 -0700
Subject: [PATCH v3 5/6] Harmonize parameter names in jsonb code.
---
src/include/utils/jsonb.h | 6 +--
src/backend/utils/adt/jsonb.c | 12 ++---
src/backend/utils/adt/jsonb_util.c | 74 +++++++++++++--------------
src/backend/utils/adt/jsonpath_exec.c | 2 +-
4 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index 4cbe6edf2..b03c17d73 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -379,13 +379,13 @@ typedef struct JsonbIterator
extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
extern uint32 getJsonbLength(const JsonbContainer *jc, int index);
extern int compareJsonbContainers(JsonbContainer *a, JsonbContainer *b);
-extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *container,
uint32 flags,
JsonbValue *key);
extern JsonbValue *getKeyJsonValueFromContainer(JsonbContainer *container,
const char *keyVal, int keyLen,
JsonbValue *res);
-extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *container,
uint32 i);
extern JsonbValue *pushJsonbValue(JsonbParseState **pstate,
JsonbIteratorToken seq, JsonbValue *jbval);
@@ -406,7 +406,7 @@ extern char *JsonbToCString(StringInfo out, JsonbContainer *in,
extern char *JsonbToCStringIndent(StringInfo out, JsonbContainer *in,
int estimated_len);
extern bool JsonbExtractScalar(JsonbContainer *jbc, JsonbValue *res);
-extern const char *JsonbTypeName(JsonbValue *jb);
+extern const char *JsonbTypeName(JsonbValue *val);
extern Datum jsonb_set_element(Jsonb *jb, Datum *path, int path_len,
JsonbValue *newval);
diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c
index 88b0000f9..9e14922ec 100644
--- a/src/backend/utils/adt/jsonb.c
+++ b/src/backend/utils/adt/jsonb.c
@@ -188,12 +188,12 @@ JsonbContainerTypeName(JsonbContainer *jbc)
* Get the type name of a jsonb value.
*/
const char *
-JsonbTypeName(JsonbValue *jbv)
+JsonbTypeName(JsonbValue *val)
{
- switch (jbv->type)
+ switch (val->type)
{
case jbvBinary:
- return JsonbContainerTypeName(jbv->val.binary.data);
+ return JsonbContainerTypeName(val->val.binary.data);
case jbvObject:
return "object";
case jbvArray:
@@ -207,7 +207,7 @@ JsonbTypeName(JsonbValue *jbv)
case jbvNull:
return "null";
case jbvDatetime:
- switch (jbv->val.datetime.typid)
+ switch (val->val.datetime.typid)
{
case DATEOID:
return "date";
@@ -221,11 +221,11 @@ JsonbTypeName(JsonbValue *jbv)
return "timestamp with time zone";
default:
elog(ERROR, "unrecognized jsonb value datetime type: %d",
- jbv->val.datetime.typid);
+ val->val.datetime.typid);
}
return "unknown";
default:
- elog(ERROR, "unrecognized jsonb value type: %d", jbv->type);
+ elog(ERROR, "unrecognized jsonb value type: %d", val->type);
return "unknown";
}
}
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c
index 60442758b..7d6a1ed23 100644
--- a/src/backend/utils/adt/jsonb_util.c
+++ b/src/backend/utils/adt/jsonb_util.c
@@ -57,13 +57,13 @@ static short padBufferToInt(StringInfo buffer);
static JsonbIterator *iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent);
static JsonbIterator *freeAndGetParent(JsonbIterator *it);
static JsonbParseState *pushState(JsonbParseState **pstate);
-static void appendKey(JsonbParseState *pstate, JsonbValue *scalarVal);
+static void appendKey(JsonbParseState *pstate, JsonbValue *string);
static void appendValue(JsonbParseState *pstate, JsonbValue *scalarVal);
static void appendElement(JsonbParseState *pstate, JsonbValue *scalarVal);
static int lengthCompareJsonbStringValue(const void *a, const void *b);
static int lengthCompareJsonbString(const char *val1, int len1,
const char *val2, int len2);
-static int lengthCompareJsonbPair(const void *a, const void *b, void *arg);
+static int lengthCompareJsonbPair(const void *a, const void *b, void *binequal);
static void uniqueifyJsonbObject(JsonbValue *object);
static JsonbValue *pushJsonbValueScalar(JsonbParseState **pstate,
JsonbIteratorToken seq,
@@ -1394,22 +1394,22 @@ JsonbHashScalarValueExtended(const JsonbValue *scalarVal, uint64 *hash,
* Are two scalar JsonbValues of the same type a and b equal?
*/
static bool
-equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+equalsJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return true;
case jbvString:
- return lengthCompareJsonbStringValue(aScalar, bScalar) == 0;
+ return lengthCompareJsonbStringValue(a, b) == 0;
case jbvNumeric:
return DatumGetBool(DirectFunctionCall2(numeric_eq,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- return aScalar->val.boolean == bScalar->val.boolean;
+ return a->val.boolean == b->val.boolean;
default:
elog(ERROR, "invalid jsonb scalar type");
@@ -1426,28 +1426,28 @@ equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
* operators, where a lexical sort order is generally expected.
*/
static int
-compareJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+compareJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return 0;
case jbvString:
- return varstr_cmp(aScalar->val.string.val,
- aScalar->val.string.len,
- bScalar->val.string.val,
- bScalar->val.string.len,
+ return varstr_cmp(a->val.string.val,
+ a->val.string.len,
+ b->val.string.val,
+ b->val.string.len,
DEFAULT_COLLATION_OID);
case jbvNumeric:
return DatumGetInt32(DirectFunctionCall2(numeric_cmp,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- if (aScalar->val.boolean == bScalar->val.boolean)
+ if (a->val.boolean == b->val.boolean)
return 0;
- else if (aScalar->val.boolean > bScalar->val.boolean)
+ else if (a->val.boolean > b->val.boolean)
return 1;
else
return -1;
@@ -1608,13 +1608,13 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
}
static void
-convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbArray(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerhead;
int nElems = val->val.array.nElems;
/* Remember where in the buffer this array starts. */
@@ -1627,15 +1627,15 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nElems | JB_FARRAY;
+ containerhead = nElems | JB_FARRAY;
if (val->val.array.rawScalar)
{
Assert(nElems == 1);
Assert(level == 0);
- header |= JB_FSCALAR;
+ containerhead |= JB_FSCALAR;
}
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ appendToBuffer(buffer, (char *) &containerhead, sizeof(uint32));
/* Reserve space for the JEntries of the elements. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nElems);
@@ -1688,17 +1688,17 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbObject(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerheader;
int nPairs = val->val.object.nPairs;
/* Remember where in the buffer this object starts. */
@@ -1711,8 +1711,8 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nPairs | JB_FOBJECT;
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ containerheader = nPairs | JB_FOBJECT;
+ appendToBuffer(buffer, (char *) &containerheader, sizeof(uint32));
/* Reserve space for the JEntries of the keys and values. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nPairs * 2);
@@ -1804,11 +1804,11 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
+convertJsonbScalar(StringInfo buffer, JEntry *header, JsonbValue *scalarVal)
{
int numlen;
short padlen;
@@ -1816,13 +1816,13 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
switch (scalarVal->type)
{
case jbvNull:
- *jentry = JENTRY_ISNULL;
+ *header = JENTRY_ISNULL;
break;
case jbvString:
appendToBuffer(buffer, scalarVal->val.string.val, scalarVal->val.string.len);
- *jentry = scalarVal->val.string.len;
+ *header = scalarVal->val.string.len;
break;
case jbvNumeric:
@@ -1831,11 +1831,11 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
appendToBuffer(buffer, (char *) scalarVal->val.numeric, numlen);
- *jentry = JENTRY_ISNUMERIC | (padlen + numlen);
+ *header = JENTRY_ISNUMERIC | (padlen + numlen);
break;
case jbvBool:
- *jentry = (scalarVal->val.boolean) ?
+ *header = (scalarVal->val.boolean) ?
JENTRY_ISBOOL_TRUE : JENTRY_ISBOOL_FALSE;
break;
@@ -1851,7 +1851,7 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
len = strlen(buf);
appendToBuffer(buffer, buf, len);
- *jentry = len;
+ *header = len;
}
break;
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 9f4192e07..8d83b2edb 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -252,7 +252,7 @@ static int JsonbType(JsonbValue *jb);
static JsonbValue *getScalar(JsonbValue *scalar, enum jbvType type);
static JsonbValue *wrapItemsInArray(const JsonValueList *items);
static int compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
- bool useTz, bool *have_error);
+ bool useTz, bool *cast_error);
/****************** User interface to JsonPath executor ********************/
--
2.34.1
v3-0006-Harmonize-parameter-names-in-miscellaneous-code.patchapplication/octet-stream; name=v3-0006-Harmonize-parameter-names-in-miscellaneous-code.patchDownload
From 26f68149bbd643d5e4319c4d072a60fc6625125e Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 16:48:24 -0700
Subject: [PATCH v3 6/6] Harmonize parameter names in miscellaneous code.
---
src/include/access/genam.h | 9 ++-
src/include/access/generic_xlog.h | 2 +-
src/include/access/gin_private.h | 10 +--
src/include/access/gist_private.h | 18 ++---
src/include/access/reloptions.h | 12 +--
src/include/access/tupconvert.h | 2 +-
src/include/access/tupdesc.h | 2 +-
src/include/access/twophase.h | 2 +-
src/include/access/xact.h | 8 +-
src/include/access/xlog.h | 8 +-
src/include/access/xloginsert.h | 8 +-
src/include/access/xlogreader.h | 2 +-
src/include/access/xlogrecovery.h | 4 +-
src/include/access/xlogutils.h | 4 +-
src/include/bootstrap/bootstrap.h | 4 +-
src/include/catalog/dependency.h | 6 +-
src/include/catalog/index.h | 4 +-
src/include/catalog/namespace.h | 2 +-
src/include/catalog/objectaccess.h | 12 +--
src/include/catalog/objectaddress.h | 4 +-
src/include/catalog/pg_conversion.h | 2 +-
src/include/catalog/pg_inherits.h | 5 +-
src/include/catalog/pg_publication.h | 2 +-
src/include/commands/alter.h | 2 +-
src/include/commands/conversioncmds.h | 2 +-
src/include/commands/copy.h | 6 +-
src/include/commands/dbcommands_xlog.h | 4 +-
src/include/commands/matview.h | 2 +-
src/include/commands/policy.h | 2 +-
src/include/commands/publicationcmds.h | 2 +-
src/include/commands/schemacmds.h | 4 +-
src/include/commands/seclabel.h | 2 +-
src/include/commands/sequence.h | 8 +-
src/include/commands/tablecmds.h | 2 +-
src/include/commands/tablespace.h | 4 +-
src/include/commands/trigger.h | 14 ++--
src/include/commands/typecmds.h | 2 +-
src/include/common/fe_memutils.h | 4 +-
src/include/common/kwlookup.h | 2 +-
src/include/common/scram-common.h | 2 +-
src/include/executor/execParallel.h | 4 +-
src/include/executor/executor.h | 6 +-
src/include/executor/nodeIncrementalSort.h | 2 +-
src/include/executor/spi.h | 2 +-
src/include/fe_utils/cancel.h | 2 +-
src/include/fe_utils/mbprint.h | 3 +-
src/include/fe_utils/parallel_slot.h | 2 +-
src/include/fe_utils/recovery_gen.h | 2 +-
src/include/fe_utils/simple_list.h | 2 +-
src/include/fe_utils/string_utils.h | 2 +-
src/include/foreign/foreign.h | 5 +-
src/include/funcapi.h | 2 +-
src/include/libpq/pqmq.h | 2 +-
src/include/mb/pg_wchar.h | 6 +-
src/include/miscadmin.h | 2 +-
src/include/nodes/extensible.h | 4 +-
src/include/nodes/nodes.h | 2 +-
src/include/nodes/params.h | 4 +-
src/include/nodes/pg_list.h | 4 +-
src/include/nodes/value.h | 2 +-
src/include/optimizer/appendinfo.h | 2 +-
src/include/optimizer/clauses.h | 4 +-
src/include/optimizer/cost.h | 2 +-
src/include/optimizer/paths.h | 4 +-
src/include/optimizer/planmain.h | 2 +-
src/include/optimizer/prep.h | 2 +-
src/include/parser/analyze.h | 2 +-
src/include/parser/parse_agg.h | 2 +-
src/include/parser/parse_oper.h | 4 +-
src/include/parser/parse_relation.h | 2 +-
src/include/partitioning/partbounds.h | 4 +-
src/include/pgstat.h | 10 +--
src/include/pgtime.h | 4 +-
src/include/port.h | 8 +-
src/include/postmaster/bgworker.h | 2 +-
src/include/postmaster/syslogger.h | 2 +-
src/include/replication/logical.h | 2 +-
src/include/replication/logicalproto.h | 6 +-
src/include/replication/origin.h | 4 +-
src/include/replication/slot.h | 2 +-
src/include/replication/walsender.h | 2 +-
src/include/rewrite/rewriteManip.h | 2 +-
src/include/snowball/libstemmer/header.h | 2 +-
.../statistics/extended_stats_internal.h | 2 +-
src/include/statistics/statistics.h | 4 +-
src/include/storage/barrier.h | 2 +-
src/include/storage/bufpage.h | 4 +-
src/include/storage/dsm.h | 4 +-
src/include/storage/fd.h | 14 ++--
src/include/storage/fsm_internals.h | 2 +-
src/include/storage/indexfsm.h | 4 +-
src/include/storage/lwlock.h | 2 +-
src/include/storage/predicate.h | 2 +-
src/include/storage/procarray.h | 2 +-
src/include/storage/standby.h | 2 +-
src/include/tcop/cmdtag.h | 2 +-
src/include/tsearch/ts_utils.h | 4 +-
src/include/utils/acl.h | 6 +-
src/include/utils/attoptcache.h | 2 +-
src/include/utils/builtins.h | 8 +-
src/include/utils/datetime.h | 2 +-
src/include/utils/multirangetypes.h | 6 +-
src/include/utils/numeric.h | 2 +-
src/include/utils/pgstat_internal.h | 4 +-
src/include/utils/rangetypes.h | 4 +-
src/include/utils/regproc.h | 2 +-
src/include/utils/relcache.h | 2 +-
src/include/utils/relmapper.h | 2 +-
src/include/utils/selfuncs.h | 4 +-
src/include/utils/snapmgr.h | 2 +-
src/include/utils/timestamp.h | 4 +-
src/include/utils/tuplesort.h | 2 +-
src/include/utils/xml.h | 2 +-
src/backend/access/brin/brin_minmax_multi.c | 3 +-
src/backend/access/common/reloptions.c | 12 +--
src/backend/access/gist/gistbuild.c | 5 +-
src/backend/access/gist/gistbuildbuffers.c | 4 +-
src/backend/access/gist/gistvacuum.c | 2 +-
src/backend/access/transam/generic_xlog.c | 2 +-
src/backend/access/transam/xact.c | 2 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/access/transam/xloginsert.c | 18 ++---
src/backend/access/transam/xlogreader.c | 2 +-
src/backend/backup/basebackup.c | 2 +-
src/backend/bootstrap/bootstrap.c | 10 +--
src/backend/catalog/aclchk.c | 22 +++---
src/backend/catalog/namespace.c | 12 +--
src/backend/commands/dbcommands.c | 8 +-
src/backend/commands/event_trigger.c | 2 +-
src/backend/commands/explain.c | 2 +-
src/backend/commands/indexcmds.c | 2 +-
src/backend/commands/lockcmds.c | 2 +-
src/backend/commands/opclasscmds.c | 2 +-
src/backend/commands/schemacmds.c | 6 +-
src/backend/commands/tablecmds.c | 6 +-
src/backend/commands/trigger.c | 8 +-
src/backend/executor/execIndexing.c | 2 +-
src/backend/executor/execParallel.c | 4 +-
src/backend/executor/nodeAgg.c | 11 ++-
src/backend/executor/nodeHash.c | 6 +-
src/backend/executor/nodeHashjoin.c | 6 +-
src/backend/executor/nodeMemoize.c | 4 +-
src/backend/lib/bloomfilter.c | 2 +-
src/backend/lib/dshash.c | 2 +-
src/backend/lib/integerset.c | 4 +-
src/backend/libpq/be-secure-openssl.c | 4 +-
src/backend/optimizer/geqo/geqo_selection.c | 2 +-
src/backend/optimizer/path/costsize.c | 72 ++++++++---------
src/backend/optimizer/plan/createplan.c | 2 +-
src/backend/optimizer/plan/planner.c | 4 +-
src/backend/optimizer/util/plancat.c | 3 +-
src/backend/parser/gram.y | 3 +-
src/backend/parser/parse_clause.c | 2 +-
src/backend/parser/parse_utilcmd.c | 2 +-
src/backend/partitioning/partbounds.c | 6 +-
src/backend/postmaster/postmaster.c | 6 +-
src/backend/replication/logical/decode.c | 4 +-
src/backend/replication/logical/worker.c | 2 +-
src/backend/replication/pgoutput/pgoutput.c | 4 +-
src/backend/replication/slot.c | 2 +-
src/backend/statistics/extended_stats.c | 4 +-
src/backend/storage/buffer/bufmgr.c | 4 +-
src/backend/storage/file/buffile.c | 2 +-
src/backend/storage/freespace/freespace.c | 2 +-
src/backend/storage/ipc/dsm.c | 4 +-
src/backend/storage/ipc/procarray.c | 2 +-
src/backend/storage/lmgr/lwlock.c | 12 +--
src/backend/storage/lmgr/predicate.c | 2 +-
src/backend/storage/smgr/md.c | 48 ++++++------
src/backend/utils/adt/datetime.c | 22 +++---
src/backend/utils/adt/geo_ops.c | 8 +-
src/backend/utils/adt/like.c | 4 +-
src/backend/utils/adt/numeric.c | 6 +-
src/backend/utils/adt/rangetypes.c | 4 +-
src/backend/utils/adt/ri_triggers.c | 2 +-
src/backend/utils/adt/timestamp.c | 4 +-
src/backend/utils/adt/xml.c | 2 +-
src/backend/utils/cache/relmapper.c | 2 +-
src/backend/utils/error/elog.c | 2 +-
.../euc_jp_and_sjis/euc_jp_and_sjis.c | 4 +-
.../euc_tw_and_big5/euc_tw_and_big5.c | 2 +-
src/backend/utils/misc/guc.c | 2 +-
src/backend/utils/misc/queryjumble.c | 3 +-
src/backend/utils/sort/tuplesortvariants.c | 2 +-
src/backend/utils/time/snapmgr.c | 29 +++----
src/fe_utils/cancel.c | 4 +-
src/bin/initdb/initdb.c | 2 +-
src/bin/pg_amcheck/pg_amcheck.c | 2 +-
src/bin/pg_basebackup/pg_receivewal.c | 2 +-
src/bin/pg_basebackup/streamutil.h | 2 +-
src/bin/pg_basebackup/walmethods.h | 8 +-
src/bin/pg_rewind/file_ops.h | 4 +-
src/bin/pg_rewind/pg_rewind.h | 2 +-
src/bin/pg_upgrade/info.c | 2 +-
src/bin/pg_upgrade/pg_upgrade.h | 2 +-
src/bin/pg_upgrade/relfilenumber.c | 2 +-
src/bin/pg_verifybackup/pg_verifybackup.c | 2 +-
src/bin/pg_waldump/compat.c | 6 +-
src/bin/pgbench/pgbench.h | 8 +-
src/bin/psql/describe.h | 6 +-
src/bin/scripts/common.h | 2 +-
src/interfaces/libpq/fe-connect.c | 2 +-
src/interfaces/libpq/fe-exec.c | 14 ++--
src/interfaces/libpq/fe-secure-common.h | 4 +-
src/interfaces/libpq/fe-secure-openssl.c | 4 +-
src/interfaces/libpq/libpq-fe.h | 4 +-
src/pl/plpgsql/src/pl_exec.c | 2 +-
src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 78 ++++++++++++-------
src/interfaces/ecpg/pgtypeslib/dt.h | 22 +++---
src/interfaces/ecpg/preproc/c_keywords.c | 8 +-
src/interfaces/ecpg/preproc/output.c | 2 +-
src/interfaces/ecpg/preproc/preproc_extern.h | 4 +-
src/interfaces/ecpg/preproc/type.c | 2 +-
213 files changed, 569 insertions(+), 542 deletions(-)
diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index 134b20f1e..e1c4fdbd0 100644
--- a/src/include/access/genam.h
+++ b/src/include/access/genam.h
@@ -161,9 +161,10 @@ extern void index_rescan(IndexScanDesc scan,
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
-extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot);
-extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel,
- Snapshot snapshot, ParallelIndexScanDesc target);
+extern Size index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot);
+extern void index_parallelscan_initialize(Relation heapRelation,
+ Relation indexRelation, Snapshot snapshot,
+ ParallelIndexScanDesc target);
extern void index_parallelrescan(IndexScanDesc scan);
extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
Relation indexrel, int nkeys, int norderbys,
@@ -191,7 +192,7 @@ extern void index_store_float8_orderby_distances(IndexScanDesc scan,
Oid *orderByTypes,
IndexOrderByDistance *distances,
bool recheckOrderBy);
-extern bytea *index_opclass_options(Relation relation, AttrNumber attnum,
+extern bytea *index_opclass_options(Relation indrel, AttrNumber attnum,
Datum attoptions, bool validate);
diff --git a/src/include/access/generic_xlog.h b/src/include/access/generic_xlog.h
index c8363a476..da4565642 100644
--- a/src/include/access/generic_xlog.h
+++ b/src/include/access/generic_xlog.h
@@ -40,6 +40,6 @@ extern void GenericXLogAbort(GenericXLogState *state);
extern void generic_redo(XLogReaderState *record);
extern const char *generic_identify(uint8 info);
extern void generic_desc(StringInfo buf, XLogReaderState *record);
-extern void generic_mask(char *pagedata, BlockNumber blkno);
+extern void generic_mask(char *page, BlockNumber blkno);
#endif /* GENERIC_XLOG_H */
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index 2935d2f35..09ac53ed0 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -240,7 +240,7 @@ extern void ginDataFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page
*/
typedef struct GinVacuumState GinVacuumState;
-extern void ginVacuumPostingTreeLeaf(Relation rel, Buffer buf, GinVacuumState *gvs);
+extern void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer, GinVacuumState *gvs);
/* ginscan.c */
@@ -385,7 +385,7 @@ typedef GinScanOpaqueData *GinScanOpaque;
extern IndexScanDesc ginbeginscan(Relation rel, int nkeys, int norderbys);
extern void ginendscan(IndexScanDesc scan);
-extern void ginrescan(IndexScanDesc scan, ScanKey key, int nscankeys,
+extern void ginrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
ScanKey orderbys, int norderbys);
extern void ginNewScanKey(IndexScanDesc scan);
extern void ginFreeScanKeys(GinScanOpaque so);
@@ -469,10 +469,10 @@ extern void ginInsertCleanup(GinState *ginstate, bool full_clean,
extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd,
int maxsize, int *nwritten);
-extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int totalsize, TIDBitmap *tbm);
+extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int len, TIDBitmap *tbm);
-extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *ptr, int len, int *ndecoded);
-extern ItemPointer ginPostingListDecode(GinPostingList *ptr, int *ndecoded);
+extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *segment, int len, int *ndecoded_out);
+extern ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded);
extern ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na,
ItemPointerData *b, uint32 nb,
int *nmerged);
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 240131ef7..093bf2344 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -445,16 +445,16 @@ extern void gistXLogPageReuse(Relation rel, BlockNumber blkno,
extern XLogRecPtr gistXLogUpdate(Buffer buffer,
OffsetNumber *todelete, int ntodelete,
- IndexTuple *itup, int ntup,
- Buffer leftchild);
+ IndexTuple *itup, int ituplen,
+ Buffer leftchildbuf);
extern XLogRecPtr gistXLogDelete(Buffer buffer, OffsetNumber *todelete,
int ntodelete, TransactionId latestRemovedXid);
extern XLogRecPtr gistXLogSplit(bool page_is_leaf,
SplitedPageLayout *dist,
- BlockNumber origrlink, GistNSN oldnsn,
- Buffer leftchild, bool markfollowright);
+ BlockNumber origrlink, GistNSN orignsn,
+ Buffer leftchildbuf, bool markfollowright);
extern XLogRecPtr gistXLogAssignLSN(void);
@@ -516,8 +516,8 @@ extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
bool l, bool isNull);
extern float gistpenalty(GISTSTATE *giststate, int attno,
- GISTENTRY *key1, bool isNull1,
- GISTENTRY *key2, bool isNull2);
+ GISTENTRY *orig, bool isNullOrig,
+ GISTENTRY *add, bool isNullAdd);
extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len,
Datum *attr, bool *isnull);
extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b);
@@ -556,11 +556,11 @@ extern GISTBuildBuffers *gistInitBuildBuffers(int pagesPerBuffer, int levelStep,
int maxLevel);
extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb,
GISTSTATE *giststate,
- BlockNumber blkno, int level);
+ BlockNumber nodeBlocknum, int level);
extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple itup);
extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple *item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple *itup);
extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb);
extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb,
GISTSTATE *giststate, Relation r,
diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h
index f74051330..21bde78ed 100644
--- a/src/include/access/reloptions.h
+++ b/src/include/access/reloptions.h
@@ -195,16 +195,16 @@ extern void add_string_reloption(bits32 kinds, const char *name, const char *des
const char *default_val, validate_string_relopt validator,
LOCKMODE lockmode);
-extern void init_local_reloptions(local_relopts *opts, Size relopt_struct_size);
-extern void register_reloptions_validator(local_relopts *opts,
+extern void init_local_reloptions(local_relopts *relopts, Size relopt_struct_size);
+extern void register_reloptions_validator(local_relopts *relopts,
relopts_validator validator);
-extern void add_local_bool_reloption(local_relopts *opts, const char *name,
+extern void add_local_bool_reloption(local_relopts *relopts, const char *name,
const char *desc, bool default_val,
int offset);
-extern void add_local_int_reloption(local_relopts *opts, const char *name,
+extern void add_local_int_reloption(local_relopts *relopts, const char *name,
const char *desc, int default_val,
int min_val, int max_val, int offset);
-extern void add_local_real_reloption(local_relopts *opts, const char *name,
+extern void add_local_real_reloption(local_relopts *relopts, const char *name,
const char *desc, double default_val,
double min_val, double max_val,
int offset);
@@ -213,7 +213,7 @@ extern void add_local_enum_reloption(local_relopts *relopts,
relopt_enum_elt_def *members,
int default_val, const char *detailmsg,
int offset);
-extern void add_local_string_reloption(local_relopts *opts, const char *name,
+extern void add_local_string_reloption(local_relopts *relopts, const char *name,
const char *desc,
const char *default_val,
validate_string_relopt validator,
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h
index f5a5fd826..a37dafc66 100644
--- a/src/include/access/tupconvert.h
+++ b/src/include/access/tupconvert.h
@@ -44,7 +44,7 @@ extern HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map
extern TupleTableSlot *execute_attr_map_slot(AttrMap *attrMap,
TupleTableSlot *in_slot,
TupleTableSlot *out_slot);
-extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *inbitmap);
+extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols);
extern void free_conversion_map(TupleConversionMap *map);
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h
index 28dd6de18..cf27356ba 100644
--- a/src/include/access/tupdesc.h
+++ b/src/include/access/tupdesc.h
@@ -127,7 +127,7 @@ extern void DecrTupleDescRefCount(TupleDesc tupdesc);
extern bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
-extern uint32 hashTupleDesc(TupleDesc tupdesc);
+extern uint32 hashTupleDesc(TupleDesc desc);
extern void TupleDescInitEntry(TupleDesc desc,
AttrNumber attributeNumber,
diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h
index 5d6544e26..f94fded10 100644
--- a/src/include/access/twophase.h
+++ b/src/include/access/twophase.h
@@ -60,6 +60,6 @@ extern void PrepareRedoAdd(char *buf, XLogRecPtr start_lsn,
XLogRecPtr end_lsn, RepOriginId origin_id);
extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
extern void restoreTwoPhaseData(void);
-extern bool LookupGXact(const char *gid, XLogRecPtr prepare_at_lsn,
+extern bool LookupGXact(const char *gid, XLogRecPtr prepare_end_lsn,
TimestampTz origin_prepare_timestamp);
#endif /* TWOPHASE_H */
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index 300baae12..c604ee11f 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -490,8 +490,8 @@ extern int xactGetCommittedChildren(TransactionId **ptr);
extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval,
int xactflags,
@@ -501,8 +501,8 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int xactflags, TransactionId twophase_xid,
const char *twophase_gid);
extern void xact_redo(XLogReaderState *record);
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 9ebd321ba..3dbfa6b59 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -197,15 +197,15 @@ extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
uint8 flags,
int num_fpi,
bool topxid_included);
-extern void XLogFlush(XLogRecPtr RecPtr);
+extern void XLogFlush(XLogRecPtr record);
extern bool XLogBackgroundFlush(void);
-extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
-extern int XLogFileInit(XLogSegNo segno, TimeLineID tli);
+extern bool XLogNeedsFlush(XLogRecPtr record);
+extern int XLogFileInit(XLogSegNo logsegno, TimeLineID logtli);
extern int XLogFileOpen(XLogSegNo segno, TimeLineID tli);
extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli);
extern XLogSegNo XLogGetLastRemovedSegno(void);
-extern void XLogSetAsyncXactLSN(XLogRecPtr record);
+extern void XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN);
extern void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn);
extern void xlog_redo(XLogReaderState *record);
diff --git a/src/include/access/xloginsert.h b/src/include/access/xloginsert.h
index aed4643d1..001ff2f52 100644
--- a/src/include/access/xloginsert.h
+++ b/src/include/access/xloginsert.h
@@ -52,12 +52,12 @@ extern void XLogRegisterBufData(uint8 block_id, char *data, uint32 len);
extern void XLogResetInsertion(void);
extern bool XLogCheckBufferNeedsBackup(Buffer buffer);
-extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forkNum,
- BlockNumber blk, char *page, bool page_std);
-extern void log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
+extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forknum,
+ BlockNumber blkno, char *page, bool page_std);
+extern void log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
BlockNumber *blknos, char **pages, bool page_std);
extern XLogRecPtr log_newpage_buffer(Buffer buffer, bool page_std);
-extern void log_newpage_range(Relation rel, ForkNumber forkNum,
+extern void log_newpage_range(Relation rel, ForkNumber forknum,
BlockNumber startblk, BlockNumber endblk, bool page_std);
extern XLogRecPtr XLogSaveBufferForHint(Buffer buffer, bool buffer_std);
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 6afec33d4..6dcde2523 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -400,7 +400,7 @@ extern bool DecodeXLogRecord(XLogReaderState *state,
DecodedXLogRecord *decoded,
XLogRecord *record,
XLogRecPtr lsn,
- char **errmsg);
+ char **errormsg);
/*
* Macros that provide access to parts of the record most recently returned by
diff --git a/src/include/access/xlogrecovery.h b/src/include/access/xlogrecovery.h
index 0aa85d90e..0e3e246bd 100644
--- a/src/include/access/xlogrecovery.h
+++ b/src/include/access/xlogrecovery.h
@@ -80,7 +80,9 @@ extern PGDLLIMPORT bool StandbyMode;
extern Size XLogRecoveryShmemSize(void);
extern void XLogRecoveryShmemInit(void);
-extern void InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdownPtr, bool *haveBackupLabel, bool *haveTblspcMap);
+extern void InitWalRecovery(ControlFileData *ControlFile,
+ bool *wasShutdown_ptr, bool *haveBackupLabel_ptr,
+ bool *haveTblspcMap_ptr);
extern void PerformWalRecovery(void);
/*
diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h
index ef182977b..18dc5f99a 100644
--- a/src/include/access/xlogutils.h
+++ b/src/include/access/xlogutils.h
@@ -82,10 +82,10 @@ typedef struct ReadLocalXLogPageNoWaitPrivate
} ReadLocalXLogPageNoWaitPrivate;
extern XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record,
- uint8 buffer_id, Buffer *buf);
+ uint8 block_id, Buffer *buf);
extern Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id);
extern XLogRedoAction XLogReadBufferForRedoExtended(XLogReaderState *record,
- uint8 buffer_id,
+ uint8 block_id,
ReadBufferMode mode, bool get_cleanup_lock,
Buffer *buf);
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h
index 49d4ad560..89f5b01b3 100644
--- a/src/include/bootstrap/bootstrap.h
+++ b/src/include/bootstrap/bootstrap.h
@@ -34,8 +34,8 @@ extern PGDLLIMPORT int numattr;
extern void BootstrapModeMain(int argc, char *argv[], bool check_only) pg_attribute_noreturn();
-extern void closerel(char *name);
-extern void boot_openrel(char *name);
+extern void closerel(char *relname);
+extern void boot_openrel(char *relname);
extern void DefineAttr(char *name, char *type, int attnum, int nullness);
extern void InsertOneTuple(void);
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index 729c4c46c..98a1a8428 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -249,7 +249,7 @@ extern void recordDependencyOnTablespace(Oid classId, Oid objectId,
extern void changeDependencyOnTablespace(Oid classId, Oid objectId,
Oid newTablespaceId);
-extern void updateAclDependencies(Oid classId, Oid objectId, int32 objectSubId,
+extern void updateAclDependencies(Oid classId, Oid objectId, int32 objsubId,
Oid ownerId,
int noldmembers, Oid *oldmembers,
int nnewmembers, Oid *newmembers);
@@ -263,8 +263,8 @@ extern void copyTemplateDependencies(Oid templateDbId, Oid newDbId);
extern void dropDatabaseDependencies(Oid databaseId);
-extern void shdepDropOwned(List *relids, DropBehavior behavior);
+extern void shdepDropOwned(List *roleids, DropBehavior behavior);
-extern void shdepReassignOwned(List *relids, Oid newrole);
+extern void shdepReassignOwned(List *roleids, Oid newrole);
#endif /* DEPENDENCY_H */
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 1bdb00a52..91c28868d 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -149,7 +149,7 @@ extern void index_set_state_flags(Oid indexId, IndexStateFlagsAction action);
extern Oid IndexGetRelation(Oid indexId, bool missing_ok);
extern void reindex_index(Oid indexId, bool skip_constraint_checks,
- char relpersistence, ReindexParams *params);
+ char persistence, ReindexParams *params);
/* Flag bits for reindex_relation(): */
#define REINDEX_REL_PROCESS_TOAST 0x01
@@ -168,7 +168,7 @@ extern Size EstimateReindexStateSpace(void);
extern void SerializeReindexState(Size maxsize, char *start_address);
extern void RestoreReindexState(void *reindexstate);
-extern void IndexSetParentIndex(Relation idx, Oid parentOid);
+extern void IndexSetParentIndex(Relation partitionIdx, Oid parentOid);
/*
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h
index 1bc55c01a..2a2a2e648 100644
--- a/src/include/catalog/namespace.h
+++ b/src/include/catalog/namespace.h
@@ -85,7 +85,7 @@ extern Oid RangeVarGetRelidExtended(const RangeVar *relation,
RangeVarGetRelidCallback callback,
void *callback_arg);
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
-extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *newRelation,
+extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *relation,
LOCKMODE lockmode,
Oid *existing_relation_id);
extern void RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid);
diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h
index 567ab63e8..d754f4120 100644
--- a/src/include/catalog/objectaccess.h
+++ b/src/include/catalog/objectaccess.h
@@ -151,15 +151,15 @@ extern bool RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation);
extern void RunFunctionExecuteHook(Oid objectId);
/* String versions */
-extern void RunObjectPostCreateHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId,
bool is_internal);
-extern void RunObjectDropHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectDropHookStr(Oid classId, const char *objectName, int subId,
int dropflags);
-extern void RunObjectTruncateHookStr(const char *objectStr);
-extern void RunObjectPostAlterHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectTruncateHookStr(const char *objectName);
+extern void RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId,
Oid auxiliaryId, bool is_internal);
-extern bool RunNamespaceSearchHookStr(const char *objectStr, bool ereport_on_violation);
-extern void RunFunctionExecuteHookStr(const char *objectStr);
+extern bool RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation);
+extern void RunFunctionExecuteHookStr(const char *objectName);
/*
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
index cf4d8b310..340ffc95a 100644
--- a/src/include/catalog/objectaddress.h
+++ b/src/include/catalog/objectaddress.h
@@ -77,9 +77,9 @@ extern char *getObjectDescriptionOids(Oid classid, Oid objid);
extern int read_objtype_from_string(const char *objtype);
extern char *getObjectTypeDescription(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentity(const ObjectAddress *address,
+extern char *getObjectIdentity(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentityParts(const ObjectAddress *address,
+extern char *getObjectIdentityParts(const ObjectAddress *object,
List **objname, List **objargs,
bool missing_ok);
extern struct ArrayType *strlist_to_textarray(List *list);
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index fb26123aa..e59ed94ed 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -69,7 +69,7 @@ extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
Oid conowner,
int32 conforencoding, int32 contoencoding,
Oid conproc, bool def);
-extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding,
+extern Oid FindDefaultConversion(Oid name_space, int32 for_encoding,
int32 to_encoding);
#endif /* PG_CONVERSION_H */
diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h
index b5a32755a..9221c2ea5 100644
--- a/src/include/catalog/pg_inherits.h
+++ b/src/include/catalog/pg_inherits.h
@@ -53,13 +53,14 @@ extern List *find_inheritance_children_extended(Oid parentrelId, bool omit_detac
LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin);
extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode,
- List **parents);
+ List **numparents);
extern bool has_subclass(Oid relationId);
extern bool has_superclass(Oid relationId);
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
extern void StoreSingleInheritance(Oid relationId, Oid parentOid,
int32 seqNumber);
-extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool allow_detached,
+extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent,
+ bool expect_detach_pending,
const char *childname);
extern bool PartitionHasPendingDetach(Oid partoid);
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
index c298327f5..ecf5a28e0 100644
--- a/src/include/catalog/pg_publication.h
+++ b/src/include/catalog/pg_publication.h
@@ -137,7 +137,7 @@ extern List *GetPublicationSchemas(Oid pubid);
extern List *GetSchemaPublications(Oid schemaid);
extern List *GetSchemaPublicationRelations(Oid schemaid,
PublicationPartOpt pub_partopt);
-extern List *GetAllSchemaPublicationRelations(Oid puboid,
+extern List *GetAllSchemaPublicationRelations(Oid pubid,
PublicationPartOpt pub_partopt);
extern List *GetPubPartitionOptionRelations(List *result,
PublicationPartOpt pub_partopt,
diff --git a/src/include/commands/alter.h b/src/include/commands/alter.h
index 52f5e6f6d..fddfa3b85 100644
--- a/src/include/commands/alter.h
+++ b/src/include/commands/alter.h
@@ -29,7 +29,7 @@ extern Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid,
ObjectAddresses *objsMoved);
extern ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
-extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
+extern void AlterObjectOwner_internal(Relation rel, Oid objectId,
Oid new_ownerId);
#endif /* ALTER_H */
diff --git a/src/include/commands/conversioncmds.h b/src/include/commands/conversioncmds.h
index ab736fb62..da3136527 100644
--- a/src/include/commands/conversioncmds.h
+++ b/src/include/commands/conversioncmds.h
@@ -18,6 +18,6 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
+extern ObjectAddress CreateConversionCommand(CreateConversionStmt *stmt);
#endif /* CONVERSIONCMDS_H */
diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h
index cb0096aeb..3f6677b13 100644
--- a/src/include/commands/copy.h
+++ b/src/include/commands/copy.h
@@ -67,11 +67,11 @@ typedef struct CopyToStateData *CopyToState;
typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread);
-extern void DoCopy(ParseState *state, const CopyStmt *stmt,
+extern void DoCopy(ParseState *pstate, const CopyStmt *stmt,
int stmt_location, int stmt_len,
uint64 *processed);
-extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *ops_out, bool is_from, List *options);
+extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *opts_out, bool is_from, List *options);
extern CopyFromState BeginCopyFrom(ParseState *pstate, Relation rel, Node *whereClause,
const char *filename,
bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options);
@@ -89,7 +89,7 @@ extern DestReceiver *CreateCopyDestReceiver(void);
/*
* internal prototypes
*/
-extern CopyToState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *query,
+extern CopyToState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *raw_query,
Oid queryRelId, const char *filename, bool is_program,
List *attnamelist, List *options);
extern void EndCopyTo(CopyToState cstate);
diff --git a/src/include/commands/dbcommands_xlog.h b/src/include/commands/dbcommands_xlog.h
index 0ee2452fe..545e5430c 100644
--- a/src/include/commands/dbcommands_xlog.h
+++ b/src/include/commands/dbcommands_xlog.h
@@ -53,8 +53,8 @@ typedef struct xl_dbase_drop_rec
} xl_dbase_drop_rec;
#define MinSizeOfDbaseDropRec offsetof(xl_dbase_drop_rec, tablespace_ids)
-extern void dbase_redo(XLogReaderState *rptr);
-extern void dbase_desc(StringInfo buf, XLogReaderState *rptr);
+extern void dbase_redo(XLogReaderState *record);
+extern void dbase_desc(StringInfo buf, XLogReaderState *record);
extern const char *dbase_identify(uint8 info);
#endif /* DBCOMMANDS_XLOG_H */
diff --git a/src/include/commands/matview.h b/src/include/commands/matview.h
index a067da39d..7fbb2564a 100644
--- a/src/include/commands/matview.h
+++ b/src/include/commands/matview.h
@@ -26,7 +26,7 @@ extern void SetMatViewPopulatedState(Relation relation, bool newstate);
extern ObjectAddress ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
ParamListInfo params, QueryCompletion *qc);
-extern DestReceiver *CreateTransientRelDestReceiver(Oid oid);
+extern DestReceiver *CreateTransientRelDestReceiver(Oid transientoid);
extern bool MatViewIncrementalMaintenanceIsEnabled(void);
diff --git a/src/include/commands/policy.h b/src/include/commands/policy.h
index c5f3753da..f05bb66c6 100644
--- a/src/include/commands/policy.h
+++ b/src/include/commands/policy.h
@@ -23,7 +23,7 @@ extern void RelationBuildRowSecurity(Relation relation);
extern void RemovePolicyById(Oid policy_id);
-extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid objid);
+extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid policy_id);
extern ObjectAddress CreatePolicy(CreatePolicyStmt *stmt);
extern ObjectAddress AlterPolicy(AlterPolicyStmt *stmt);
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
index 57df3fc1e..249119657 100644
--- a/src/include/commands/publicationcmds.h
+++ b/src/include/commands/publicationcmds.h
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
extern void RemovePublicationSchemaById(Oid psoid);
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
-extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
extern void InvalidatePublicationRels(List *relids);
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
List *ancestors, bool pubviaroot);
diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h
index 8c21f2a2c..e6eb2aaa6 100644
--- a/src/include/commands/schemacmds.h
+++ b/src/include/commands/schemacmds.h
@@ -18,12 +18,12 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
+extern Oid CreateSchemaCommand(CreateSchemaStmt *stmt,
const char *queryString,
int stmt_location, int stmt_len);
extern ObjectAddress RenameSchema(const char *oldname, const char *newname);
extern ObjectAddress AlterSchemaOwner(const char *name, Oid newOwnerId);
-extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId);
+extern void AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId);
#endif /* SCHEMACMDS_H */
diff --git a/src/include/commands/seclabel.h b/src/include/commands/seclabel.h
index 1577988f1..d8dec9965 100644
--- a/src/include/commands/seclabel.h
+++ b/src/include/commands/seclabel.h
@@ -28,7 +28,7 @@ extern ObjectAddress ExecSecLabelStmt(SecLabelStmt *stmt);
typedef void (*check_object_relabel_type) (const ObjectAddress *object,
const char *seclabel);
-extern void register_label_provider(const char *provider,
+extern void register_label_provider(const char *provider_name,
check_object_relabel_type hook);
#endif /* SECLABEL_H */
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index d38c0e238..b3b04ccfa 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -55,16 +55,16 @@ extern int64 nextval_internal(Oid relid, bool check_permissions);
extern Datum nextval(PG_FUNCTION_ARGS);
extern List *sequence_options(Oid relid);
-extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
+extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq);
extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
extern void DeleteSequenceTuple(Oid relid);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
-extern void seq_redo(XLogReaderState *rptr);
-extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
+extern void seq_redo(XLogReaderState *record);
+extern void seq_desc(StringInfo buf, XLogReaderState *record);
extern const char *seq_identify(uint8 info);
-extern void seq_mask(char *pagedata, BlockNumber blkno);
+extern void seq_mask(char *page, BlockNumber blkno);
#endif /* SEQUENCE_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 0c48654b9..03f14d6be 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -66,7 +66,7 @@ extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
extern bool CheckRelationTableSpaceMove(Relation rel, Oid newTableSpaceId);
extern void SetRelationTableSpace(Relation rel, Oid newTableSpaceId,
- RelFileNumber newRelFileNumber);
+ RelFileNumber newRelFilenumber);
extern ObjectAddress renameatt(RenameStmt *stmt);
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 1f8090711..a11c9e947 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -62,8 +62,8 @@ extern char *get_tablespace_name(Oid spc_oid);
extern bool directory_is_empty(const char *path);
extern void remove_tablespace_symlink(const char *linkloc);
-extern void tblspc_redo(XLogReaderState *rptr);
-extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
+extern void tblspc_redo(XLogReaderState *record);
+extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
extern const char *tblspc_identify(uint8 info);
#endif /* TABLESPACE_H */
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index b7b6bd600..b0a928bbe 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -166,7 +166,7 @@ extern void TriggerSetParentTrigger(Relation trigRel,
Oid parentTrigId,
Oid childTableId);
extern void RemoveTriggerById(Oid trigOid);
-extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);
+extern Oid get_trigger_oid(Oid relid, const char *trigname, bool missing_ok);
extern ObjectAddress renametrig(RenameStmt *stmt);
@@ -231,22 +231,22 @@ extern bool ExecBRUpdateTriggers(EState *estate,
ResultRelInfo *relinfo,
ItemPointer tupleid,
HeapTuple fdw_trigtuple,
- TupleTableSlot *slot,
- TM_FailureData *tmfdp);
+ TupleTableSlot *newslot,
+ TM_FailureData *tmfd);
extern void ExecARUpdateTriggers(EState *estate,
ResultRelInfo *relinfo,
ResultRelInfo *src_partinfo,
ResultRelInfo *dst_partinfo,
ItemPointer tupleid,
HeapTuple fdw_trigtuple,
- TupleTableSlot *slot,
+ TupleTableSlot *newslot,
List *recheckIndexes,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
extern bool ExecIRUpdateTriggers(EState *estate,
ResultRelInfo *relinfo,
HeapTuple trigtuple,
- TupleTableSlot *slot);
+ TupleTableSlot *newslot);
extern void ExecBSTruncateTriggers(EState *estate,
ResultRelInfo *relinfo);
extern void ExecASTruncateTriggers(EState *estate,
@@ -267,9 +267,9 @@ extern bool AfterTriggerPendingOnRel(Oid relid);
* in utils/adt/ri_triggers.c
*/
extern bool RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_Initial_Check(Trigger *trigger,
Relation fk_rel, Relation pk_rel);
extern void RI_PartitionRemove_Check(Trigger *trigger, Relation fk_rel,
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h
index a17bedb85..532bc49c3 100644
--- a/src/include/commands/typecmds.h
+++ b/src/include/commands/typecmds.h
@@ -34,7 +34,7 @@ extern Oid AssignTypeMultirangeArrayOid(void);
extern ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw);
extern ObjectAddress AlterDomainNotNull(List *names, bool notNull);
-extern ObjectAddress AlterDomainAddConstraint(List *names, Node *constr,
+extern ObjectAddress AlterDomainAddConstraint(List *names, Node *newConstraint,
ObjectAddress *constrAddr);
extern ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName);
extern ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName,
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index 63f2b6a80..a1751b370 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -26,8 +26,8 @@ extern char *pg_strdup(const char *in);
extern void *pg_malloc(size_t size);
extern void *pg_malloc0(size_t size);
extern void *pg_malloc_extended(size_t size, int flags);
-extern void *pg_realloc(void *pointer, size_t size);
-extern void pg_free(void *pointer);
+extern void *pg_realloc(void *ptr, size_t size);
+extern void pg_free(void *ptr);
/*
* Variants with easier notation and more type safety
diff --git a/src/include/common/kwlookup.h b/src/include/common/kwlookup.h
index 48d7f08b8..8384e33a5 100644
--- a/src/include/common/kwlookup.h
+++ b/src/include/common/kwlookup.h
@@ -32,7 +32,7 @@ typedef struct ScanKeywordList
} ScanKeywordList;
-extern int ScanKeywordLookup(const char *text, const ScanKeywordList *keywords);
+extern int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords);
/* Code that wants to retrieve the text of the N'th keyword should use this. */
static inline const char *
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
index d1f840c11..e1f5e786e 100644
--- a/src/include/common/scram-common.h
+++ b/src/include/common/scram-common.h
@@ -49,7 +49,7 @@
extern int scram_SaltedPassword(const char *password, const char *salt,
int saltlen, int iterations, uint8 *result,
const char **errstr);
-extern int scram_H(const uint8 *str, int len, uint8 *result,
+extern int scram_H(const uint8 *input, int len, uint8 *result,
const char **errstr);
extern int scram_ClientKey(const uint8 *salted_password, uint8 *result,
const char **errstr);
diff --git a/src/include/executor/execParallel.h b/src/include/executor/execParallel.h
index 3a1b11326..955d0bd64 100644
--- a/src/include/executor/execParallel.h
+++ b/src/include/executor/execParallel.h
@@ -38,13 +38,13 @@ typedef struct ParallelExecutorInfo
} ParallelExecutorInfo;
extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate,
- EState *estate, Bitmapset *sendParam, int nworkers,
+ EState *estate, Bitmapset *sendParams, int nworkers,
int64 tuples_needed);
extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei);
extern void ExecParallelFinish(ParallelExecutorInfo *pei);
extern void ExecParallelCleanup(ParallelExecutorInfo *pei);
extern void ExecParallelReinitialize(PlanState *planstate,
- ParallelExecutorInfo *pei, Bitmapset *sendParam);
+ ParallelExecutorInfo *pei, Bitmapset *sendParams);
extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 82925b4b6..0b18a33fa 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -218,7 +218,7 @@ extern LockTupleMode ExecUpdateLockMode(EState *estate, ResultRelInfo *relinfo);
extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
- Index rti, TupleTableSlot *testslot);
+ Index rti, TupleTableSlot *inputslot);
extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
Plan *subplan, List *auxrowmarks, int epqParam);
extern void EvalPlanQualSetPlan(EPQState *epqstate,
@@ -432,7 +432,7 @@ ExecQualAndReset(ExprState *state, ExprContext *econtext)
}
#endif
-extern bool ExecCheck(ExprState *state, ExprContext *context);
+extern bool ExecCheck(ExprState *state, ExprContext *econtext);
/*
* prototypes from functions in execSRF.c
@@ -473,7 +473,7 @@ extern void ExecInitResultSlot(PlanState *planstate,
extern void ExecInitResultTupleSlotTL(PlanState *planstate,
const TupleTableSlotOps *tts_ops);
extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
- TupleDesc tupleDesc,
+ TupleDesc tupledesc,
const TupleTableSlotOps *tts_ops);
extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate,
TupleDesc tupledesc,
diff --git a/src/include/executor/nodeIncrementalSort.h b/src/include/executor/nodeIncrementalSort.h
index 84cfd96b1..519d95595 100644
--- a/src/include/executor/nodeIncrementalSort.h
+++ b/src/include/executor/nodeIncrementalSort.h
@@ -22,7 +22,7 @@ extern void ExecReScanIncrementalSort(IncrementalSortState *node);
/* parallel instrumentation support */
extern void ExecIncrementalSortEstimate(IncrementalSortState *node, ParallelContext *pcxt);
extern void ExecIncrementalSortInitializeDSM(IncrementalSortState *node, ParallelContext *pcxt);
-extern void ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pcxt);
+extern void ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pwcxt);
extern void ExecIncrementalSortRetrieveInstrumentation(IncrementalSortState *node);
#endif /* NODEINCREMENTALSORT_H */
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index b2c0c7486..697abe5fc 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -174,7 +174,7 @@ extern void *SPI_palloc(Size size);
extern void *SPI_repalloc(void *pointer, Size size);
extern void SPI_pfree(void *pointer);
extern Datum SPI_datumTransfer(Datum value, bool typByVal, int typLen);
-extern void SPI_freetuple(HeapTuple pointer);
+extern void SPI_freetuple(HeapTuple tuple);
extern void SPI_freetuptable(SPITupleTable *tuptable);
extern Portal SPI_cursor_open(const char *name, SPIPlanPtr plan,
diff --git a/src/include/fe_utils/cancel.h b/src/include/fe_utils/cancel.h
index 3b84daf6e..c256b04f4 100644
--- a/src/include/fe_utils/cancel.h
+++ b/src/include/fe_utils/cancel.h
@@ -27,6 +27,6 @@ extern void ResetCancelConn(void);
* A callback can be optionally set up to be called at cancellation
* time.
*/
-extern void setup_cancel_handler(void (*cancel_callback) (void));
+extern void setup_cancel_handler(void (*query_cancel_callback) (void));
#endif /* CANCEL_H */
diff --git a/src/include/fe_utils/mbprint.h b/src/include/fe_utils/mbprint.h
index 5dd218178..6bcd9e078 100644
--- a/src/include/fe_utils/mbprint.h
+++ b/src/include/fe_utils/mbprint.h
@@ -24,6 +24,7 @@ extern int pg_wcswidth(const char *pwcs, size_t len, int encoding);
extern void pg_wcsformat(const unsigned char *pwcs, size_t len, int encoding,
struct lineptr *lines, int count);
extern void pg_wcssize(const unsigned char *pwcs, size_t len, int encoding,
- int *width, int *height, int *format_size);
+ int *result_width, int *result_height,
+ int *result_format_size);
#endif /* MBPRINT_H */
diff --git a/src/include/fe_utils/parallel_slot.h b/src/include/fe_utils/parallel_slot.h
index 8ce63c937..199df9bb0 100644
--- a/src/include/fe_utils/parallel_slot.h
+++ b/src/include/fe_utils/parallel_slot.h
@@ -58,7 +58,7 @@ ParallelSlotClearHandler(ParallelSlot *slot)
slot->handler_context = NULL;
}
-extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *slots,
+extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *sa,
const char *dbname);
extern ParallelSlotArray *ParallelSlotsSetup(int numslots, ConnParams *cparams,
diff --git a/src/include/fe_utils/recovery_gen.h b/src/include/fe_utils/recovery_gen.h
index 83e181a22..934952f31 100644
--- a/src/include/fe_utils/recovery_gen.h
+++ b/src/include/fe_utils/recovery_gen.h
@@ -21,7 +21,7 @@
#define MINIMUM_VERSION_FOR_RECOVERY_GUC 120000
extern PQExpBuffer GenerateRecoveryConfig(PGconn *pgconn,
- char *pg_replication_slot);
+ char *replication_slot);
extern void WriteRecoveryConfig(PGconn *pgconn, char *target_dir,
PQExpBuffer contents);
diff --git a/src/include/fe_utils/simple_list.h b/src/include/fe_utils/simple_list.h
index 9261a7b0a..757fd6ac5 100644
--- a/src/include/fe_utils/simple_list.h
+++ b/src/include/fe_utils/simple_list.h
@@ -65,6 +65,6 @@ extern void simple_string_list_destroy(SimpleStringList *list);
extern const char *simple_string_list_not_touched(SimpleStringList *list);
-extern void simple_ptr_list_append(SimplePtrList *list, void *val);
+extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
#endif /* SIMPLE_LIST_H */
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index fa4deb249..0927cb19b 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -24,7 +24,7 @@ extern PGDLLIMPORT int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);
/* Functions */
-extern const char *fmtId(const char *identifier);
+extern const char *fmtId(const char *rawid);
extern const char *fmtQualifiedId(const char *schema, const char *id);
extern char *formatPGVersionNumber(int version_number, bool include_minor,
diff --git a/src/include/foreign/foreign.h b/src/include/foreign/foreign.h
index 75538110f..ac8212553 100644
--- a/src/include/foreign/foreign.h
+++ b/src/include/foreign/foreign.h
@@ -67,12 +67,13 @@ typedef struct ForeignTable
extern ForeignServer *GetForeignServer(Oid serverid);
extern ForeignServer *GetForeignServerExtended(Oid serverid,
bits16 flags);
-extern ForeignServer *GetForeignServerByName(const char *name, bool missing_ok);
+extern ForeignServer *GetForeignServerByName(const char *srvname,
+ bool missing_ok);
extern UserMapping *GetUserMapping(Oid userid, Oid serverid);
extern ForeignDataWrapper *GetForeignDataWrapper(Oid fdwid);
extern ForeignDataWrapper *GetForeignDataWrapperExtended(Oid fdwid,
bits16 flags);
-extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *name,
+extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *fdwname,
bool missing_ok);
extern ForeignTable *GetForeignTable(Oid relid);
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index dc3d819a1..10dbe3981 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -348,7 +348,7 @@ extern void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx);
* "VARIADIC NULL".
*/
extern int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start,
- bool convert_unknown, Datum **values,
+ bool convert_unknown, Datum **args,
Oid **types, bool **nulls);
#endif /* FUNCAPI_H */
diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h
index 6687c8f4c..0d7b43d83 100644
--- a/src/include/libpq/pqmq.h
+++ b/src/include/libpq/pqmq.h
@@ -19,6 +19,6 @@
extern void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh);
extern void pq_set_parallel_leader(pid_t pid, BackendId backend_id);
-extern void pq_parse_errornotice(StringInfo str, ErrorData *edata);
+extern void pq_parse_errornotice(StringInfo msg, ErrorData *edata);
#endif /* PQMQ_H */
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 1e8c3af36..4f2643742 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -606,11 +606,11 @@ extern int pg_encoding_wchar2mb_with_len(int encoding,
extern int pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2);
extern int pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n);
extern int pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n);
-extern size_t pg_wchar_strlen(const pg_wchar *wstr);
+extern size_t pg_wchar_strlen(const pg_wchar *str);
extern int pg_mblen(const char *mbstr);
extern int pg_dsplen(const char *mbstr);
extern int pg_mbstrlen(const char *mbstr);
-extern int pg_mbstrlen_with_len(const char *mbstr, int len);
+extern int pg_mbstrlen_with_len(const char *mbstr, int limit);
extern int pg_mbcliplen(const char *mbstr, int len, int limit);
extern int pg_encoding_mbcliplen(int encoding, const char *mbstr,
int len, int limit);
@@ -641,7 +641,7 @@ extern int pg_do_encoding_conversion_buf(Oid proc,
int src_encoding,
int dest_encoding,
unsigned char *src, int srclen,
- unsigned char *dst, int dstlen,
+ unsigned char *dest, int destlen,
bool noError);
extern char *pg_client_to_server(const char *s, int len);
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 65cf4ba50..ee48e392e 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -352,7 +352,7 @@ extern bool InSecurityRestrictedOperation(void);
extern bool InNoForceRLSOperation(void);
extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
-extern void InitializeSessionUserId(const char *rolename, Oid useroid);
+extern void InitializeSessionUserId(const char *rolename, Oid roleid);
extern void InitializeSessionUserIdStandalone(void);
extern void SetSessionAuthorization(Oid userid, bool is_superuser);
extern Oid GetCurrentRoleId(void);
diff --git a/src/include/nodes/extensible.h b/src/include/nodes/extensible.h
index 34936db89..820b90484 100644
--- a/src/include/nodes/extensible.h
+++ b/src/include/nodes/extensible.h
@@ -72,8 +72,8 @@ typedef struct ExtensibleNodeMethods
void (*nodeRead) (struct ExtensibleNode *node);
} ExtensibleNodeMethods;
-extern void RegisterExtensibleNodeMethods(const ExtensibleNodeMethods *method);
-extern const ExtensibleNodeMethods *GetExtensibleNodeMethods(const char *name,
+extern void RegisterExtensibleNodeMethods(const ExtensibleNodeMethods *methods);
+extern const ExtensibleNodeMethods *GetExtensibleNodeMethods(const char *extnodename,
bool missing_ok);
/*
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index cdd6debfa..a80f43e54 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -218,7 +218,7 @@ extern int16 *readAttrNumberCols(int numCols);
/*
* nodes/copyfuncs.c
*/
-extern void *copyObjectImpl(const void *obj);
+extern void *copyObjectImpl(const void *from);
/* cast result back to argument type, if supported by compiler */
#ifdef HAVE_TYPEOF
diff --git a/src/include/nodes/params.h b/src/include/nodes/params.h
index de2dd907e..543543d68 100644
--- a/src/include/nodes/params.h
+++ b/src/include/nodes/params.h
@@ -163,8 +163,8 @@ extern ParamListInfo copyParamList(ParamListInfo from);
extern Size EstimateParamListSpace(ParamListInfo paramLI);
extern void SerializeParamList(ParamListInfo paramLI, char **start_address);
extern ParamListInfo RestoreParamList(char **start_address);
-extern char *BuildParamLogString(ParamListInfo params, char **paramTextValues,
- int valueLen);
+extern char *BuildParamLogString(ParamListInfo params, char **knownTextValues,
+ int maxlen);
extern void ParamsErrorCallback(void *arg);
#endif /* PARAMS_H */
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h
index a6e04d04a..dc991626b 100644
--- a/src/include/nodes/pg_list.h
+++ b/src/include/nodes/pg_list.h
@@ -619,9 +619,9 @@ extern void list_deduplicate_oid(List *list);
extern void list_free(List *list);
extern void list_free_deep(List *list);
-extern pg_nodiscard List *list_copy(const List *list);
+extern pg_nodiscard List *list_copy(const List *oldlist);
extern pg_nodiscard List *list_copy_head(const List *oldlist, int len);
-extern pg_nodiscard List *list_copy_tail(const List *list, int nskip);
+extern pg_nodiscard List *list_copy_tail(const List *oldlist, int nskip);
extern pg_nodiscard List *list_copy_deep(const List *oldlist);
typedef int (*list_sort_comparator) (const ListCell *a, const ListCell *b);
diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h
index 5e83b843d..91878e8b9 100644
--- a/src/include/nodes/value.h
+++ b/src/include/nodes/value.h
@@ -83,7 +83,7 @@ typedef struct BitString
extern Integer *makeInteger(int i);
extern Float *makeFloat(char *numericStr);
-extern Boolean *makeBoolean(bool var);
+extern Boolean *makeBoolean(bool val);
extern String *makeString(char *str);
extern BitString *makeBitString(char *str);
diff --git a/src/include/optimizer/appendinfo.h b/src/include/optimizer/appendinfo.h
index 5e80a741a..28568fab5 100644
--- a/src/include/optimizer/appendinfo.h
+++ b/src/include/optimizer/appendinfo.h
@@ -40,7 +40,7 @@ extern void get_translated_update_targetlist(PlannerInfo *root, Index relid,
List **update_colnos);
extern AppendRelInfo **find_appinfos_by_relids(PlannerInfo *root,
Relids relids, int *nappinfos);
-extern void add_row_identity_var(PlannerInfo *root, Var *rowid_var,
+extern void add_row_identity_var(PlannerInfo *root, Var *orig_var,
Index rtindex, const char *rowid_name);
extern void add_row_identity_columns(PlannerInfo *root, Index rtindex,
RangeTblEntry *target_rte,
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index 6c5203dc4..ff242d1b6 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -40,8 +40,8 @@ extern bool contain_leaked_vars(Node *clause);
extern Relids find_nonnullable_rels(Node *clause);
extern List *find_nonnullable_vars(Node *clause);
-extern List *find_forced_null_vars(Node *clause);
-extern Var *find_forced_null_var(Node *clause);
+extern List *find_forced_null_vars(Node *node);
+extern Var *find_forced_null_var(Node *node);
extern bool is_pseudo_constant_clause(Node *clause);
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 9e91da711..2e2eb705f 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -169,7 +169,7 @@ extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path,
JoinCostWorkspace *workspace,
JoinPathExtraData *extra);
extern void cost_gather(GatherPath *path, PlannerInfo *root,
- RelOptInfo *baserel, ParamPathInfo *param_info, double *rows);
+ RelOptInfo *rel, ParamPathInfo *param_info, double *rows);
extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
RelOptInfo *rel, ParamPathInfo *param_info,
Cost input_startup_cost, Cost input_total_cost,
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index d11cdac7f..881386997 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -170,8 +170,8 @@ extern void add_child_rel_equivalences(PlannerInfo *root,
extern void add_child_join_rel_equivalences(PlannerInfo *root,
int nappinfos,
AppendRelInfo **appinfos,
- RelOptInfo *parent_rel,
- RelOptInfo *child_rel);
+ RelOptInfo *parent_joinrel,
+ RelOptInfo *child_joinrel);
extern List *generate_implied_equalities_for_column(PlannerInfo *root,
RelOptInfo *rel,
ec_matches_callback_type callback,
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 1566f435b..9dffdcfd1 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -115,6 +115,6 @@ extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
extern bool trivial_subqueryscan(SubqueryScan *plan);
extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
extern void record_plan_type_dependency(PlannerInfo *root, Oid typid);
-extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *root);
+extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *context);
#endif /* PLANMAIN_H */
diff --git a/src/include/optimizer/prep.h b/src/include/optimizer/prep.h
index 2b11ff1d1..5b4f350b3 100644
--- a/src/include/optimizer/prep.h
+++ b/src/include/optimizer/prep.h
@@ -45,7 +45,7 @@ extern PlanRowMark *get_plan_rowmark(List *rowmarks, Index rtindex);
* prototypes for prepagg.c
*/
extern void get_agg_clause_costs(PlannerInfo *root, AggSplit aggsplit,
- AggClauseCosts *agg_costs);
+ AggClauseCosts *costs);
extern void preprocess_aggrefs(PlannerInfo *root, Node *clause);
/*
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index dc379547c..3d3a5918c 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -43,7 +43,7 @@ extern List *transformInsertRow(ParseState *pstate, List *exprlist,
List *stmtcols, List *icolumns, List *attrnos,
bool strip_indirection);
extern List *transformUpdateTargetList(ParseState *pstate,
- List *targetList);
+ List *origTlist);
extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
extern Query *transformStmt(ParseState *pstate, Node *parseTree);
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index c56822f64..0856af5b4 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -19,7 +19,7 @@ extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
List *args, List *aggorder,
bool agg_distinct);
-extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *g);
+extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *p);
extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
WindowDef *windef);
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h
index e15b62290..7a57b199b 100644
--- a/src/include/parser/parse_oper.h
+++ b/src/include/parser/parse_oper.h
@@ -29,8 +29,8 @@ extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
/* Routines to find operators matching a name and given input types */
/* NB: the selected operator may require coercion of the input types! */
-extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2,
- bool noError, int location);
+extern Operator oper(ParseState *pstate, List *opname, Oid ltypeId,
+ Oid rtypeId, bool noError, int location);
extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
bool noError, int location);
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index de21c3c64..484db165d 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -88,7 +88,7 @@ extern ParseNamespaceItem *addRangeTableEntryForJoin(ParseState *pstate,
List *aliasvars,
List *leftcols,
List *rightcols,
- Alias *joinalias,
+ Alias *join_using_alias,
Alias *alias,
bool inFromCl);
extern ParseNamespaceItem *addRangeTableEntryForCTE(ParseState *pstate,
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index b1e3f1b84..1f5b706d8 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -98,7 +98,7 @@ typedef struct PartitionBoundInfoData
#define partition_bound_accepts_nulls(bi) ((bi)->null_index != -1)
#define partition_bound_has_default(bi) ((bi)->default_index != -1)
-extern int get_hash_partition_greatest_modulus(PartitionBoundInfo b);
+extern int get_hash_partition_greatest_modulus(PartitionBoundInfo bound);
extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
Oid *partcollation,
Datum *values, bool *isnull);
@@ -125,7 +125,7 @@ extern void check_new_partition_bound(char *relname, Relation parent,
PartitionBoundSpec *spec,
ParseState *pstate);
extern void check_default_partition_contents(Relation parent,
- Relation defaultRel,
+ Relation default_rel,
PartitionBoundSpec *new_spec);
extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc,
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index ac28f813b..ad7334a0d 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -417,7 +417,7 @@ extern long pgstat_report_stat(bool force);
extern void pgstat_force_next_flush(void);
extern void pgstat_reset_counters(void);
-extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objectid);
+extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objoid);
extern void pgstat_reset_of_kind(PgStat_Kind kind);
/* stats accessors */
@@ -474,7 +474,7 @@ extern void pgstat_report_connect(Oid dboid);
#define pgstat_count_conn_txn_idle_time(n) \
(pgStatTransactionIdleTime += (n))
-extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dbid);
+extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dboid);
/*
* Functions in pgstat_function.c
@@ -489,7 +489,7 @@ extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo,
extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu,
bool finalize);
-extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid funcid);
+extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid func_id);
extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
@@ -499,7 +499,7 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
extern void pgstat_create_relation(Relation rel);
extern void pgstat_drop_relation(Relation rel);
-extern void pgstat_copy_relation_stats(Relation dstrel, Relation srcrel);
+extern void pgstat_copy_relation_stats(Relation dst, Relation src);
extern void pgstat_init_relation(Relation rel);
extern void pgstat_assoc_relation(Relation rel);
@@ -571,7 +571,7 @@ extern void pgstat_twophase_postabort(TransactionId xid, uint16 info,
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry(Oid relid);
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry_ext(bool shared,
- Oid relid);
+ Oid reloid);
extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
diff --git a/src/include/pgtime.h b/src/include/pgtime.h
index 1c44be8ba..9ee590600 100644
--- a/src/include/pgtime.h
+++ b/src/include/pgtime.h
@@ -75,8 +75,8 @@ extern bool pg_tz_acceptable(pg_tz *tz);
/* these functions are in strftime.c */
-extern size_t pg_strftime(char *s, size_t max, const char *format,
- const struct pg_tm *tm);
+extern size_t pg_strftime(char *s, size_t maxsize, const char *format,
+ const struct pg_tm *t);
/* these functions and variables are in pgtz.c */
diff --git a/src/include/port.h b/src/include/port.h
index fe48618df..3562d471b 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -46,14 +46,14 @@ extern bool pg_set_block(pgsocket sock);
/* Portable path handling for Unix/Win32 (in path.c) */
-extern bool has_drive_prefix(const char *filename);
+extern bool has_drive_prefix(const char *path);
extern char *first_dir_separator(const char *filename);
extern char *last_dir_separator(const char *filename);
extern char *first_path_var_separator(const char *pathlist);
extern void join_path_components(char *ret_path,
const char *head, const char *tail);
extern void canonicalize_path(char *path);
-extern void make_native_path(char *path);
+extern void make_native_path(char *filename);
extern void cleanup_path(char *path);
extern bool path_contains_parent_reference(const char *path);
extern bool path_is_relative_and_below_cwd(const char *path);
@@ -439,7 +439,7 @@ extern void qsort_arg(void *base, size_t nel, size_t elsize,
extern void qsort_interruptible(void *base, size_t nel, size_t elsize,
qsort_arg_comparator cmp, void *arg);
-extern void *bsearch_arg(const void *key, const void *base,
+extern void *bsearch_arg(const void *key, const void *base0,
size_t nmemb, size_t size,
int (*compar) (const void *, const void *, void *),
void *arg);
@@ -479,7 +479,7 @@ extern pqsigfunc pqsignal(int signo, pqsigfunc func);
extern char *escape_single_quotes_ascii(const char *src);
/* common/wait_error.c */
-extern char *wait_result_to_str(int exit_status);
+extern char *wait_result_to_str(int exitstatus);
extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
diff --git a/src/include/postmaster/bgworker.h b/src/include/postmaster/bgworker.h
index 96975bdc9..271b94616 100644
--- a/src/include/postmaster/bgworker.h
+++ b/src/include/postmaster/bgworker.h
@@ -121,7 +121,7 @@ extern bool RegisterDynamicBackgroundWorker(BackgroundWorker *worker,
/* Query the status of a bgworker */
extern BgwHandleStatus GetBackgroundWorkerPid(BackgroundWorkerHandle *handle,
pid_t *pidp);
-extern BgwHandleStatus WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pid);
+extern BgwHandleStatus WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pidp);
extern BgwHandleStatus
WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle *);
extern const char *GetBackgroundWorkerTypeByPid(pid_t pid);
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
index 6436724f3..d4c33c844 100644
--- a/src/include/postmaster/syslogger.h
+++ b/src/include/postmaster/syslogger.h
@@ -84,7 +84,7 @@ extern PGDLLIMPORT HANDLE syslogPipe[2];
extern int SysLogger_Start(void);
-extern void write_syslogger_file(const char *buffer, int count, int dest);
+extern void write_syslogger_file(const char *buffer, int count, int destination);
#ifdef EXEC_BACKEND
extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn();
diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h
index edadacd58..5c747e2c4 100644
--- a/src/include/replication/logical.h
+++ b/src/include/replication/logical.h
@@ -133,7 +133,7 @@ extern void DecodingContextFindStartpoint(LogicalDecodingContext *ctx);
extern bool DecodingContextReady(LogicalDecodingContext *ctx);
extern void FreeDecodingContext(LogicalDecodingContext *ctx);
-extern void LogicalIncreaseXminForSlot(XLogRecPtr lsn, TransactionId xmin);
+extern void LogicalIncreaseXminForSlot(XLogRecPtr current_lsn, TransactionId xmin);
extern void LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn,
XLogRecPtr restart_lsn);
extern void LogicalConfirmReceivedLocation(XLogRecPtr lsn);
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index a771ab8ff..7eaa4c97e 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -219,7 +219,7 @@ extern LogicalRepRelId logicalrep_read_update(StringInfo in,
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, TransactionId xid,
- Relation rel, TupleTableSlot *oldtuple,
+ Relation rel, TupleTableSlot *oldslot,
bool binary);
extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
@@ -235,7 +235,7 @@ extern void logicalrep_write_rel(StringInfo out, TransactionId xid,
extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
extern void logicalrep_write_typ(StringInfo out, TransactionId xid,
Oid typoid);
-extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
+extern void logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp);
extern void logicalrep_write_stream_start(StringInfo out, TransactionId xid,
bool first_segment);
extern TransactionId logicalrep_read_stream_start(StringInfo in,
@@ -243,7 +243,7 @@ extern TransactionId logicalrep_read_stream_start(StringInfo in,
extern void logicalrep_write_stream_stop(StringInfo out);
extern void logicalrep_write_stream_commit(StringInfo out, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn);
-extern TransactionId logicalrep_read_stream_commit(StringInfo out,
+extern TransactionId logicalrep_read_stream_commit(StringInfo in,
LogicalRepCommitData *commit_data);
extern void logicalrep_write_stream_abort(StringInfo out, TransactionId xid,
TransactionId subxid);
diff --git a/src/include/replication/origin.h b/src/include/replication/origin.h
index 2d1b5e5c2..2a50d10b5 100644
--- a/src/include/replication/origin.h
+++ b/src/include/replication/origin.h
@@ -38,8 +38,8 @@ extern PGDLLIMPORT XLogRecPtr replorigin_session_origin_lsn;
extern PGDLLIMPORT TimestampTz replorigin_session_origin_timestamp;
/* API for querying & manipulating replication origins */
-extern RepOriginId replorigin_by_name(const char *name, bool missing_ok);
-extern RepOriginId replorigin_create(const char *name);
+extern RepOriginId replorigin_by_name(const char *roname, bool missing_ok);
+extern RepOriginId replorigin_create(const char *roname);
extern void replorigin_drop_by_name(const char *name, bool missing_ok, bool nowait);
extern bool replorigin_by_oid(RepOriginId roident, bool missing_ok,
char **roname);
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index 8c9f3321d..9d68bfa64 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -195,7 +195,7 @@ extern void ReplicationSlotsShmemInit(void);
/* management of individual slots */
extern void ReplicationSlotCreate(const char *name, bool db_specific,
- ReplicationSlotPersistency p, bool two_phase);
+ ReplicationSlotPersistency persistency, bool two_phase);
extern void ReplicationSlotPersist(void);
extern void ReplicationSlotDrop(const char *name, bool nowait);
diff --git a/src/include/replication/walsender.h b/src/include/replication/walsender.h
index d99a21b07..8336a6e71 100644
--- a/src/include/replication/walsender.h
+++ b/src/include/replication/walsender.h
@@ -36,7 +36,7 @@ extern PGDLLIMPORT int wal_sender_timeout;
extern PGDLLIMPORT bool log_replication_commands;
extern void InitWalSender(void);
-extern bool exec_replication_command(const char *query_string);
+extern bool exec_replication_command(const char *cmd_string);
extern void WalSndErrorCleanup(void);
extern void WalSndResourceCleanup(bool isCommit);
extern void WalSndSignals(void);
diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index 98b9b3a28..f001ca41b 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -42,7 +42,7 @@ typedef enum ReplaceVarsNoMatchOption
extern void OffsetVarNodes(Node *node, int offset, int sublevels_up);
-extern void ChangeVarNodes(Node *node, int old_varno, int new_varno,
+extern void ChangeVarNodes(Node *node, int rt_index, int new_index,
int sublevels_up);
extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up,
int min_sublevels_up);
diff --git a/src/include/snowball/libstemmer/header.h b/src/include/snowball/libstemmer/header.h
index bf172d5b9..ef5a54640 100644
--- a/src/include/snowball/libstemmer/header.h
+++ b/src/include/snowball/libstemmer/header.h
@@ -45,7 +45,7 @@ extern int eq_v_b(struct SN_env * z, const symbol * p);
extern int find_among(struct SN_env * z, const struct among * v, int v_size);
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
-extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
+extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr);
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
extern int slice_from_v(struct SN_env * z, const symbol * p);
extern int slice_del(struct SN_env * z);
diff --git a/src/include/statistics/extended_stats_internal.h b/src/include/statistics/extended_stats_internal.h
index 71f852c15..906919d88 100644
--- a/src/include/statistics/extended_stats_internal.h
+++ b/src/include/statistics/extended_stats_internal.h
@@ -79,7 +79,7 @@ extern MVDependencies *statext_dependencies_deserialize(bytea *data);
extern MCVList *statext_mcv_build(StatsBuildData *data,
double totalrows, int stattarget);
-extern bytea *statext_mcv_serialize(MCVList *mcv, VacAttrStats **stats);
+extern bytea *statext_mcv_serialize(MCVList *mcvlist, VacAttrStats **stats);
extern MCVList *statext_mcv_deserialize(bytea *data);
extern MultiSortSupport multi_sort_init(int ndims);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index bb7ef1240..0351927a2 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -102,8 +102,8 @@ extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalro
int numrows, HeapTuple *rows,
int natts, VacAttrStats **vacattrstats);
extern int ComputeExtStatisticsRows(Relation onerel,
- int natts, VacAttrStats **stats);
-extern bool statext_is_kind_built(HeapTuple htup, char kind);
+ int natts, VacAttrStats **vacattrstats);
+extern bool statext_is_kind_built(HeapTuple htup, char type);
extern Selectivity dependencies_clauselist_selectivity(PlannerInfo *root,
List *clauses,
int varRelid,
diff --git a/src/include/storage/barrier.h b/src/include/storage/barrier.h
index 57d2c52e7..4b16ab812 100644
--- a/src/include/storage/barrier.h
+++ b/src/include/storage/barrier.h
@@ -34,7 +34,7 @@ typedef struct Barrier
ConditionVariable condition_variable;
} Barrier;
-extern void BarrierInit(Barrier *barrier, int num_workers);
+extern void BarrierInit(Barrier *barrier, int participants);
extern bool BarrierArriveAndWait(Barrier *barrier, uint32 wait_event_info);
extern bool BarrierArriveAndDetach(Barrier *barrier);
extern bool BarrierArriveAndDetachExceptLast(Barrier *barrier);
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 6a947021a..2708c4b68 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -499,9 +499,9 @@ extern Size PageGetFreeSpace(Page page);
extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups);
extern Size PageGetExactFreeSpace(Page page);
extern Size PageGetHeapFreeSpace(Page page);
-extern void PageIndexTupleDelete(Page page, OffsetNumber offset);
+extern void PageIndexTupleDelete(Page page, OffsetNumber offnum);
extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems);
-extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offset);
+extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum);
extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
Item newtup, Size newsize);
extern char *PageSetChecksumCopy(Page page, BlockNumber blkno);
diff --git a/src/include/storage/dsm.h b/src/include/storage/dsm.h
index 4dd6af23a..edb32fe99 100644
--- a/src/include/storage/dsm.h
+++ b/src/include/storage/dsm.h
@@ -45,8 +45,8 @@ extern void dsm_detach(dsm_segment *seg);
extern void dsm_pin_mapping(dsm_segment *seg);
extern void dsm_unpin_mapping(dsm_segment *seg);
extern void dsm_pin_segment(dsm_segment *seg);
-extern void dsm_unpin_segment(dsm_handle h);
-extern dsm_segment *dsm_find_mapping(dsm_handle h);
+extern void dsm_unpin_segment(dsm_handle handle);
+extern dsm_segment *dsm_find_mapping(dsm_handle handle);
/* Informational functions. */
extern void *dsm_segment_address(dsm_segment *seg);
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index 2b4a8e0ff..5a48fccd9 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -117,11 +117,11 @@ extern int FileGetRawFlags(File file);
extern mode_t FileGetRawMode(File file);
/* Operations used for sharing named temporary files */
-extern File PathNameCreateTemporaryFile(const char *name, bool error_on_failure);
+extern File PathNameCreateTemporaryFile(const char *path, bool error_on_failure);
extern File PathNameOpenTemporaryFile(const char *path, int mode);
-extern bool PathNameDeleteTemporaryFile(const char *name, bool error_on_failure);
-extern void PathNameCreateTemporaryDir(const char *base, const char *name);
-extern void PathNameDeleteTemporaryDir(const char *name);
+extern bool PathNameDeleteTemporaryFile(const char *path, bool error_on_failure);
+extern void PathNameCreateTemporaryDir(const char *basedir, const char *directory);
+extern void PathNameDeleteTemporaryDir(const char *dirname);
extern void TempTablespacePath(char *path, Oid tablespace);
/* Operations that allow use of regular stdio --- USE WITH CAUTION */
@@ -177,7 +177,7 @@ extern int pg_fsync(int fd);
extern int pg_fsync_no_writethrough(int fd);
extern int pg_fsync_writethrough(int fd);
extern int pg_fdatasync(int fd);
-extern void pg_flush_data(int fd, off_t offset, off_t amount);
+extern void pg_flush_data(int fd, off_t offset, off_t nbytes);
extern ssize_t pg_pwritev_with_retry(int fd,
const struct iovec *iov,
int iovcnt,
@@ -185,8 +185,8 @@ extern ssize_t pg_pwritev_with_retry(int fd,
extern int pg_truncate(const char *path, off_t length);
extern void fsync_fname(const char *fname, bool isdir);
extern int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel);
-extern int durable_rename(const char *oldfile, const char *newfile, int loglevel);
-extern int durable_unlink(const char *fname, int loglevel);
+extern int durable_rename(const char *oldfile, const char *newfile, int elevel);
+extern int durable_unlink(const char *fname, int elevel);
extern void SyncDataDirectory(void);
extern int data_sync_elevel(int elevel);
diff --git a/src/include/storage/fsm_internals.h b/src/include/storage/fsm_internals.h
index a6f837217..819160c78 100644
--- a/src/include/storage/fsm_internals.h
+++ b/src/include/storage/fsm_internals.h
@@ -61,7 +61,7 @@ typedef FSMPageData *FSMPage;
#define SlotsPerFSMPage LeafNodesPerPage
/* Prototypes for functions in fsmpage.c */
-extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext,
+extern int fsm_search_avail(Buffer buf, uint8 minvalue, bool advancenext,
bool exclusive_lock_held);
extern uint8 fsm_get_avail(Page page, int slot);
extern uint8 fsm_get_max_avail(Page page);
diff --git a/src/include/storage/indexfsm.h b/src/include/storage/indexfsm.h
index 04c1a051b..129590863 100644
--- a/src/include/storage/indexfsm.h
+++ b/src/include/storage/indexfsm.h
@@ -18,8 +18,8 @@
#include "utils/relcache.h"
extern BlockNumber GetFreeIndexPage(Relation rel);
-extern void RecordFreeIndexPage(Relation rel, BlockNumber page);
-extern void RecordUsedIndexPage(Relation rel, BlockNumber page);
+extern void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock);
+extern void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock);
extern void IndexFreeSpaceMapVacuum(Relation rel);
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index e03d317ee..ca4eca76f 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -124,7 +124,7 @@ extern bool LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride);
extern bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode);
extern bool LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval);
-extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 value);
+extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 val);
extern Size LWLockShmemSize(void);
extern void CreateLWLocks(void);
diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h
index 8dfcb3944..dbef2ffb0 100644
--- a/src/include/storage/predicate.h
+++ b/src/include/storage/predicate.h
@@ -58,7 +58,7 @@ extern void RegisterPredicateLockingXid(TransactionId xid);
extern void PredicateLockRelation(Relation relation, Snapshot snapshot);
extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot);
extern void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot,
- TransactionId insert_xid);
+ TransactionId tuple_xid);
extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void TransferPredicateLocksToHeapRelation(Relation relation);
diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h
index 1b2cfac5a..9761f5374 100644
--- a/src/include/storage/procarray.h
+++ b/src/include/storage/procarray.h
@@ -57,7 +57,7 @@ extern TransactionId GetOldestNonRemovableTransactionId(Relation rel);
extern TransactionId GetOldestTransactionIdConsideredRunning(void);
extern TransactionId GetOldestActiveTransactionId(void);
extern TransactionId GetOldestSafeDecodingTransactionId(bool catalogOnly);
-extern void GetReplicationHorizons(TransactionId *slot_xmin, TransactionId *catalog_xmin);
+extern void GetReplicationHorizons(TransactionId *xmin, TransactionId *catalog_xmin);
extern VirtualTransactionId *GetVirtualXIDsDelayingChkpt(int *nvxids, int type);
extern bool HaveVirtualXIDsDelayingChkpt(VirtualTransactionId *vxids,
diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h
index dacef92f4..f5da98dc7 100644
--- a/src/include/storage/standby.h
+++ b/src/include/storage/standby.h
@@ -43,7 +43,7 @@ extern void StandbyDeadLockHandler(void);
extern void StandbyTimeoutHandler(void);
extern void StandbyLockTimeoutHandler(void);
extern void LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
- TimestampTz cur_ts, VirtualTransactionId *wait_list,
+ TimestampTz now, VirtualTransactionId *wait_list,
bool still_waiting);
/*
diff --git a/src/include/tcop/cmdtag.h b/src/include/tcop/cmdtag.h
index b9e8992a4..60e3179c7 100644
--- a/src/include/tcop/cmdtag.h
+++ b/src/include/tcop/cmdtag.h
@@ -53,6 +53,6 @@ extern const char *GetCommandTagName(CommandTag commandTag);
extern bool command_tag_display_rowcount(CommandTag commandTag);
extern bool command_tag_event_trigger_ok(CommandTag commandTag);
extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
-extern CommandTag GetCommandTagEnum(const char *tagname);
+extern CommandTag GetCommandTagEnum(const char *commandname);
#endif /* CMDTAG_H */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index c36c711da..fd73b3844 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -32,8 +32,8 @@ typedef struct TSVectorParseStateData *TSVectorParseState;
extern TSVectorParseState init_tsvector_parser(char *input, int flags);
extern void reset_tsvector_parser(TSVectorParseState state, char *input);
extern bool gettoken_tsvector(TSVectorParseState state,
- char **token, int *len,
- WordEntryPos **pos, int *poslen,
+ char **strval, int *lenval,
+ WordEntryPos **pos_ptr, int *poslen,
char **endptr);
extern void close_tsvector_parser(TSVectorParseState state);
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 3d6411197..9a4df3a5d 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -214,8 +214,8 @@ extern bool is_member_of_role_nosuper(Oid member, Oid role);
extern bool is_admin_of_role(Oid member, Oid role);
extern Oid select_best_admin(Oid member, Oid role);
extern void check_is_member_of_role(Oid member, Oid role);
-extern Oid get_role_oid(const char *rolename, bool missing_ok);
-extern Oid get_role_oid_or_public(const char *rolename);
+extern Oid get_role_oid(const char *rolname, bool missing_ok);
+extern Oid get_role_oid_or_public(const char *rolname);
extern Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok);
extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
@@ -285,7 +285,7 @@ extern AclResult pg_parameter_acl_aclcheck(Oid acl_oid, Oid roleid,
AclMode mode);
extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
-extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
+extern AclResult pg_largeobject_aclcheck_snapshot(Oid lobj_oid, Oid roleid,
AclMode mode, Snapshot snapshot);
extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
diff --git a/src/include/utils/attoptcache.h b/src/include/utils/attoptcache.h
index ee37af950..49ae64721 100644
--- a/src/include/utils/attoptcache.h
+++ b/src/include/utils/attoptcache.h
@@ -23,6 +23,6 @@ typedef struct AttributeOpts
float8 n_distinct_inherited;
} AttributeOpts;
-extern AttributeOpts *get_attribute_options(Oid spcid, int attnum);
+extern AttributeOpts *get_attribute_options(Oid attrelid, int attnum);
#endif /* ATTOPTCACHE_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 221c3e6c3..81631f164 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -47,10 +47,10 @@ extern int16 pg_strtoint16(const char *s);
extern int32 pg_strtoint32(const char *s);
extern int64 pg_strtoint64(const char *s);
extern int pg_itoa(int16 i, char *a);
-extern int pg_ultoa_n(uint32 l, char *a);
-extern int pg_ulltoa_n(uint64 l, char *a);
-extern int pg_ltoa(int32 l, char *a);
-extern int pg_lltoa(int64 ll, char *a);
+extern int pg_ultoa_n(uint32 value, char *a);
+extern int pg_ulltoa_n(uint64 value, char *a);
+extern int pg_ltoa(int32 value, char *a);
+extern int pg_lltoa(int64 value, char *a);
extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
extern char *pg_ultostr(char *str, uint32 value);
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 4527e8251..2cae346be 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -327,7 +327,7 @@ extern int DecodeTimezoneAbbrev(int field, char *lowtoken,
extern int DecodeSpecial(int field, char *lowtoken, int *val);
extern int DecodeUnits(int field, char *lowtoken, int *val);
-extern int j2day(int jd);
+extern int j2day(int date);
extern Node *TemporalSimplify(int32 max_precis, Node *node);
diff --git a/src/include/utils/multirangetypes.h b/src/include/utils/multirangetypes.h
index 915330f99..bc3339205 100644
--- a/src/include/utils/multirangetypes.h
+++ b/src/include/utils/multirangetypes.h
@@ -64,7 +64,7 @@ extern bool multirange_ne_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr2);
extern bool multirange_contains_elem_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
- Datum elem);
+ Datum val);
extern bool multirange_contains_range_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
const RangeType *r);
@@ -115,11 +115,11 @@ extern MultirangeType *multirange_intersect_internal(Oid mltrngtypoid,
extern TypeCacheEntry *multirange_get_typcache(FunctionCallInfo fcinfo,
Oid mltrngtypid);
extern void multirange_deserialize(TypeCacheEntry *rangetyp,
- const MultirangeType *range,
+ const MultirangeType *multirange,
int32 *range_count,
RangeType ***ranges);
extern MultirangeType *make_multirange(Oid mltrngtypoid,
- TypeCacheEntry *typcache,
+ TypeCacheEntry *rangetyp,
int32 range_count, RangeType **ranges);
extern MultirangeType *make_empty_multirange(Oid mltrngtypoid,
TypeCacheEntry *rangetyp);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 3caa74dfe..09d355e81 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -85,6 +85,6 @@ extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2,
bool *have_error);
extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2,
bool *have_error);
-extern int32 numeric_int4_opt_error(Numeric num, bool *error);
+extern int32 numeric_int4_opt_error(Numeric num, bool *have_error);
#endif /* _PG_NUMERIC_H_ */
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 901d2041d..40a360285 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -567,7 +567,7 @@ extern void pgstat_relation_delete_pending_cb(PgStat_EntryRef *entry_ref);
*/
extern void pgstat_replslot_reset_timestamp_cb(PgStatShared_Common *header, TimestampTz ts);
-extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *tmp, NameData *name);
+extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *header, NameData *name);
extern bool pgstat_replslot_from_serialized_name_cb(const NameData *name, PgStat_HashKey *key);
@@ -579,7 +579,7 @@ extern void pgstat_attach_shmem(void);
extern void pgstat_detach_shmem(void);
extern PgStat_EntryRef *pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objoid,
- bool create, bool *found);
+ bool create, bool *created_entry);
extern bool pgstat_lock_entry(PgStat_EntryRef *entry_ref, bool nowait);
extern bool pgstat_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait);
extern void pgstat_unlock_entry(PgStat_EntryRef *entry_ref);
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h
index 993fad4fc..b62f1ea48 100644
--- a/src/include/utils/rangetypes.h
+++ b/src/include/utils/rangetypes.h
@@ -141,8 +141,8 @@ extern int range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1,
extern int range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1,
const RangeBound *b2);
extern int range_compare(const void *key1, const void *key2, void *arg);
-extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1,
- RangeBound bound2);
+extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound boundA,
+ RangeBound boundB);
extern RangeType *make_empty_range(TypeCacheEntry *typcache);
extern bool range_split_internal(TypeCacheEntry *typcache, const RangeType *r1,
const RangeType *r2, RangeType **output1,
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h
index a36ceba7a..0e2965ff9 100644
--- a/src/include/utils/regproc.h
+++ b/src/include/utils/regproc.h
@@ -28,7 +28,7 @@ extern char *format_operator_extended(Oid operator_oid, bits16 flags);
extern List *stringToQualifiedNameList(const char *string);
extern char *format_procedure(Oid procedure_oid);
extern char *format_procedure_qualified(Oid procedure_oid);
-extern void format_procedure_parts(Oid operator_oid, List **objnames,
+extern void format_procedure_parts(Oid procedure_oid, List **objnames,
List **objargs, bool missing_ok);
extern char *format_operator(Oid operator_oid);
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index ba35d6b3b..73106b6fc 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -50,7 +50,7 @@ extern Oid RelationGetReplicaIndex(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);
extern List *RelationGetDummyIndexExpressions(Relation relation);
extern List *RelationGetIndexPredicate(Relation relation);
-extern Datum *RelationGetIndexRawAttOptions(Relation relation);
+extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
typedef enum IndexAttrBitmapKind
diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h
index 2bb2e255f..92f1f779a 100644
--- a/src/include/utils/relmapper.h
+++ b/src/include/utils/relmapper.h
@@ -37,7 +37,7 @@ typedef struct xl_relmap_update
extern RelFileNumber RelationMapOidToFilenumber(Oid relationId, bool shared);
-extern Oid RelationMapFilenumberToOid(RelFileNumber relationId, bool shared);
+extern Oid RelationMapFilenumberToOid(RelFileNumber filenumber, bool shared);
extern RelFileNumber RelationMapOidToFilenumberForDatabase(char *dbpath,
Oid relationId);
extern void RelationMapCopy(Oid dbid, Oid tsid, char *srcdbpath,
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index d485b9bfc..49af4ed2e 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -181,11 +181,11 @@ extern double ineq_histogram_selectivity(PlannerInfo *root,
Oid collation,
Datum constval, Oid consttype);
extern double var_eq_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Datum constval, bool constisnull,
bool varonleft, bool negate);
extern double var_eq_non_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Node *other,
bool varonleft, bool negate);
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 06eafdf11..9f4dd5360 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -169,7 +169,7 @@ extern bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
/* Support for catalog timetravel for logical decoding */
struct HTAB;
extern struct HTAB *HistoricSnapshotGetTupleCids(void);
-extern void SetupHistoricSnapshot(Snapshot snapshot_now, struct HTAB *tuplecids);
+extern void SetupHistoricSnapshot(Snapshot historic_snapshot, struct HTAB *tuplecids);
extern void TeardownHistoricSnapshot(bool is_error);
extern bool HistoricSnapshotActive(void);
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index edf3a9731..820c08941 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -83,10 +83,10 @@ extern pg_time_t timestamptz_to_time_t(TimestampTz t);
extern const char *timestamptz_to_str(TimestampTz t);
-extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *dt);
+extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result);
extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm,
fsec_t *fsec, const char **tzn, pg_tz *attimezone);
-extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec);
+extern void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec);
extern void interval2itm(Interval span, struct pg_itm *itm);
extern int itm2interval(struct pg_itm *itm, Interval *span);
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index e82b5a638..444127499 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -372,7 +372,7 @@ extern const char *tuplesort_space_type_name(TuplesortSpaceType t);
extern int tuplesort_merge_order(int64 allowedMem);
-extern Size tuplesort_estimate_shared(int nworkers);
+extern Size tuplesort_estimate_shared(int nWorkers);
extern void tuplesort_initialize_shared(Sharedsort *shared, int nWorkers,
dsm_segment *seg);
extern void tuplesort_attach_shared(Sharedsort *shared, dsm_segment *seg);
diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h
index 6620a6261..bfd0abf9c 100644
--- a/src/include/utils/xml.h
+++ b/src/include/utils/xml.h
@@ -64,7 +64,7 @@ extern xmltype *xmlconcat(List *args);
extern xmltype *xmlelement(XmlExpr *xexpr,
Datum *named_argvalue, bool *named_argnull,
Datum *argvalue, bool *argnull);
-extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace);
+extern xmltype *xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace);
extern xmltype *xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null);
extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
extern bool xml_is_document(xmltype *arg);
diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c
index dbad77643..ed16f93ac 100644
--- a/src/backend/access/brin/brin_minmax_multi.c
+++ b/src/backend/access/brin/brin_minmax_multi.c
@@ -223,7 +223,8 @@ typedef struct SerializedRanges
static SerializedRanges *brin_range_serialize(Ranges *range);
-static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range);
+static Ranges *brin_range_deserialize(int maxvalues,
+ SerializedRanges *serialized);
/*
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c
index 0aa4b334a..6458a9c27 100644
--- a/src/backend/access/common/reloptions.c
+++ b/src/backend/access/common/reloptions.c
@@ -733,11 +733,11 @@ add_reloption(relopt_gen *newoption)
* 'relopt_struct_size'.
*/
void
-init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
+init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
{
- opts->options = NIL;
- opts->validators = NIL;
- opts->relopt_struct_size = relopt_struct_size;
+ relopts->options = NIL;
+ relopts->validators = NIL;
+ relopts->relopt_struct_size = relopt_struct_size;
}
/*
@@ -746,9 +746,9 @@ init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
* build_local_reloptions().
*/
void
-register_reloptions_validator(local_relopts *opts, relopts_validator validator)
+register_reloptions_validator(local_relopts *relopts, relopts_validator validator)
{
- opts->validators = lappend(opts->validators, validator);
+ relopts->validators = lappend(relopts->validators, validator);
}
/*
diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c
index 374e64e80..fb0f46670 100644
--- a/src/backend/access/gist/gistbuild.c
+++ b/src/backend/access/gist/gistbuild.c
@@ -162,7 +162,7 @@ static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate,
BlockNumber parentblk, OffsetNumber downlinkoffnum);
static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate,
BlockNumber childblkno, int level,
- BlockNumber *parentblk,
+ BlockNumber *parentblkno,
OffsetNumber *downlinkoffnum);
static void gistProcessEmptyingQueue(GISTBuildState *buildstate);
static void gistEmptyAllBuffers(GISTBuildState *buildstate);
@@ -171,7 +171,8 @@ static int gistGetMaxLevel(Relation index);
static void gistInitParentMap(GISTBuildState *buildstate);
static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child,
BlockNumber parent);
-static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent);
+static void gistMemorizeAllDownlinks(GISTBuildState *buildstate,
+ Buffer parentbuf);
static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child);
diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c
index c6c7dfe4c..538e3880c 100644
--- a/src/backend/access/gist/gistbuildbuffers.c
+++ b/src/backend/access/gist/gistbuildbuffers.c
@@ -31,9 +31,9 @@ static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer);
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple item);
+ IndexTuple itup);
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple *item);
+ IndexTuple *itup);
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c
index f190decdf..0aa6e58a6 100644
--- a/src/backend/access/gist/gistvacuum.c
+++ b/src/backend/access/gist/gistvacuum.c
@@ -49,7 +49,7 @@ static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno,
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info,
GistVacState *vstate);
static bool gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
- Buffer buffer, OffsetNumber downlink,
+ Buffer parentBuffer, OffsetNumber downlink,
Buffer leafBuffer);
/*
diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c
index bbb542b32..6db9a1fca 100644
--- a/src/backend/access/transam/generic_xlog.c
+++ b/src/backend/access/transam/generic_xlog.c
@@ -69,7 +69,7 @@ struct GenericXLogState
};
static void writeFragment(PageData *pageData, OffsetNumber offset,
- OffsetNumber len, const char *data);
+ OffsetNumber length, const char *data);
static void computeRegionDelta(PageData *pageData,
const char *curpage, const char *targetpage,
int targetStart, int targetEnd,
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 50f092d7e..5eec4df47 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -354,7 +354,7 @@ static void AtSubStart_Memory(void);
static void AtSubStart_ResourceOwner(void);
static void ShowTransactionState(const char *str);
-static void ShowTransactionStateRec(const char *str, TransactionState state);
+static void ShowTransactionStateRec(const char *str, TransactionState s);
static const char *BlockStateAsString(TBlockState blockState);
static const char *TransStateAsString(TransState state);
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 81d339d57..eb0430fe9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -648,7 +648,7 @@ static void XLogReportParameters(void);
static int LocalSetXLogInsertAllowed(void);
static void CreateEndOfRecoveryRecord(void);
static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn,
- XLogRecPtr missingContrecPtr,
+ XLogRecPtr pagePtr,
TimeLineID newTLI);
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo);
diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c
index 24f9755e5..5ca15ebbf 100644
--- a/src/backend/access/transam/xloginsert.c
+++ b/src/backend/access/transam/xloginsert.c
@@ -1094,7 +1094,7 @@ XLogSaveBufferForHint(Buffer buffer, bool buffer_std)
* the unused space to be left out from the WAL record, making it smaller.
*/
XLogRecPtr
-log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
+log_newpage(RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno,
Page page, bool page_std)
{
int flags;
@@ -1105,7 +1105,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
flags |= REGBUF_STANDARD;
XLogBeginInsert();
- XLogRegisterBlock(0, rlocator, forkNum, blkno, page, flags);
+ XLogRegisterBlock(0, rlocator, forknum, blkno, page, flags);
recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
/*
@@ -1126,7 +1126,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
* because we can write multiple pages in a single WAL record.
*/
void
-log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
+log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
BlockNumber *blknos, Page *pages, bool page_std)
{
int flags;
@@ -1156,7 +1156,7 @@ log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
nbatch = 0;
while (nbatch < XLR_MAX_BLOCK_ID && i < num_pages)
{
- XLogRegisterBlock(nbatch, rlocator, forkNum, blknos[i], pages[i], flags);
+ XLogRegisterBlock(nbatch, rlocator, forknum, blknos[i], pages[i], flags);
i++;
nbatch++;
}
@@ -1192,15 +1192,15 @@ log_newpage_buffer(Buffer buffer, bool page_std)
{
Page page = BufferGetPage(buffer);
RelFileLocator rlocator;
- ForkNumber forkNum;
+ ForkNumber forknum;
BlockNumber blkno;
/* Shared buffers should be modified in a critical section. */
Assert(CritSectionCount > 0);
- BufferGetTag(buffer, &rlocator, &forkNum, &blkno);
+ BufferGetTag(buffer, &rlocator, &forknum, &blkno);
- return log_newpage(&rlocator, forkNum, blkno, page, page_std);
+ return log_newpage(&rlocator, forknum, blkno, page, page_std);
}
/*
@@ -1221,7 +1221,7 @@ log_newpage_buffer(Buffer buffer, bool page_std)
* cause a deadlock through some other means.
*/
void
-log_newpage_range(Relation rel, ForkNumber forkNum,
+log_newpage_range(Relation rel, ForkNumber forknum,
BlockNumber startblk, BlockNumber endblk,
bool page_std)
{
@@ -1253,7 +1253,7 @@ log_newpage_range(Relation rel, ForkNumber forkNum,
nbufs = 0;
while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk)
{
- Buffer buf = ReadBufferExtended(rel, forkNum, blkno,
+ Buffer buf = ReadBufferExtended(rel, forknum, blkno,
RBM_NORMAL, NULL);
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 050d2f424..c1c9f1995 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -47,7 +47,7 @@ static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
int reqLen);
static void XLogReaderInvalReadState(XLogReaderState *state);
-static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool non_blocking);
+static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
index 1f1cff1a5..dd103a868 100644
--- a/src/backend/backup/basebackup.c
+++ b/src/backend/backup/basebackup.c
@@ -74,7 +74,7 @@ typedef struct
pg_checksum_type manifest_checksum_type;
} basebackup_options;
-static int64 sendTablespace(bbsink *sink, char *path, char *oid, bool sizeonly,
+static int64 sendTablespace(bbsink *sink, char *path, char *spcoid, bool sizeonly,
struct backup_manifest_info *manifest);
static int64 sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly,
List *tablespaces, bool sendtblspclinks,
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index 58752368e..22635f809 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -463,19 +463,19 @@ boot_openrel(char *relname)
* ----------------
*/
void
-closerel(char *name)
+closerel(char *relname)
{
- if (name)
+ if (relname)
{
if (boot_reldesc)
{
- if (strcmp(RelationGetRelationName(boot_reldesc), name) != 0)
+ if (strcmp(RelationGetRelationName(boot_reldesc), relname) != 0)
elog(ERROR, "close of %s when %s was expected",
- name, RelationGetRelationName(boot_reldesc));
+ relname, RelationGetRelationName(boot_reldesc));
}
else
elog(ERROR, "close of %s before any relation was opened",
- name);
+ relname);
}
if (boot_reldesc == NULL)
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index b20974bbe..6c7b05847 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -104,17 +104,17 @@ typedef struct
bool binary_upgrade_record_init_privs = false;
static void ExecGrantStmt_oids(InternalGrant *istmt);
-static void ExecGrant_Relation(InternalGrant *grantStmt);
-static void ExecGrant_Database(InternalGrant *grantStmt);
-static void ExecGrant_Fdw(InternalGrant *grantStmt);
-static void ExecGrant_ForeignServer(InternalGrant *grantStmt);
-static void ExecGrant_Function(InternalGrant *grantStmt);
-static void ExecGrant_Language(InternalGrant *grantStmt);
-static void ExecGrant_Largeobject(InternalGrant *grantStmt);
-static void ExecGrant_Namespace(InternalGrant *grantStmt);
-static void ExecGrant_Tablespace(InternalGrant *grantStmt);
-static void ExecGrant_Type(InternalGrant *grantStmt);
-static void ExecGrant_Parameter(InternalGrant *grantStmt);
+static void ExecGrant_Relation(InternalGrant *istmt);
+static void ExecGrant_Database(InternalGrant *istmt);
+static void ExecGrant_Fdw(InternalGrant *istmt);
+static void ExecGrant_ForeignServer(InternalGrant *istmt);
+static void ExecGrant_Function(InternalGrant *istmt);
+static void ExecGrant_Language(InternalGrant *istmt);
+static void ExecGrant_Largeobject(InternalGrant *istmt);
+static void ExecGrant_Namespace(InternalGrant *istmt);
+static void ExecGrant_Tablespace(InternalGrant *istmt);
+static void ExecGrant_Type(InternalGrant *istmt);
+static void ExecGrant_Parameter(InternalGrant *istmt);
static void SetDefaultACLsInSchemas(InternalDefaultACL *iacls, List *nspnames);
static void SetDefaultACL(InternalDefaultACL *iacls);
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index dbb4b008a..a7022824d 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -3644,7 +3644,7 @@ PopOverrideSearchPath(void)
* database's encoding.
*/
Oid
-get_collation_oid(List *name, bool missing_ok)
+get_collation_oid(List *collname, bool missing_ok)
{
char *schemaname;
char *collation_name;
@@ -3654,7 +3654,7 @@ get_collation_oid(List *name, bool missing_ok)
ListCell *l;
/* deconstruct the name list */
- DeconstructQualifiedName(name, &schemaname, &collation_name);
+ DeconstructQualifiedName(collname, &schemaname, &collation_name);
if (schemaname)
{
@@ -3690,7 +3690,7 @@ get_collation_oid(List *name, bool missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("collation \"%s\" for encoding \"%s\" does not exist",
- NameListToString(name), GetDatabaseEncodingName())));
+ NameListToString(collname), GetDatabaseEncodingName())));
return InvalidOid;
}
@@ -3698,7 +3698,7 @@ get_collation_oid(List *name, bool missing_ok)
* get_conversion_oid - find a conversion by possibly qualified name
*/
Oid
-get_conversion_oid(List *name, bool missing_ok)
+get_conversion_oid(List *conname, bool missing_ok)
{
char *schemaname;
char *conversion_name;
@@ -3707,7 +3707,7 @@ get_conversion_oid(List *name, bool missing_ok)
ListCell *l;
/* deconstruct the name list */
- DeconstructQualifiedName(name, &schemaname, &conversion_name);
+ DeconstructQualifiedName(conname, &schemaname, &conversion_name);
if (schemaname)
{
@@ -3745,7 +3745,7 @@ get_conversion_oid(List *name, bool missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("conversion \"%s\" does not exist",
- NameListToString(name))));
+ NameListToString(conname))));
return conoid;
}
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index f248ad42b..308dc93f6 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -125,9 +125,9 @@ static bool have_createdb_privilege(void);
static void remove_dbtablespaces(Oid db_id);
static bool check_db_file_conflict(Oid db_id);
static int errdetail_busy_db(int notherbackends, int npreparedxacts);
-static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dboid, Oid src_tsid,
+static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
Oid dst_tsid);
-static List *ScanSourceDatabasePgClass(Oid srctbid, Oid srcdbid, char *srcpath);
+static List *ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath);
static List *ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid,
Oid dbid, char *srcpath,
List *rlocatorlist, Snapshot snapshot);
@@ -136,8 +136,8 @@ static CreateDBRelInfo *ScanSourceDatabasePgClassTuple(HeapTupleData *tuple,
char *srcpath);
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid,
bool isRedo);
-static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dboid, Oid src_tsid,
- Oid dst_tsid);
+static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
+ Oid src_tsid, Oid dst_tsid);
static void recovery_create_dbdir(char *path, bool only_tblspc);
/*
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 635d05405..441f29d68 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -94,7 +94,7 @@ static void AlterEventTriggerOwner_internal(Relation rel,
static void error_duplicate_filter_variable(const char *defname);
static Datum filter_list_to_array(List *filterlist);
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
- Oid evtOwner, Oid funcoid, List *tags);
+ Oid evtOwner, Oid funcoid, List *taglist);
static void validate_ddl_tags(const char *filtervar, List *taglist);
static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 053d2ca5a..f86983c66 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -111,7 +111,7 @@ static void show_incremental_sort_info(IncrementalSortState *incrsortstate,
static void show_hash_info(HashState *hashstate, ExplainState *es);
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
ExplainState *es);
-static void show_hashagg_info(AggState *hashstate, ExplainState *es);
+static void show_hashagg_info(AggState *aggstate, ExplainState *es);
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
ExplainState *es);
static void show_instrumentation_count(const char *qlabel, int which,
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index cf98d9e60..fd56066c1 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -98,7 +98,7 @@ static Oid ReindexTable(RangeVar *relation, ReindexParams *params,
bool isTopLevel);
static void ReindexMultipleTables(const char *objectName,
ReindexObjectType objectKind, ReindexParams *params);
-static void reindex_error_callback(void *args);
+static void reindex_error_callback(void *arg);
static void ReindexPartitions(Oid relid, ReindexParams *params,
bool isTopLevel);
static void ReindexMultipleInternal(List *relids,
diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c
index b97b8b043..b0747ce29 100644
--- a/src/backend/commands/lockcmds.c
+++ b/src/backend/commands/lockcmds.c
@@ -29,7 +29,7 @@
#include "utils/syscache.h"
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait);
-static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
+static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid);
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid,
Oid oldrelid, void *arg);
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 7a931ab75..775553ec7 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -52,7 +52,7 @@
static void AlterOpFamilyAdd(AlterOpFamilyStmt *stmt,
Oid amoid, Oid opfamilyoid,
int maxOpNumber, int maxProcNumber,
- int opclassOptsProcNumber, List *items);
+ int optsProcNumber, List *items);
static void AlterOpFamilyDrop(AlterOpFamilyStmt *stmt,
Oid amoid, Oid opfamilyoid,
int maxOpNumber, int maxProcNumber,
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index a583aa430..134610497 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -285,16 +285,16 @@ RenameSchema(const char *oldname, const char *newname)
}
void
-AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
+AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId)
{
HeapTuple tup;
Relation rel;
rel = table_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
+ tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(schemaoid));
if (!HeapTupleIsValid(tup))
- elog(ERROR, "cache lookup failed for schema %u", oid);
+ elog(ERROR, "cache lookup failed for schema %u", schemaoid);
AlterSchemaOwner_internal(tup, rel, newOwnerId);
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e3233a8f3..6c52edd9b 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -550,7 +550,7 @@ static ObjectAddress ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
AlterTableCmd *cmd, LOCKMODE lockmode);
static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab);
static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab);
-static void RememberStatisticsForRebuilding(Oid indoid, AlteredTableInfo *tab);
+static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab);
static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab,
LOCKMODE lockmode);
static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
@@ -610,7 +610,7 @@ static void ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partPa
List **partexprs, Oid *partopclass, Oid *partcollation, char strategy);
static void CreateInheritance(Relation child_rel, Relation parent_rel);
static void RemoveInheritance(Relation child_rel, Relation parent_rel,
- bool allow_detached);
+ bool expect_detached);
static ObjectAddress ATExecAttachPartition(List **wqueue, Relation rel,
PartitionCmd *cmd,
AlterTableUtilityContext *context);
@@ -627,7 +627,7 @@ static ObjectAddress ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab,
static void DetachPartitionFinalize(Relation rel, Relation partRel,
bool concurrent, Oid defaultPartOid);
static ObjectAddress ATExecDetachPartitionFinalize(Relation rel, RangeVar *name);
-static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation rel,
+static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
RangeVar *name);
static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 5ad18d2de..6f5a5262c 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -86,8 +86,8 @@ static bool GetTupleForTrigger(EState *estate,
ItemPointer tid,
LockTupleMode lockmode,
TupleTableSlot *oldslot,
- TupleTableSlot **newSlot,
- TM_FailureData *tmfpd);
+ TupleTableSlot **epqslot,
+ TM_FailureData *tmfdp);
static bool TriggerEnabled(EState *estate, ResultRelInfo *relinfo,
Trigger *trigger, TriggerEvent event,
Bitmapset *modifiedCols,
@@ -101,7 +101,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
ResultRelInfo *src_partinfo,
ResultRelInfo *dst_partinfo,
int event, bool row_trigger,
- TupleTableSlot *oldtup, TupleTableSlot *newtup,
+ TupleTableSlot *oldslot, TupleTableSlot *newslot,
List *recheckIndexes, Bitmapset *modifiedCols,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
@@ -3871,7 +3871,7 @@ static void TransitionTableAddTuple(EState *estate,
Tuplestorestate *tuplestore);
static void AfterTriggerFreeQuery(AfterTriggersQueryData *qs);
static SetConstraintState SetConstraintStateCreate(int numalloc);
-static SetConstraintState SetConstraintStateCopy(SetConstraintState state);
+static SetConstraintState SetConstraintStateCopy(SetConstraintState origstate);
static SetConstraintState SetConstraintStateAddItem(SetConstraintState state,
Oid tgoid, bool tgisdeferred);
static void cancel_prior_stmt_triggers(Oid relid, CmdType cmdType, int tgevent);
diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c
index 6a8735edf..1f1181b56 100644
--- a/src/backend/executor/execIndexing.c
+++ b/src/backend/executor/execIndexing.c
@@ -130,7 +130,7 @@ static bool check_exclusion_or_unique_constraint(Relation heap, Relation index,
Datum *values, bool *isnull,
EState *estate, bool newIndex,
CEOUC_WAIT_MODE waitMode,
- bool errorOK,
+ bool violationOK,
ItemPointer conflictTid);
static bool index_recheck_constraint(Relation index, Oid *constr_procs,
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index f1fd7f7e8..99512826c 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -126,9 +126,9 @@ typedef struct ExecParallelInitializeDSMContext
/* Helper functions that run in the parallel leader. */
static char *ExecSerializePlan(Plan *plan, EState *estate);
-static bool ExecParallelEstimate(PlanState *node,
+static bool ExecParallelEstimate(PlanState *planstate,
ExecParallelEstimateContext *e);
-static bool ExecParallelInitializeDSM(PlanState *node,
+static bool ExecParallelInitializeDSM(PlanState *planstate,
ExecParallelInitializeDSMContext *d);
static shm_mq_handle **ExecParallelSetupTupleQueues(ParallelContext *pcxt,
bool reinitialize);
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 933c30490..fe74e4981 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -396,7 +396,7 @@ static void prepare_projection_slot(AggState *aggstate,
TupleTableSlot *slot,
int currentSet);
static void finalize_aggregates(AggState *aggstate,
- AggStatePerAgg peragg,
+ AggStatePerAgg peraggs,
AggStatePerGroup pergroup);
static TupleTableSlot *project_aggregates(AggState *aggstate);
static void find_cols(AggState *aggstate, Bitmapset **aggregated,
@@ -407,12 +407,11 @@ static void build_hash_table(AggState *aggstate, int setno, long nbuckets);
static void hashagg_recompile_expressions(AggState *aggstate, bool minslot,
bool nullcheck);
static long hash_choose_num_buckets(double hashentrysize,
- long estimated_nbuckets,
- Size memory);
+ long ngroups, Size memory);
static int hash_choose_num_partitions(double input_groups,
double hashentrysize,
int used_bits,
- int *log2_npartittions);
+ int *log2_npartitions);
static void initialize_hash_entry(AggState *aggstate,
TupleHashTable hashtable,
TupleHashEntry entry);
@@ -432,11 +431,11 @@ static HashAggBatch *hashagg_batch_new(LogicalTape *input_tape, int setno,
int64 input_tuples, double input_card,
int used_bits);
static MinimalTuple hashagg_batch_read(HashAggBatch *batch, uint32 *hashp);
-static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *lts,
+static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *tapeset,
int used_bits, double input_groups,
double hashentrysize);
static Size hashagg_spill_tuple(AggState *aggstate, HashAggSpill *spill,
- TupleTableSlot *slot, uint32 hash);
+ TupleTableSlot *inputslot, uint32 hash);
static void hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill,
int setno);
static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 77dd1dae8..6622b202c 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -62,9 +62,9 @@ static HashJoinTuple ExecParallelHashTupleAlloc(HashJoinTable hashtable,
dsa_pointer *shared);
static void MultiExecPrivateHash(HashState *node);
static void MultiExecParallelHash(HashState *node);
-static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable hashtable,
int bucketno);
-static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable hashtable,
HashJoinTuple tuple);
static inline void ExecParallelHashPushTuple(dsa_pointer_atomic *head,
HashJoinTuple tuple,
@@ -73,7 +73,7 @@ static void ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch
static void ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable);
static void ExecParallelHashRepartitionFirst(HashJoinTable hashtable);
static void ExecParallelHashRepartitionRest(HashJoinTable hashtable);
-static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable table,
+static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable hashtable,
dsa_pointer *shared);
static bool ExecParallelHashTuplePrealloc(HashJoinTable hashtable,
int batchno,
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 87403e247..2718c2113 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -145,7 +145,7 @@ static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
TupleTableSlot *tupleSlot);
static bool ExecHashJoinNewBatch(HashJoinState *hjstate);
static bool ExecParallelHashJoinNewBatch(HashJoinState *hjstate);
-static void ExecParallelHashJoinPartitionOuter(HashJoinState *node);
+static void ExecParallelHashJoinPartitionOuter(HashJoinState *hjstate);
/* ----------------------------------------------------------------
@@ -1502,11 +1502,11 @@ ExecHashJoinInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
* ----------------------------------------------------------------
*/
void
-ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt)
+ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
{
int plan_node_id = state->js.ps.plan->plan_node_id;
ParallelHashJoinState *pstate =
- shm_toc_lookup(cxt->toc, plan_node_id, false);
+ shm_toc_lookup(pcxt->toc, plan_node_id, false);
/*
* It would be possible to reuse the shared hash table in single-batch
diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c
index d2bceb97c..7bfe02464 100644
--- a/src/backend/executor/nodeMemoize.c
+++ b/src/backend/executor/nodeMemoize.c
@@ -133,8 +133,8 @@ typedef struct MemoizeEntry
static uint32 MemoizeHash_hash(struct memoize_hash *tb,
const MemoizeKey *key);
static bool MemoizeHash_equal(struct memoize_hash *tb,
- const MemoizeKey *params1,
- const MemoizeKey *params2);
+ const MemoizeKey *key1,
+ const MemoizeKey *key2);
#define SH_PREFIX memoize
#define SH_ELEMENT_TYPE MemoizeEntry
diff --git a/src/backend/lib/bloomfilter.c b/src/backend/lib/bloomfilter.c
index 465ca7cf6..3ef67d35a 100644
--- a/src/backend/lib/bloomfilter.c
+++ b/src/backend/lib/bloomfilter.c
@@ -55,7 +55,7 @@ static int my_bloom_power(uint64 target_bitset_bits);
static int optimal_k(uint64 bitset_bits, int64 total_elems);
static void k_hashes(bloom_filter *filter, uint32 *hashes, unsigned char *elem,
size_t len);
-static inline uint32 mod_m(uint32 a, uint64 m);
+static inline uint32 mod_m(uint32 val, uint64 m);
/*
* Create Bloom filter in caller's memory context. We aim for a false positive
diff --git a/src/backend/lib/dshash.c b/src/backend/lib/dshash.c
index c5c032a59..d39cde9cc 100644
--- a/src/backend/lib/dshash.c
+++ b/src/backend/lib/dshash.c
@@ -167,7 +167,7 @@ struct dshash_table
static void delete_item(dshash_table *hash_table,
dshash_table_item *item);
-static void resize(dshash_table *hash_table, size_t new_size);
+static void resize(dshash_table *hash_table, size_t new_size_log2);
static inline void ensure_valid_bucket_pointers(dshash_table *hash_table);
static inline dshash_table_item *find_in_bucket(dshash_table *hash_table,
const void *key,
diff --git a/src/backend/lib/integerset.c b/src/backend/lib/integerset.c
index 41d3abdb0..345cd1b3a 100644
--- a/src/backend/lib/integerset.c
+++ b/src/backend/lib/integerset.c
@@ -264,9 +264,9 @@ static void intset_update_upper(IntegerSet *intset, int level,
intset_node *child, uint64 child_key);
static void intset_flush_buffered_values(IntegerSet *intset);
-static int intset_binsrch_uint64(uint64 value, uint64 *arr, int arr_elems,
+static int intset_binsrch_uint64(uint64 item, uint64 *arr, int arr_elems,
bool nextkey);
-static int intset_binsrch_leaf(uint64 value, leaf_item *arr, int arr_elems,
+static int intset_binsrch_leaf(uint64 item, leaf_item *arr, int arr_elems,
bool nextkey);
static uint64 simple8b_encode(const uint64 *ints, int *num_encoded, uint64 base);
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 035655738..cb702e0fd 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -62,10 +62,10 @@ static BIO_METHOD *my_BIO_s_socket(void);
static int my_SSL_set_fd(Port *port, int fd);
static DH *load_dh_file(char *filename, bool isServerStart);
-static DH *load_dh_buffer(const char *, size_t);
+static DH *load_dh_buffer(const char *buffer, size_t len);
static int ssl_external_passwd_cb(char *buf, int size, int rwflag, void *userdata);
static int dummy_ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);
-static int verify_cb(int, X509_STORE_CTX *);
+static int verify_cb(int ok, X509_STORE_CTX *ctx);
static void info_cb(const SSL *ssl, int type, int args);
static bool initialize_dh(SSL_CTX *context, bool isServerStart);
static bool initialize_ecdh(SSL_CTX *context, bool isServerStart);
diff --git a/src/backend/optimizer/geqo/geqo_selection.c b/src/backend/optimizer/geqo/geqo_selection.c
index 50f678a49..fd3f6894d 100644
--- a/src/backend/optimizer/geqo/geqo_selection.c
+++ b/src/backend/optimizer/geqo/geqo_selection.c
@@ -42,7 +42,7 @@
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_selection.h"
-static int linear_rand(PlannerInfo *root, int max, double bias);
+static int linear_rand(PlannerInfo *root, int pool_size, double bias);
/*
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index f486d4244..a4f581e8c 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -2517,38 +2517,38 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)
* Determines and returns the cost of an Append node.
*/
void
-cost_append(AppendPath *apath, PlannerInfo *root)
+cost_append(AppendPath *path, PlannerInfo *root)
{
ListCell *l;
- apath->path.startup_cost = 0;
- apath->path.total_cost = 0;
- apath->path.rows = 0;
+ path->path.startup_cost = 0;
+ path->path.total_cost = 0;
+ path->path.rows = 0;
- if (apath->subpaths == NIL)
+ if (path->subpaths == NIL)
return;
- if (!apath->path.parallel_aware)
+ if (!path->path.parallel_aware)
{
- List *pathkeys = apath->path.pathkeys;
+ List *pathkeys = path->path.pathkeys;
if (pathkeys == NIL)
{
- Path *subpath = (Path *) linitial(apath->subpaths);
+ Path *subpath = (Path *) linitial(path->subpaths);
/*
* For an unordered, non-parallel-aware Append we take the startup
* cost as the startup cost of the first subpath.
*/
- apath->path.startup_cost = subpath->startup_cost;
+ path->path.startup_cost = subpath->startup_cost;
/* Compute rows and costs as sums of subplan rows and costs. */
- foreach(l, apath->subpaths)
+ foreach(l, path->subpaths)
{
Path *subpath = (Path *) lfirst(l);
- apath->path.rows += subpath->rows;
- apath->path.total_cost += subpath->total_cost;
+ path->path.rows += subpath->rows;
+ path->path.total_cost += subpath->total_cost;
}
}
else
@@ -2571,7 +2571,7 @@ cost_append(AppendPath *apath, PlannerInfo *root)
* account for possibly injecting sorts into subpaths that aren't
* natively ordered.
*/
- foreach(l, apath->subpaths)
+ foreach(l, path->subpaths)
{
Path *subpath = (Path *) lfirst(l);
Path sort_path; /* dummy for result of cost_sort */
@@ -2592,26 +2592,26 @@ cost_append(AppendPath *apath, PlannerInfo *root)
subpath->pathtarget->width,
0.0,
work_mem,
- apath->limit_tuples);
+ path->limit_tuples);
subpath = &sort_path;
}
- apath->path.rows += subpath->rows;
- apath->path.startup_cost += subpath->startup_cost;
- apath->path.total_cost += subpath->total_cost;
+ path->path.rows += subpath->rows;
+ path->path.startup_cost += subpath->startup_cost;
+ path->path.total_cost += subpath->total_cost;
}
}
}
else /* parallel-aware */
{
int i = 0;
- double parallel_divisor = get_parallel_divisor(&apath->path);
+ double parallel_divisor = get_parallel_divisor(&path->path);
/* Parallel-aware Append never produces ordered output. */
- Assert(apath->path.pathkeys == NIL);
+ Assert(path->path.pathkeys == NIL);
/* Calculate startup cost. */
- foreach(l, apath->subpaths)
+ foreach(l, path->subpaths)
{
Path *subpath = (Path *) lfirst(l);
@@ -2621,10 +2621,10 @@ cost_append(AppendPath *apath, PlannerInfo *root)
* first few subplans that immediately get a worker assigned.
*/
if (i == 0)
- apath->path.startup_cost = subpath->startup_cost;
- else if (i < apath->path.parallel_workers)
- apath->path.startup_cost = Min(apath->path.startup_cost,
- subpath->startup_cost);
+ path->path.startup_cost = subpath->startup_cost;
+ else if (i < path->path.parallel_workers)
+ path->path.startup_cost = Min(path->path.startup_cost,
+ subpath->startup_cost);
/*
* Apply parallel divisor to subpaths. Scale the number of rows
@@ -2633,36 +2633,36 @@ cost_append(AppendPath *apath, PlannerInfo *root)
* Also add the cost of partial paths to the total cost, but
* ignore non-partial paths for now.
*/
- if (i < apath->first_partial_path)
- apath->path.rows += subpath->rows / parallel_divisor;
+ if (i < path->first_partial_path)
+ path->path.rows += subpath->rows / parallel_divisor;
else
{
double subpath_parallel_divisor;
subpath_parallel_divisor = get_parallel_divisor(subpath);
- apath->path.rows += subpath->rows * (subpath_parallel_divisor /
- parallel_divisor);
- apath->path.total_cost += subpath->total_cost;
+ path->path.rows += subpath->rows * (subpath_parallel_divisor /
+ parallel_divisor);
+ path->path.total_cost += subpath->total_cost;
}
- apath->path.rows = clamp_row_est(apath->path.rows);
+ path->path.rows = clamp_row_est(path->path.rows);
i++;
}
/* Add cost for non-partial subpaths. */
- apath->path.total_cost +=
- append_nonpartial_cost(apath->subpaths,
- apath->first_partial_path,
- apath->path.parallel_workers);
+ path->path.total_cost +=
+ append_nonpartial_cost(path->subpaths,
+ path->first_partial_path,
+ path->path.parallel_workers);
}
/*
* Although Append does not do any selection or projection, it's not free;
* add a small per-tuple overhead.
*/
- apath->path.total_cost +=
- cpu_tuple_cost * APPEND_CPU_COST_MULTIPLIER * apath->path.rows;
+ path->path.total_cost +=
+ cpu_tuple_cost * APPEND_CPU_COST_MULTIPLIER * path->path.rows;
}
/*
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index cd8a3ef7c..ab4d8e201 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -311,7 +311,7 @@ static ModifyTable *make_modifytable(PlannerInfo *root, Plan *subplan,
List *updateColnosLists,
List *withCheckOptionLists, List *returningLists,
List *rowMarks, OnConflictExpr *onconflict,
- List *mergeActionList, int epqParam);
+ List *mergeActionLists, int epqParam);
static GatherMerge *create_gather_merge_plan(PlannerInfo *root,
GatherMergePath *best_path);
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 079bd0bfd..27accc389 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -3085,13 +3085,13 @@ extract_rollup_sets(List *groupingSets)
* gets implemented in one pass.)
*/
static List *
-reorder_grouping_sets(List *groupingsets, List *sortclause)
+reorder_grouping_sets(List *groupingSets, List *sortclause)
{
ListCell *lc;
List *previous = NIL;
List *result = NIL;
- foreach(lc, groupingsets)
+ foreach(lc, groupingSets)
{
List *candidate = (List *) lfirst(lc);
List *new_elems = list_difference_int(candidate, previous);
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 5012bfe14..6d5718ee4 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -75,7 +75,8 @@ static List *build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
static List *get_relation_statistics(RelOptInfo *rel, Relation relation);
static void set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
Relation relation);
-static PartitionScheme find_partition_scheme(PlannerInfo *root, Relation rel);
+static PartitionScheme find_partition_scheme(PlannerInfo *root,
+ Relation relation);
static void set_baserel_partition_key_exprs(Relation relation,
RelOptInfo *rel);
static void set_baserel_partition_constraint(Relation relation,
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 82f03fc9c..9920b56a8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -205,8 +205,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args,
static List *mergeTableFuncParameters(List *func_args, List *columns);
static TypeName *TableFuncTypeName(List *columns);
static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner);
-static RangeVar *makeRangeVarFromQualifiedName(char *name, List *rels,
- int location,
+static RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location,
core_yyscan_t yyscanner);
static void SplitColQualList(List *qualList,
List **constraintList, CollateClause **collClause,
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 061d0bcc5..202a38f81 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -67,7 +67,7 @@ static ParseNamespaceItem *transformRangeSubselect(ParseState *pstate,
static ParseNamespaceItem *transformRangeFunction(ParseState *pstate,
RangeFunction *r);
static ParseNamespaceItem *transformRangeTableFunc(ParseState *pstate,
- RangeTableFunc *t);
+ RangeTableFunc *rtf);
static TableSampleClause *transformRangeTableSample(ParseState *pstate,
RangeTableSample *rts);
static ParseNamespaceItem *getNSItemForSpecialRelationTypes(ParseState *pstate,
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 6d283006e..bd068bba0 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -139,7 +139,7 @@ static void transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd);
static List *transformPartitionRangeBounds(ParseState *pstate, List *blist,
Relation parent);
static void validateInfiniteBounds(ParseState *pstate, List *blist);
-static Const *transformPartitionBoundValue(ParseState *pstate, Node *con,
+static Const *transformPartitionBoundValue(ParseState *pstate, Node *val,
const char *colName, Oid colType, int32 colTypmod,
Oid partCollation);
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 57c9b5181..7f74ed212 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -104,7 +104,7 @@ static PartitionBoundInfo create_list_bounds(PartitionBoundSpec **boundspecs,
static PartitionBoundInfo create_range_bounds(PartitionBoundSpec **boundspecs,
int nparts, PartitionKey key, int **mapping);
static PartitionBoundInfo merge_list_bounds(FmgrInfo *partsupfunc,
- Oid *collations,
+ Oid *partcollation,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel,
JoinType jointype,
@@ -123,8 +123,8 @@ static void free_partition_map(PartitionMap *map);
static bool is_dummy_partition(RelOptInfo *rel, int part_index);
static int merge_matching_partitions(PartitionMap *outer_map,
PartitionMap *inner_map,
- int outer_part,
- int inner_part,
+ int outer_index,
+ int inner_index,
int *next_index);
static int process_outer_partition(PartitionMap *outer_map,
PartitionMap *inner_map,
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index de1184ad7..383bc4776 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -414,7 +414,7 @@ static void report_fork_failure_to_client(Port *port, int errnum);
static CAC_state canAcceptConnections(int backend_type);
static bool RandomCancelKey(int32 *cancel_key);
static void signal_child(pid_t pid, int signal);
-static bool SignalSomeChildren(int signal, int targets);
+static bool SignalSomeChildren(int signal, int target);
static void TerminateChildren(int signal);
#define SignalChildren(sig) SignalSomeChildren(sig, BACKEND_TYPE_ALL)
@@ -2598,9 +2598,9 @@ ConnCreate(int serverFd)
* to do here.
*/
static void
-ConnFree(Port *conn)
+ConnFree(Port *port)
{
- free(conn);
+ free(port);
}
diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index 1667d720b..ba2a872ac 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -62,13 +62,13 @@ static void DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
/* common function to decode tuples */
-static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tup);
+static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tuple);
/* helper functions for decoding transactions */
static inline bool FilterPrepare(LogicalDecodingContext *ctx,
TransactionId xid, const char *gid);
static bool DecodeTXNNeedSkip(LogicalDecodingContext *ctx,
- XLogRecordBuffer *buf, Oid dbId,
+ XLogRecordBuffer *buf, Oid txn_dbid,
RepOriginId origin_id);
/*
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index eaca406d3..3396bfbba 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -312,7 +312,7 @@ static inline void cleanup_subxact_info(void);
* Serialize and deserialize changes for a toplevel transaction.
*/
static void stream_cleanup_files(Oid subid, TransactionId xid);
-static void stream_open_file(Oid subid, TransactionId xid, bool first);
+static void stream_open_file(Oid subid, TransactionId xid, bool first_segment);
static void stream_write_change(char action, StringInfo s);
static void stream_close_file(void);
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 62e0ffecd..03b13ae67 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -44,7 +44,7 @@ static void pgoutput_begin_txn(LogicalDecodingContext *ctx,
static void pgoutput_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pgoutput_change(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, Relation rel,
+ ReorderBufferTXN *txn, Relation relation,
ReorderBufferChange *change);
static void pgoutput_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, int nrelations, Relation relations[],
@@ -212,7 +212,7 @@ typedef struct PGOutputTxnData
/* Map used to remember which relation schemas we sent. */
static HTAB *RelationSyncCache = NULL;
-static void init_rel_sync_cache(MemoryContext decoding_context);
+static void init_rel_sync_cache(MemoryContext cachectx);
static void cleanup_rel_sync_cache(TransactionId xid, bool is_commit);
static RelationSyncEntry *get_rel_sync_entry(PGOutputData *data,
Relation relation);
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 8fec1cb4a..0bd003118 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -108,7 +108,7 @@ static void ReplicationSlotDropPtr(ReplicationSlot *slot);
/* internal persistency functions */
static void RestoreSlotFromDisk(const char *name);
static void CreateSlotOnDisk(ReplicationSlot *slot);
-static void SaveSlotToPath(ReplicationSlot *slot, const char *path, int elevel);
+static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel);
/*
* Report shared-memory space needed by ReplicationSlotsShmemInit.
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index ee05e230e..ab97e71dd 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -83,7 +83,7 @@ static void statext_store(Oid statOid, bool inh,
MVNDistinct *ndistinct, MVDependencies *dependencies,
MCVList *mcv, Datum exprs, VacAttrStats **stats);
static int statext_compute_stattarget(int stattarget,
- int natts, VacAttrStats **stats);
+ int nattrs, VacAttrStats **stats);
/* Information needed to analyze a single simple expression. */
typedef struct AnlExprData
@@ -99,7 +99,7 @@ static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs);
static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
static AnlExprData *build_expr_data(List *exprs, int stattarget);
-static StatsBuildData *make_build_data(Relation onerel, StatExtEntry *stat,
+static StatsBuildData *make_build_data(Relation rel, StatExtEntry *stat,
int numrows, HeapTuple *rows,
VacAttrStats **stats, int stattarget);
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e898ffad7..5b0e531f9 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -459,7 +459,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
)
-static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence,
+static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence,
ForkNumber forkNum, BlockNumber blockNum,
ReadBufferMode mode, BufferAccessStrategy strategy,
bool *hit);
@@ -493,7 +493,7 @@ static void RelationCopyStorageUsingBuffer(RelFileLocator srclocator,
static void AtProcExit_Buffers(int code, Datum arg);
static void CheckForBufferLeaks(void);
static int rlocator_comparator(const void *p1, const void *p2);
-static inline int buffertag_comparator(const BufferTag *a, const BufferTag *b);
+static inline int buffertag_comparator(const BufferTag *ba, const BufferTag *bb);
static inline int ckpt_buforder_comparator(const CkptSortItem *a, const CkptSortItem *b);
static int ts_ckpt_progress_comparator(Datum a, Datum b, void *arg);
diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c
index 56b88594c..b0b4eeb3b 100644
--- a/src/backend/storage/file/buffile.c
+++ b/src/backend/storage/file/buffile.c
@@ -104,7 +104,7 @@ static void extendBufFile(BufFile *file);
static void BufFileLoadBuffer(BufFile *file);
static void BufFileDumpBuffer(BufFile *file);
static void BufFileFlush(BufFile *file);
-static File MakeNewFileSetSegment(BufFile *file, int segment);
+static File MakeNewFileSetSegment(BufFile *buffile, int segment);
/*
* Create BufFile and perform the common initialization.
diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c
index 005def56d..a6b053310 100644
--- a/src/backend/storage/freespace/freespace.c
+++ b/src/backend/storage/freespace/freespace.c
@@ -111,7 +111,7 @@ static int fsm_set_and_search(Relation rel, FSMAddress addr, uint16 slot,
static BlockNumber fsm_search(Relation rel, uint8 min_cat);
static uint8 fsm_vacuum_page(Relation rel, FSMAddress addr,
BlockNumber start, BlockNumber end,
- bool *eof);
+ bool *eof_p);
/******** Public API ********/
diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c
index 9d86bbe87..a360325f8 100644
--- a/src/backend/storage/ipc/dsm.c
+++ b/src/backend/storage/ipc/dsm.c
@@ -1045,7 +1045,7 @@ dsm_unpin_segment(dsm_handle handle)
* Find an existing mapping for a shared memory segment, if there is one.
*/
dsm_segment *
-dsm_find_mapping(dsm_handle h)
+dsm_find_mapping(dsm_handle handle)
{
dlist_iter iter;
dsm_segment *seg;
@@ -1053,7 +1053,7 @@ dsm_find_mapping(dsm_handle h)
dlist_foreach(iter, &dsm_segment_list)
{
seg = dlist_container(dsm_segment, node, iter.cur);
- if (seg->handle == h)
+ if (seg->handle == handle)
return seg;
}
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 0555b02a8..382f4cfb7 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -343,7 +343,7 @@ static bool KnownAssignedXidExists(TransactionId xid);
static void KnownAssignedXidsRemove(TransactionId xid);
static void KnownAssignedXidsRemoveTree(TransactionId xid, int nsubxids,
TransactionId *subxids);
-static void KnownAssignedXidsRemovePreceding(TransactionId xid);
+static void KnownAssignedXidsRemovePreceding(TransactionId removeXid);
static int KnownAssignedXidsGet(TransactionId *xarray, TransactionId xmax);
static int KnownAssignedXidsGetAndSetXmin(TransactionId *xarray,
TransactionId *xmin,
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index 38317edaf..d274c9b1d 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -1913,13 +1913,13 @@ LWLockReleaseAll(void)
* This is meant as debug support only.
*/
bool
-LWLockHeldByMe(LWLock *l)
+LWLockHeldByMe(LWLock *lock)
{
int i;
for (i = 0; i < num_held_lwlocks; i++)
{
- if (held_lwlocks[i].lock == l)
+ if (held_lwlocks[i].lock == lock)
return true;
}
return false;
@@ -1931,14 +1931,14 @@ LWLockHeldByMe(LWLock *l)
* This is meant as debug support only.
*/
bool
-LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride)
+LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride)
{
char *held_lock_addr;
char *begin;
char *end;
int i;
- begin = (char *) l;
+ begin = (char *) lock;
end = begin + nlocks * stride;
for (i = 0; i < num_held_lwlocks; i++)
{
@@ -1957,13 +1957,13 @@ LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride)
* This is meant as debug support only.
*/
bool
-LWLockHeldByMeInMode(LWLock *l, LWLockMode mode)
+LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
{
int i;
for (i = 0; i < num_held_lwlocks; i++)
{
- if (held_lwlocks[i].lock == l && held_lwlocks[i].mode == mode)
+ if (held_lwlocks[i].lock == lock && held_lwlocks[i].mode == mode)
return true;
}
return false;
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index 562ac5b43..5f2a4805d 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -446,7 +446,7 @@ static void SerialSetActiveSerXmin(TransactionId xid);
static uint32 predicatelock_hash(const void *key, Size keysize);
static void SummarizeOldestCommittedSxact(void);
-static Snapshot GetSafeSnapshot(Snapshot snapshot);
+static Snapshot GetSafeSnapshot(Snapshot origSnapshot);
static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot,
VirtualTransactionId *sourcevxid,
int sourcepid);
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 3deac496e..a515bb36a 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -121,7 +121,7 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */
/* local routines */
-static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum,
+static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum,
bool isRedo);
static MdfdVec *mdopenfork(SMgrRelation reln, ForkNumber forknum, int behavior);
static void register_dirty_segment(SMgrRelation reln, ForkNumber forknum,
@@ -135,9 +135,9 @@ static void _fdvec_resize(SMgrRelation reln,
int nseg);
static char *_mdfd_segpath(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno);
-static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno, int oflags);
-static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber blkno, bool skipFsync, int behavior);
static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum,
MdfdVec *seg);
@@ -160,7 +160,7 @@ mdinit(void)
* Note: this will return true for lingering files, with pending deletions
*/
bool
-mdexists(SMgrRelation reln, ForkNumber forkNum)
+mdexists(SMgrRelation reln, ForkNumber forknum)
{
/*
* Close it first, to ensure that we notice if the fork has been unlinked
@@ -168,9 +168,9 @@ mdexists(SMgrRelation reln, ForkNumber forkNum)
* which already closes relations when dropping them.
*/
if (!InRecovery)
- mdclose(reln, forkNum);
+ mdclose(reln, forknum);
- return (mdopenfork(reln, forkNum, EXTENSION_RETURN_NULL) != NULL);
+ return (mdopenfork(reln, forknum, EXTENSION_RETURN_NULL) != NULL);
}
/*
@@ -179,16 +179,16 @@ mdexists(SMgrRelation reln, ForkNumber forkNum)
* If isRedo is true, it's okay for the relation to exist already.
*/
void
-mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
+mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
{
MdfdVec *mdfd;
char *path;
File fd;
- if (isRedo && reln->md_num_open_segs[forkNum] > 0)
+ if (isRedo && reln->md_num_open_segs[forknum] > 0)
return; /* created and opened already... */
- Assert(reln->md_num_open_segs[forkNum] == 0);
+ Assert(reln->md_num_open_segs[forknum] == 0);
/*
* We may be using the target table space for the first time in this
@@ -203,7 +203,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
reln->smgr_rlocator.locator.dbOid,
isRedo);
- path = relpath(reln->smgr_rlocator, forkNum);
+ path = relpath(reln->smgr_rlocator, forknum);
fd = PathNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
@@ -225,8 +225,8 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
pfree(path);
- _fdvec_resize(reln, forkNum, 1);
- mdfd = &reln->md_seg_fds[forkNum][0];
+ _fdvec_resize(reln, forknum, 1);
+ mdfd = &reln->md_seg_fds[forknum][0];
mdfd->mdfd_vfd = fd;
mdfd->mdfd_segno = 0;
}
@@ -237,7 +237,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
* Note that we're passed a RelFileLocatorBackend --- by the time this is called,
* there won't be an SMgrRelation hashtable entry anymore.
*
- * forkNum can be a fork number to delete a specific fork, or InvalidForkNumber
+ * forknum can be a fork number to delete a specific fork, or InvalidForkNumber
* to delete all forks.
*
* For regular relations, we don't unlink the first segment file of the rel,
@@ -278,16 +278,16 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
* we are usually not in a transaction anymore when this is called.
*/
void
-mdunlink(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
/* Now do the per-fork work */
- if (forkNum == InvalidForkNumber)
+ if (forknum == InvalidForkNumber)
{
- for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++)
- mdunlinkfork(rlocator, forkNum, isRedo);
+ for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
+ mdunlinkfork(rlocator, forknum, isRedo);
}
else
- mdunlinkfork(rlocator, forkNum, isRedo);
+ mdunlinkfork(rlocator, forknum, isRedo);
}
/*
@@ -315,18 +315,18 @@ do_truncate(const char *path)
}
static void
-mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
char *path;
int ret;
BlockNumber segno = 0;
- path = relpath(rlocator, forkNum);
+ path = relpath(rlocator, forknum);
/*
* Delete or truncate the first segment.
*/
- if (isRedo || forkNum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
+ if (isRedo || forknum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
{
if (!RelFileLocatorBackendIsTemp(rlocator))
{
@@ -334,7 +334,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
ret = do_truncate(path);
/* Forget any pending sync requests for the first segment */
- register_forget_request(rlocator, forkNum, 0 /* first seg */ );
+ register_forget_request(rlocator, forknum, 0 /* first seg */ );
}
else
ret = 0;
@@ -367,7 +367,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
*/
if (!IsBinaryUpgrade)
{
- register_unlink_segment(rlocator, forkNum, 0 /* first seg */ );
+ register_unlink_segment(rlocator, forknum, 0 /* first seg */ );
++segno;
}
}
@@ -403,7 +403,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
* Forget any pending sync requests for this segment before we
* try to unlink.
*/
- register_forget_request(rlocator, forkNum, segno);
+ register_forget_request(rlocator, forknum, segno);
}
if (unlink(segpath) < 0)
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 43fff50d4..350039cc8 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -32,7 +32,7 @@
#include "utils/memutils.h"
#include "utils/tzparser.h"
-static int DecodeNumber(int flen, char *field, bool haveTextMonth,
+static int DecodeNumber(int flen, char *str, bool haveTextMonth,
int fmask, int *tmask,
struct pg_tm *tm, fsec_t *fsec, bool *is2digits);
static int DecodeNumberField(int len, char *str,
@@ -281,26 +281,26 @@ static const datetkn *abbrevcache[MAXDATEFIELDS] = {NULL};
*/
int
-date2j(int y, int m, int d)
+date2j(int year, int month, int day)
{
int julian;
int century;
- if (m > 2)
+ if (month > 2)
{
- m += 1;
- y += 4800;
+ month += 1;
+ year += 4800;
}
else
{
- m += 13;
- y += 4799;
+ month += 13;
+ year += 4799;
}
- century = y / 100;
- julian = y * 365 - 32167;
- julian += y / 4 - century + century / 4;
- julian += 7834 * m / 256 + d;
+ century = year / 100;
+ julian = year * 365 - 32167;
+ julian += year / 4 - century + century / 4;
+ julian += 7834 * month / 256 + day;
return julian;
} /* date2j() */
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f1b632ef3..d78002b90 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -90,7 +90,7 @@ static inline float8 line_sl(LINE *line);
static inline float8 line_invsl(LINE *line);
static bool line_interpt_line(Point *result, LINE *l1, LINE *l2);
static bool line_contain_point(LINE *line, Point *point);
-static float8 line_closept_point(Point *result, LINE *line, Point *pt);
+static float8 line_closept_point(Point *result, LINE *line, Point *point);
/* Routines for line segments */
static inline void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
@@ -98,8 +98,8 @@ static inline float8 lseg_sl(LSEG *lseg);
static inline float8 lseg_invsl(LSEG *lseg);
static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line);
static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2);
-static int lseg_crossing(float8 x, float8 y, float8 px, float8 py);
-static bool lseg_contain_point(LSEG *lseg, Point *point);
+static int lseg_crossing(float8 x, float8 y, float8 prev_x, float8 prev_y);
+static bool lseg_contain_point(LSEG *lseg, Point *pt);
static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt);
static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line);
static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg);
@@ -115,7 +115,7 @@ static bool box_contain_point(BOX *box, Point *point);
static bool box_contain_box(BOX *contains_box, BOX *contained_box);
static bool box_contain_lseg(BOX *box, LSEG *lseg);
static bool box_interpt_lseg(Point *result, BOX *box, LSEG *lseg);
-static float8 box_closept_point(Point *result, BOX *box, Point *point);
+static float8 box_closept_point(Point *result, BOX *box, Point *pt);
static float8 box_closept_lseg(Point *result, BOX *box, LSEG *lseg);
/* Routines for circles */
diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c
index e02fc3725..8e671b9fa 100644
--- a/src/backend/utils/adt/like.c
+++ b/src/backend/utils/adt/like.c
@@ -33,11 +33,11 @@
static int SB_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
-static text *SB_do_like_escape(text *, text *);
+static text *SB_do_like_escape(text *pat, text *esc);
static int MB_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
-static text *MB_do_like_escape(text *, text *);
+static text *MB_do_like_escape(text *pat, text *esc);
static int UTF8_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 920a63b00..85ee9ec42 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -499,7 +499,7 @@ static void zero_var(NumericVar *var);
static const char *set_var_from_str(const char *str, const char *cp,
NumericVar *dest);
-static void set_var_from_num(Numeric value, NumericVar *dest);
+static void set_var_from_num(Numeric num, NumericVar *dest);
static void init_var_from_num(Numeric num, NumericVar *dest);
static void set_var_from_var(const NumericVar *value, NumericVar *dest);
static char *get_str_from_var(const NumericVar *var);
@@ -510,7 +510,7 @@ static void numericvar_deserialize(StringInfo buf, NumericVar *var);
static Numeric duplicate_numeric(Numeric num);
static Numeric make_result(const NumericVar *var);
-static Numeric make_result_opt_error(const NumericVar *var, bool *error);
+static Numeric make_result_opt_error(const NumericVar *var, bool *have_error);
static void apply_typmod(NumericVar *var, int32 typmod);
static void apply_typmod_special(Numeric num, int32 typmod);
@@ -591,7 +591,7 @@ static void compute_bucket(Numeric operand, Numeric bound1, Numeric bound2,
const NumericVar *count_var, bool reversed_bounds,
NumericVar *result_var);
-static void accum_sum_add(NumericSumAccum *accum, const NumericVar *var1);
+static void accum_sum_add(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_rescale(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_carry(NumericSumAccum *accum);
static void accum_sum_reset(NumericSumAccum *accum);
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index aa4c53e0a..b09cb4905 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -55,14 +55,14 @@ typedef struct RangeIOData
static RangeIOData *get_range_io_data(FunctionCallInfo fcinfo, Oid rngtypid,
IOFuncSelector func);
static char range_parse_flags(const char *flags_str);
-static void range_parse(const char *input_str, char *flags, char **lbound_str,
+static void range_parse(const char *string, char *flags, char **lbound_str,
char **ubound_str);
static const char *range_parse_bound(const char *string, const char *ptr,
char **bound_str, bool *infinite);
static char *range_deparse(char flags, const char *lbound_str,
const char *ubound_str);
static char *range_bound_escape(const char *value);
-static Size datum_compute_size(Size sz, Datum datum, bool typbyval,
+static Size datum_compute_size(Size data_length, Datum val, bool typbyval,
char typalign, int16 typlen, char typstorage);
static Pointer datum_write(Pointer ptr, Datum datum, bool typbyval,
char typalign, int16 typlen, char typstorage);
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 51b3fdc9a..1d503e7e0 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -196,7 +196,7 @@ static void ri_GenerateQual(StringInfo buf,
Oid opoid,
const char *rightop, Oid rightoptype);
static void ri_GenerateQualCollation(StringInfo buf, Oid collation);
-static int ri_NullCheck(TupleDesc tupdesc, TupleTableSlot *slot,
+static int ri_NullCheck(TupleDesc tupDesc, TupleTableSlot *slot,
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
static void ri_BuildQueryKey(RI_QueryKey *key,
const RI_ConstraintInfo *riinfo,
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 021b760f4..9799647e1 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -2034,9 +2034,9 @@ time2t(const int hour, const int min, const int sec, const fsec_t fsec)
}
static Timestamp
-dt2local(Timestamp dt, int tz)
+dt2local(Timestamp dt, int timezone)
{
- dt -= (tz * USECS_PER_SEC);
+ dt -= (timezone * USECS_PER_SEC);
return dt;
}
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 606088cdf..d32cb1143 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -121,7 +121,7 @@ static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt);
static void xml_errorHandler(void *data, xmlErrorPtr error);
static void xml_ereport_by_code(int level, int sqlcode,
- const char *msg, int errcode);
+ const char *msg, int code);
static void chopStringInfoNewlines(StringInfo str);
static void appendStringInfoLineSeparator(StringInfo str);
diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c
index e7345e141..626656860 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -137,7 +137,7 @@ static RelMapFile pending_local_updates;
/* non-export function prototypes */
static void apply_map_update(RelMapFile *map, Oid relationId,
- RelFileNumber filenumber, bool add_okay);
+ RelFileNumber fileNumber, bool add_okay);
static void merge_map_updates(RelMapFile *map, const RelMapFile *updates,
bool add_okay);
static void load_relmap_file(bool shared, bool lock_held);
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 96c694da8..eb724a9d7 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -179,7 +179,7 @@ static const char *err_gettext(const char *str) pg_attribute_format_arg(1);
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip);
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str);
static void write_console(const char *line, int len);
-static const char *process_log_prefix_padding(const char *p, int *padding);
+static const char *process_log_prefix_padding(const char *p, int *ppadding);
static void log_line_prefix(StringInfo buf, ErrorData *edata);
static void send_message_to_server_log(ErrorData *edata);
static void send_message_to_frontend(ErrorData *edata);
diff --git a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
index 93493d415..25791e23e 100644
--- a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
+++ b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
@@ -54,8 +54,8 @@ static int sjis2mic(const unsigned char *sjis, unsigned char *p, int len, bool n
static int mic2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_jp2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
static int mic2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int euc_jp2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int sjis2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
+static int euc_jp2sjis(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int sjis2euc_jp(const unsigned char *sjis, unsigned char *p, int len, bool noError);
Datum
euc_jp_to_sjis(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
index e00a2ca41..88e0deb5e 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
@@ -41,7 +41,7 @@ PG_FUNCTION_INFO_V1(mic_to_big5);
*/
static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError);
-static int big52euc_tw(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index b11d609bb..8c2e08fad 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -225,7 +225,7 @@ static void reapply_stacked_values(struct config_generic *variable,
Oid cursrole);
static bool validate_option_array_item(const char *name, const char *value,
bool skipIfNoPermissions);
-static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head_p);
+static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head);
static void replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
const char *name, const char *value);
static bool valid_custom_variable_name(const char *name);
diff --git a/src/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c
index a67487e5f..6e75acda2 100644
--- a/src/backend/utils/misc/queryjumble.c
+++ b/src/backend/utils/misc/queryjumble.c
@@ -45,7 +45,8 @@ int compute_query_id = COMPUTE_QUERY_ID_AUTO;
/* True when compute_query_id is ON, or AUTO and a module requests them */
bool query_id_enabled = false;
-static uint64 compute_utility_query_id(const char *str, int query_location, int query_len);
+static uint64 compute_utility_query_id(const char *query_text,
+ int query_location, int query_len);
static void AppendJumble(JumbleState *jstate,
const unsigned char *item, Size size);
static void JumbleQueryInternal(JumbleState *jstate, Query *query);
diff --git a/src/backend/utils/sort/tuplesortvariants.c b/src/backend/utils/sort/tuplesortvariants.c
index 7ad4429ad..afa5bdbf0 100644
--- a/src/backend/utils/sort/tuplesortvariants.c
+++ b/src/backend/utils/sort/tuplesortvariants.c
@@ -56,7 +56,7 @@ static int comparetup_cluster(const SortTuple *a, const SortTuple *b,
static void writetup_cluster(Tuplesortstate *state, LogicalTape *tape,
SortTuple *stup);
static void readtup_cluster(Tuplesortstate *state, SortTuple *stup,
- LogicalTape *tape, unsigned int len);
+ LogicalTape *tape, unsigned int tuplen);
static int comparetup_index_btree(const SortTuple *a, const SortTuple *b,
Tuplesortstate *state);
static int comparetup_index_hash(const SortTuple *a, const SortTuple *b,
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 9b504c974..f1f2ddac1 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -680,9 +680,9 @@ FreeSnapshot(Snapshot snapshot)
* with active refcount=1. Otherwise, only increment the refcount.
*/
void
-PushActiveSnapshot(Snapshot snap)
+PushActiveSnapshot(Snapshot snapshot)
{
- PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
+ PushActiveSnapshotWithLevel(snapshot, GetCurrentTransactionNestLevel());
}
/*
@@ -694,11 +694,11 @@ PushActiveSnapshot(Snapshot snap)
* must not be deeper than the current top of the snapshot stack.
*/
void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
+PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
{
ActiveSnapshotElt *newactive;
- Assert(snap != InvalidSnapshot);
+ Assert(snapshot != InvalidSnapshot);
Assert(ActiveSnapshot == NULL || snap_level >= ActiveSnapshot->as_level);
newactive = MemoryContextAlloc(TopTransactionContext, sizeof(ActiveSnapshotElt));
@@ -707,10 +707,11 @@ PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
* Checking SecondarySnapshot is probably useless here, but it seems
* better to be sure.
*/
- if (snap == CurrentSnapshot || snap == SecondarySnapshot || !snap->copied)
- newactive->as_snap = CopySnapshot(snap);
+ if (snapshot == CurrentSnapshot || snapshot == SecondarySnapshot ||
+ !snapshot->copied)
+ newactive->as_snap = CopySnapshot(snapshot);
else
- newactive->as_snap = snap;
+ newactive->as_snap = snapshot;
newactive->as_next = ActiveSnapshot;
newactive->as_level = snap_level;
@@ -2119,20 +2120,20 @@ HistoricSnapshotGetTupleCids(void)
* SerializedSnapshotData.
*/
Size
-EstimateSnapshotSpace(Snapshot snap)
+EstimateSnapshotSpace(Snapshot snapshot)
{
Size size;
- Assert(snap != InvalidSnapshot);
- Assert(snap->snapshot_type == SNAPSHOT_MVCC);
+ Assert(snapshot != InvalidSnapshot);
+ Assert(snapshot->snapshot_type == SNAPSHOT_MVCC);
/* We allocate any XID arrays needed in the same palloc block. */
size = add_size(sizeof(SerializedSnapshotData),
- mul_size(snap->xcnt, sizeof(TransactionId)));
- if (snap->subxcnt > 0 &&
- (!snap->suboverflowed || snap->takenDuringRecovery))
+ mul_size(snapshot->xcnt, sizeof(TransactionId)));
+ if (snapshot->subxcnt > 0 &&
+ (!snapshot->suboverflowed || snapshot->takenDuringRecovery))
size = add_size(size,
- mul_size(snap->subxcnt, sizeof(TransactionId)));
+ mul_size(snapshot->subxcnt, sizeof(TransactionId)));
return size;
}
diff --git a/src/fe_utils/cancel.c b/src/fe_utils/cancel.c
index 8d9ea19de..32195cb70 100644
--- a/src/fe_utils/cancel.c
+++ b/src/fe_utils/cancel.c
@@ -183,9 +183,9 @@ handle_sigint(SIGNAL_ARGS)
* Register query cancellation callback for SIGINT.
*/
void
-setup_cancel_handler(void (*callback) (void))
+setup_cancel_handler(void (*query_cancel_callback) (void))
{
- cancel_callback = callback;
+ cancel_callback = query_cancel_callback;
cancel_sent_msg = _("Cancel request sent\n");
cancel_not_sent_msg = _("Could not send cancel request: ");
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 28f22b25b..f61a04305 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -275,7 +275,7 @@ static char *escape_quotes_bki(const char *src);
static int locale_date_order(const char *locale);
static void check_locale_name(int category, const char *locale,
char **canonname);
-static bool check_locale_encoding(const char *locale, int encoding);
+static bool check_locale_encoding(const char *locale, int user_enc);
static void setlocales(void);
static void usage(const char *progname);
void setup_pgdata(void);
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index fea35e4b1..9ce4b11f1 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -197,7 +197,7 @@ static void append_btree_pattern(PatternInfoArray *pia, const char *pattern,
static void compile_database_list(PGconn *conn, SimplePtrList *databases,
const char *initial_dbname);
static void compile_relation_list_one_db(PGconn *conn, SimplePtrList *relations,
- const DatabaseInfo *datinfo,
+ const DatabaseInfo *dat,
uint64 *pagecount);
#define log_no_match(...) do { \
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index 5c22c914b..6a0d0758e 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -63,7 +63,7 @@ static DIR *get_destination_dir(char *dest_folder);
static void close_destination_dir(DIR *dest_dir, char *dest_folder);
static XLogRecPtr FindStreamingStart(uint32 *tli);
static void StreamLog(void);
-static bool stop_streaming(XLogRecPtr segendpos, uint32 timeline,
+static bool stop_streaming(XLogRecPtr xlogpos, uint32 timeline,
bool segment_finished);
static void
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 8638f81f3..1537ef47e 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -44,7 +44,7 @@ extern bool RunIdentifySystem(PGconn *conn, char **sysid,
extern void AppendPlainCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
- char *option_value);
+ char *option_name);
extern void AppendStringCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
char *option_name, char *option_value);
diff --git a/src/bin/pg_basebackup/walmethods.h b/src/bin/pg_basebackup/walmethods.h
index 76530dc94..06139f2f0 100644
--- a/src/bin/pg_basebackup/walmethods.h
+++ b/src/bin/pg_basebackup/walmethods.h
@@ -96,11 +96,11 @@ struct WalWriteMethod
* not all those required for pg_receivewal)
*/
WalWriteMethod *CreateWalDirectoryMethod(const char *basedir,
- pg_compress_algorithm compression_algo,
- int compression, bool sync);
+ pg_compress_algorithm compression_algorithm,
+ int compression_level, bool sync);
WalWriteMethod *CreateWalTarMethod(const char *tarbase,
- pg_compress_algorithm compression_algo,
- int compression, bool sync);
+ pg_compress_algorithm compression_algorithm,
+ int compression_level, bool sync);
/* Cleanup routines for previously-created methods */
void FreeWalDirectoryMethod(void);
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
index 54a853bd4..e6277c463 100644
--- a/src/bin/pg_rewind/file_ops.h
+++ b/src/bin/pg_rewind/file_ops.h
@@ -17,8 +17,8 @@ extern void write_target_range(char *buf, off_t begin, size_t size);
extern void close_target_file(void);
extern void remove_target_file(const char *path, bool missing_ok);
extern void truncate_target_file(const char *path, off_t newsize);
-extern void create_target(file_entry_t *t);
-extern void remove_target(file_entry_t *t);
+extern void create_target(file_entry_t *entry);
+extern void remove_target(file_entry_t *entry);
extern void sync_target_dir(void);
extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h
index 8b4b50a33..80c276285 100644
--- a/src/bin/pg_rewind/pg_rewind.h
+++ b/src/bin/pg_rewind/pg_rewind.h
@@ -37,7 +37,7 @@ extern uint64 fetch_done;
extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
int tliIndex, XLogRecPtr endpoint,
const char *restoreCommand);
-extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
+extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
int tliIndex,
XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
XLogRecPtr *lastchkptredo,
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 53ea348e2..f18cf9712 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -23,7 +23,7 @@ static void free_db_and_rel_infos(DbInfoArr *db_arr);
static void get_db_infos(ClusterInfo *cluster);
static void get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo);
static void free_rel_infos(RelInfoArr *rel_arr);
-static void print_db_infos(DbInfoArr *dbinfo);
+static void print_db_infos(DbInfoArr *db_arr);
static void print_rel_infos(RelInfoArr *rel_arr);
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index 60c3c8dd6..e379aa466 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -358,7 +358,7 @@ void generate_old_dump(void);
#define EXEC_PSQL_ARGS "--echo-queries --set ON_ERROR_STOP=on --no-psqlrc --dbname=template1"
-bool exec_prog(const char *log_file, const char *opt_log_file,
+bool exec_prog(const char *log_filename, const char *opt_log_file,
bool report_error, bool exit_on_error, const char *fmt,...) pg_attribute_printf(5, 6);
void verify_directories(void);
bool pid_lock_file_exists(const char *datadir);
diff --git a/src/bin/pg_upgrade/relfilenumber.c b/src/bin/pg_upgrade/relfilenumber.c
index c3c7402ef..c3f3d6bc0 100644
--- a/src/bin/pg_upgrade/relfilenumber.c
+++ b/src/bin/pg_upgrade/relfilenumber.c
@@ -16,7 +16,7 @@
#include "pg_upgrade.h"
static void transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace);
-static void transfer_relfile(FileNameMap *map, const char *suffix, bool vm_must_add_frozenbit);
+static void transfer_relfile(FileNameMap *map, const char *type_suffix, bool vm_must_add_frozenbit);
/*
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index 63d02719a..2c0d285de 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -134,7 +134,7 @@ static void verify_backup_file(verifier_context *context,
static void report_extra_backup_files(verifier_context *context);
static void verify_backup_checksums(verifier_context *context);
static void verify_file_checksum(verifier_context *context,
- manifest_file *m, char *pathname);
+ manifest_file *m, char *fullpath);
static void parse_required_wal(verifier_context *context,
char *pg_waldump_path,
char *wal_directory,
diff --git a/src/bin/pg_waldump/compat.c b/src/bin/pg_waldump/compat.c
index 6a3386e97..38e0036e2 100644
--- a/src/bin/pg_waldump/compat.c
+++ b/src/bin/pg_waldump/compat.c
@@ -46,19 +46,19 @@ timestamptz_to_time_t(TimestampTz t)
* moved into src/common. That's a large project though.
*/
const char *
-timestamptz_to_str(TimestampTz dt)
+timestamptz_to_str(TimestampTz t)
{
static char buf[MAXDATELEN + 1];
char ts[MAXDATELEN + 1];
char zone[MAXDATELEN + 1];
- time_t result = (time_t) timestamptz_to_time_t(dt);
+ time_t result = (time_t) timestamptz_to_time_t(t);
struct tm *ltime = localtime(&result);
strftime(ts, sizeof(ts), "%Y-%m-%d %H:%M:%S", ltime);
strftime(zone, sizeof(zone), "%Z", ltime);
snprintf(buf, sizeof(buf), "%s.%06d %s",
- ts, (int) (dt % USECS_PER_SEC), zone);
+ ts, (int) (t % USECS_PER_SEC), zone);
return buf;
}
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index abbdc443a..40903bc16 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -158,10 +158,10 @@ extern char *expr_scanner_get_substring(PsqlScanState state,
extern int expr_scanner_get_lineno(PsqlScanState state, int offset);
extern void syntax_error(const char *source, int lineno, const char *line,
- const char *cmd, const char *msg,
- const char *more, int col) pg_attribute_noreturn();
+ const char *command, const char *msg,
+ const char *more, int column) pg_attribute_noreturn();
-extern bool strtoint64(const char *str, bool errorOK, int64 *pi);
-extern bool strtodouble(const char *str, bool errorOK, double *pd);
+extern bool strtoint64(const char *str, bool errorOK, int64 *result);
+extern bool strtodouble(const char *str, bool errorOK, double *dv);
#endif /* PGBENCH_H */
diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h
index 7872c71f5..bd051e09c 100644
--- a/src/bin/psql/describe.h
+++ b/src/bin/psql/describe.h
@@ -127,16 +127,16 @@ bool describeSubscriptions(const char *pattern, bool verbose);
/* \dAc */
extern bool listOperatorClasses(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAf */
extern bool listOperatorFamilies(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAo */
-extern bool listOpFamilyOperators(const char *accessMethod_pattern,
+extern bool listOpFamilyOperators(const char *access_method_pattern,
const char *family_pattern, bool verbose);
/* \dAp */
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 84a1be72f..9d91ad87c 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -18,7 +18,7 @@
extern void splitTableColumnsSpec(const char *spec, int encoding,
char **table, const char **columns);
-extern void appendQualifiedRelation(PQExpBuffer buf, const char *name,
+extern void appendQualifiedRelation(PQExpBuffer buf, const char *spec,
PGconn *conn, bool echo);
extern bool yesno_prompt(const char *question);
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 917b19e0e..746e9b4f1 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -381,7 +381,7 @@ static void closePGconn(PGconn *conn);
static void release_conn_addrinfo(PGconn *conn);
static void sendTerminateConn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
-static PQconninfoOption *parse_connection_string(const char *conninfo,
+static PQconninfoOption *parse_connection_string(const char *connstr,
PQExpBuffer errorMessage, bool use_defaults);
static int uri_prefix_length(const char *connstr);
static bool recognized_connection_string(const char *connstr);
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index bb874f7f5..ca0b184af 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2808,7 +2808,7 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* PQgetline - gets a newline-terminated string from the backend.
*
* Chiefly here so that applications can use "COPY <rel> to stdout"
- * and read the output string. Returns a null-terminated string in s.
+ * and read the output string. Returns a null-terminated string in 'string'.
*
* XXX this routine is now deprecated, because it can't handle binary data.
* If called during a COPY BINARY we return EOF.
@@ -2828,11 +2828,11 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* 1 in other cases (i.e., the buffer was filled before \n is reached)
*/
int
-PQgetline(PGconn *conn, char *s, int maxlen)
+PQgetline(PGconn *conn, char *string, int maxlen)
{
- if (!s || maxlen <= 0)
+ if (!string || maxlen <= 0)
return EOF;
- *s = '\0';
+ *string = '\0';
/* maxlen must be at least 3 to hold the \. terminator! */
if (maxlen < 3)
return EOF;
@@ -2840,7 +2840,7 @@ PQgetline(PGconn *conn, char *s, int maxlen)
if (!conn)
return EOF;
- return pqGetline3(conn, s, maxlen);
+ return pqGetline3(conn, string, maxlen);
}
/*
@@ -2892,9 +2892,9 @@ PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
* send failure.
*/
int
-PQputline(PGconn *conn, const char *s)
+PQputline(PGconn *conn, const char *string)
{
- return PQputnbytes(conn, s, strlen(s));
+ return PQputnbytes(conn, string, strlen(string));
}
/*
diff --git a/src/interfaces/libpq/fe-secure-common.h b/src/interfaces/libpq/fe-secure-common.h
index d18db7138..415a93898 100644
--- a/src/interfaces/libpq/fe-secure-common.h
+++ b/src/interfaces/libpq/fe-secure-common.h
@@ -22,8 +22,8 @@ extern int pq_verify_peer_name_matches_certificate_name(PGconn *conn,
const char *namedata, size_t namelen,
char **store_name);
extern int pq_verify_peer_name_matches_certificate_ip(PGconn *conn,
- const unsigned char *addrdata,
- size_t addrlen,
+ const unsigned char *ipdata,
+ size_t iplen,
char **store_name);
extern bool pq_verify_peer_name_matches_certificate(PGconn *conn);
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index 3798bb3f1..aea466173 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -68,14 +68,14 @@
static int verify_cb(int ok, X509_STORE_CTX *ctx);
static int openssl_verify_peer_name_matches_certificate_name(PGconn *conn,
- ASN1_STRING *name,
+ ASN1_STRING *name_entry,
char **store_name);
static int openssl_verify_peer_name_matches_certificate_ip(PGconn *conn,
ASN1_OCTET_STRING *addr_entry,
char **store_name);
static void destroy_ssl_system(void);
static int initialize_SSL(PGconn *conn);
-static PostgresPollingStatusType open_client_SSL(PGconn *);
+static PostgresPollingStatusType open_client_SSL(PGconn *conn);
static char *SSLerrmessage(unsigned long ecode);
static void SSLerrfree(char *buf);
static int PQssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index 7986445f1..f7a5db4c2 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -483,7 +483,7 @@ extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
/* Deprecated routines for copy in/out */
-extern int PQgetline(PGconn *conn, char *string, int length);
+extern int PQgetline(PGconn *conn, char *string, int maxlen);
extern int PQputline(PGconn *conn, const char *string);
extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
@@ -591,7 +591,7 @@ extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_lengt
extern void PQprint(FILE *fout, /* output stream */
const PGresult *res,
- const PQprintOpt *ps); /* option structure */
+ const PQprintOpt *po); /* option structure */
/*
* really old printing routines
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 7bd2a9fff..a64734294 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -374,7 +374,7 @@ static ParamListInfo setup_param_list(PLpgSQL_execstate *estate,
PLpgSQL_expr *expr);
static ParamExternData *plpgsql_param_fetch(ParamListInfo params,
int paramid, bool speculative,
- ParamExternData *workspace);
+ ParamExternData *prm);
static void plpgsql_param_compile(ParamListInfo params, Param *param,
ExprState *state,
Datum *resv, bool *resnull);
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
index c438cfb82..298386cb7 100644
--- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
+++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
@@ -172,52 +172,70 @@ bool ecpg_get_data(const PGresult *, int, int, int, enum ECPGttype type,
#ifdef ENABLE_THREAD_SAFETY
void ecpg_pthreads_init(void);
#endif
-struct connection *ecpg_get_connection(const char *);
-char *ecpg_alloc(long, int);
-char *ecpg_auto_alloc(long, int);
-char *ecpg_realloc(void *, long, int);
-void ecpg_free(void *);
-bool ecpg_init(const struct connection *, const char *, const int);
-char *ecpg_strdup(const char *, int);
-const char *ecpg_type_name(enum ECPGttype);
-int ecpg_dynamic_type(Oid);
-int sqlda_dynamic_type(Oid, enum COMPAT_MODE);
+struct connection *ecpg_get_connection(const char *connection_name);
+char *ecpg_alloc(long size, int lineno);
+char *ecpg_auto_alloc(long size, int lineno);
+char *ecpg_realloc(void *ptr, long size, int lineno);
+void ecpg_free(void *ptr);
+bool ecpg_init(const struct connection *con,
+ const char *connection_name,
+ const int lineno);
+char *ecpg_strdup(const char *string, int lineno);
+const char *ecpg_type_name(enum ECPGttype typ);
+int ecpg_dynamic_type(Oid type);
+int sqlda_dynamic_type(Oid type, enum COMPAT_MODE compat);
void ecpg_clear_auto_mem(void);
struct descriptor *ecpg_find_desc(int line, const char *name);
-struct prepared_statement *ecpg_find_prepared_statement(const char *,
- struct connection *, struct prepared_statement **);
+struct prepared_statement *ecpg_find_prepared_statement(const char *name,
+ struct connection *con,
+ struct prepared_statement **prev_);
bool ecpg_store_result(const PGresult *results, int act_field,
const struct statement *stmt, struct variable *var);
-bool ecpg_store_input(const int, const bool, const struct variable *, char **, bool);
+bool ecpg_store_input(const int lineno, const bool force_indicator,
+ const struct variable *var,
+ char **tobeinserted_p, bool quote);
void ecpg_free_params(struct statement *stmt, bool print);
-bool ecpg_do_prologue(int, const int, const int, const char *, const bool,
- enum ECPG_statement_type, const char *, va_list,
- struct statement **);
-bool ecpg_build_params(struct statement *);
+bool ecpg_do_prologue(int lineno, const int compat,
+ const int force_indicator, const char *connection_name,
+ const bool questionmarks, enum ECPG_statement_type statement_type,
+ const char *query, va_list args,
+ struct statement **stmt_out);
+bool ecpg_build_params(struct statement *stmt);
bool ecpg_autostart_transaction(struct statement *stmt);
bool ecpg_execute(struct statement *stmt);
-bool ecpg_process_output(struct statement *, bool);
-void ecpg_do_epilogue(struct statement *);
-bool ecpg_do(const int, const int, const int, const char *, const bool,
- const int, const char *, va_list);
+bool ecpg_process_output(struct statement *stmt, bool clear_result);
+void ecpg_do_epilogue(struct statement *stmt);
+bool ecpg_do(const int lineno, const int compat,
+ const int force_indicator, const char *connection_name,
+ const bool questionmarks, const int st, const char *query,
+ va_list args);
-bool ecpg_check_PQresult(PGresult *, int, PGconn *, enum COMPAT_MODE);
+bool ecpg_check_PQresult(PGresult *results, int lineno,
+ PGconn *connection, enum COMPAT_MODE compat);
void ecpg_raise(int line, int code, const char *sqlstate, const char *str);
void ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat);
-char *ecpg_prepared(const char *, struct connection *);
-bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *conn);
+char *ecpg_prepared(const char *name, struct connection *con);
+bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *con);
void ecpg_log(const char *format,...) pg_attribute_printf(1, 2);
-bool ecpg_auto_prepare(int, const char *, const int, char **, const char *);
-bool ecpg_register_prepared_stmt(struct statement *);
+bool ecpg_auto_prepare(int lineno, const char *connection_name,
+ const int compat, char **name,
+ const char *query);
+bool ecpg_register_prepared_stmt(struct statement *stmt);
void ecpg_init_sqlca(struct sqlca_t *sqlca);
-struct sqlda_compat *ecpg_build_compat_sqlda(int, PGresult *, int, enum COMPAT_MODE);
-void ecpg_set_compat_sqlda(int, struct sqlda_compat **, const PGresult *, int, enum COMPAT_MODE);
-struct sqlda_struct *ecpg_build_native_sqlda(int, PGresult *, int, enum COMPAT_MODE);
-void ecpg_set_native_sqlda(int, struct sqlda_struct **, const PGresult *, int, enum COMPAT_MODE);
+struct sqlda_compat *ecpg_build_compat_sqlda(int line, PGresult *res, int row,
+ enum COMPAT_MODE compat);
+void ecpg_set_compat_sqlda(int lineno, struct sqlda_compat **_sqlda,
+ const PGresult *res, int row,
+ enum COMPAT_MODE compat);
+struct sqlda_struct *ecpg_build_native_sqlda(int line, PGresult *res, int row,
+ enum COMPAT_MODE compat);
+void ecpg_set_native_sqlda(int lineno, struct sqlda_struct **_sqlda,
+ const PGresult *res, int row,
+ enum COMPAT_MODE compat);
unsigned ecpg_hex_dec_len(unsigned srclen);
unsigned ecpg_hex_enc_len(unsigned srclen);
unsigned ecpg_hex_encode(const char *src, unsigned len, char *dst);
diff --git a/src/interfaces/ecpg/pgtypeslib/dt.h b/src/interfaces/ecpg/pgtypeslib/dt.h
index 893c9b619..1ec38791f 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt.h
+++ b/src/interfaces/ecpg/pgtypeslib/dt.h
@@ -311,22 +311,22 @@ do { \
#define TIMESTAMP_IS_NOEND(j) ((j) == DT_NOEND)
#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
-int DecodeInterval(char **, int *, int, int *, struct tm *, fsec_t *);
-int DecodeTime(char *, int *, struct tm *, fsec_t *);
+int DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec);
+int DecodeTime(char *str, int *tmask, struct tm *tm, fsec_t *fsec);
void EncodeDateTime(struct tm *tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str, bool EuroDates);
void EncodeInterval(struct tm *tm, fsec_t fsec, int style, char *str);
-int tm2timestamp(struct tm *, fsec_t, int *, timestamp *);
+int tm2timestamp(struct tm *tm, fsec_t fsec, int *tzp, timestamp *result);
int DecodeUnits(int field, char *lowtoken, int *val);
bool CheckDateTokenTables(void);
void EncodeDateOnly(struct tm *tm, int style, char *str, bool EuroDates);
-int GetEpochTime(struct tm *);
-int ParseDateTime(char *, char *, char **, int *, int *, char **);
-int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, bool);
-void j2date(int, int *, int *, int *);
-void GetCurrentDateTime(struct tm *);
-int date2j(int, int, int);
-void TrimTrailingZeros(char *);
-void dt2time(double, int *, int *, int *, fsec_t *);
+int GetEpochTime(struct tm *tm);
+int ParseDateTime(char *timestr, char *lowstr, char **field, int *ftype, int *numfields, char **endstr);
+int DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec, bool EuroDates);
+void j2date(int jd, int *year, int *month, int *day);
+void GetCurrentDateTime(struct tm *tm);
+int date2j(int y, int m, int d);
+void TrimTrailingZeros(char *str);
+void dt2time(double jd, int *hour, int *min, int *sec, fsec_t *fsec);
int PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
int *year, int *month, int *day,
int *hour, int *minute, int *second,
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index e51c03610..14f20e2d2 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = {
* ScanKeywordLookup(), except we want case-sensitive matching.
*/
int
-ScanCKeywordLookup(const char *str)
+ScanCKeywordLookup(const char *text)
{
size_t len;
int h;
@@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str)
* Reject immediately if too long to be any keyword. This saves useless
* hashing work on long strings.
*/
- len = strlen(str);
+ len = strlen(text);
if (len > ScanCKeywords.max_kw_len)
return -1;
@@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str)
* Compute the hash function. Since it's a perfect hash, we need only
* match to the specific keyword it identifies.
*/
- h = ScanCKeywords_hash_func(str, len);
+ h = ScanCKeywords_hash_func(text, len);
/* An out-of-range result implies no match */
if (h < 0 || h >= ScanCKeywords.num_keywords)
@@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str)
kw = GetScanKeyword(h, &ScanCKeywords);
- if (strcmp(kw, str) == 0)
+ if (strcmp(kw, text) == 0)
return ScanCKeywordTokens[h];
return -1;
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index cf8aadd0b..6c0b8a27b 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -4,7 +4,7 @@
#include "preproc_extern.h"
-static void output_escaped_str(char *cmd, bool quoted);
+static void output_escaped_str(char *str, bool quoted);
void
output_line_number(void)
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 6be59b719..732556a0a 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -75,8 +75,8 @@ extern int base_yylex(void);
extern void base_yyerror(const char *);
extern void *mm_alloc(size_t);
extern char *mm_strdup(const char *);
-extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
-extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
+extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
+extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
extern void output_get_descr_header(char *);
extern void output_get_descr(char *, char *);
extern void output_set_descr_header(char *);
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index d4b4da5ff..58119d110 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -233,7 +233,7 @@ get_type(enum ECPGttype type)
*/
static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize,
- char *arrsize, const char *size, const char *prefix, int);
+ char *arrsize, const char *size, const char *prefix, int counter);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize,
struct ECPGtype *type, struct ECPGtype *ind_type, const char *prefix, const char *ind_prefix);
--
2.34.1
v3-0003-Harmonize-parameter-names-in-heapam-and-related-c.patchapplication/octet-stream; name=v3-0003-Harmonize-parameter-names-in-heapam-and-related-c.patchDownload
From 8b81528268440e4df19c170e8cd2311f24304567 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 17 Sep 2022 16:04:42 -0700
Subject: [PATCH v3 3/6] Harmonize parameter names in heapam and related code.
---
src/include/access/heapam.h | 26 +++++-----
src/include/access/heapam_xlog.h | 4 +-
src/include/access/htup_details.h | 2 +-
src/include/access/multixact.h | 7 +--
src/include/access/rewriteheap.h | 12 ++---
src/include/access/tableam.h | 8 +--
src/include/commands/cluster.h | 2 +-
src/include/replication/snapbuild.h | 13 ++---
src/backend/access/common/heaptuple.c | 14 +++---
src/backend/access/heap/heapam.c | 2 +-
src/backend/access/heap/heapam_visibility.c | 16 +++---
src/backend/access/heap/visibilitymap.c | 56 ++++++++++-----------
src/backend/access/table/tableam.c | 11 ++--
src/backend/access/transam/multixact.c | 6 +--
14 files changed, 90 insertions(+), 89 deletions(-)
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index abf62d9df..9dab35551 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -118,13 +118,13 @@ extern TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot,
int nkeys, ScanKey key,
ParallelTableScanDesc parallel_scan,
uint32 flags);
-extern void heap_setscanlimits(TableScanDesc scan, BlockNumber startBlk,
+extern void heap_setscanlimits(TableScanDesc sscan, BlockNumber startBlk,
BlockNumber numBlks);
-extern void heapgetpage(TableScanDesc scan, BlockNumber page);
-extern void heap_rescan(TableScanDesc scan, ScanKey key, bool set_params,
+extern void heapgetpage(TableScanDesc sscan, BlockNumber page);
+extern void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params,
bool allow_strat, bool allow_sync, bool allow_pagemode);
-extern void heap_endscan(TableScanDesc scan);
-extern HeapTuple heap_getnext(TableScanDesc scan, ScanDirection direction);
+extern void heap_endscan(TableScanDesc sscan);
+extern HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction);
extern bool heap_getnextslot(TableScanDesc sscan,
ScanDirection direction, struct TupleTableSlot *slot);
extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
@@ -138,7 +138,7 @@ extern bool heap_hot_search_buffer(ItemPointer tid, Relation relation,
Buffer buffer, Snapshot snapshot, HeapTuple heapTuple,
bool *all_dead, bool first_call);
-extern void heap_get_latest_tid(TableScanDesc scan, ItemPointer tid);
+extern void heap_get_latest_tid(TableScanDesc sscan, ItemPointer tid);
extern BulkInsertState GetBulkInsertState(void);
extern void FreeBulkInsertState(BulkInsertState);
@@ -160,7 +160,7 @@ extern TM_Result heap_update(Relation relation, ItemPointer otid,
struct TM_FailureData *tmfd, LockTupleMode *lockmode);
extern TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple,
CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy,
- bool follow_update,
+ bool follow_updates,
Buffer *buffer, struct TM_FailureData *tmfd);
extern void heap_inplace_update(Relation relation, HeapTuple tuple);
@@ -187,7 +187,7 @@ extern void heap_page_prune_opt(Relation relation, Buffer buffer);
extern int heap_page_prune(Relation relation, Buffer buffer,
struct GlobalVisState *vistest,
TransactionId old_snap_xmin,
- TimestampTz old_snap_ts_ts,
+ TimestampTz old_snap_ts,
int *nnewlpdead,
OffsetNumber *off_loc);
extern void heap_page_prune_execute(Buffer buffer,
@@ -202,13 +202,13 @@ extern void heap_vacuum_rel(Relation rel,
struct VacuumParams *params, BufferAccessStrategy bstrategy);
/* in heap/heapam_visibility.c */
-extern bool HeapTupleSatisfiesVisibility(HeapTuple stup, Snapshot snapshot,
+extern bool HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot,
Buffer buffer);
-extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple stup, CommandId curcid,
+extern TM_Result HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple stup, TransactionId OldestXmin,
+extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
Buffer buffer);
-extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple stup, Buffer buffer,
+extern HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple htup, Buffer buffer,
TransactionId *dead_after);
extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
uint16 infomask, TransactionId xid);
@@ -227,7 +227,7 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
HeapTuple htup,
Buffer buffer,
CommandId *cmin, CommandId *cmax);
-extern void HeapCheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple,
+extern void HeapCheckForSerializableConflictOut(bool visible, Relation relation, HeapTuple tuple,
Buffer buffer, Snapshot snapshot);
#endif /* HEAPAM_H */
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index 1705e736b..34220d93c 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -414,8 +414,8 @@ extern bool heap_prepare_freeze_tuple(HeapTupleHeader tuple,
TransactionId *relfrozenxid_out,
MultiXactId *relminmxid_out);
extern void heap_execute_freeze_tuple(HeapTupleHeader tuple,
- xl_heap_freeze_tuple *xlrec_tp);
+ xl_heap_freeze_tuple *frz);
extern XLogRecPtr log_heap_visible(RelFileLocator rlocator, Buffer heap_buffer,
- Buffer vm_buffer, TransactionId cutoff_xid, uint8 flags);
+ Buffer vm_buffer, TransactionId cutoff_xid, uint8 vmflags);
#endif /* HEAPAM_XLOG_H */
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h
index 51a60eda0..9561c835f 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -699,7 +699,7 @@ extern void heap_fill_tuple(TupleDesc tupleDesc,
uint16 *infomask, bits8 *bit);
extern bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc);
extern Datum nocachegetattr(HeapTuple tup, int attnum,
- TupleDesc att);
+ TupleDesc tupleDesc);
extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
bool *isnull);
extern Datum getmissingattr(TupleDesc tupleDesc,
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index a5600a320..4cbe17de7 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -112,8 +112,8 @@ extern MultiXactId ReadNextMultiXactId(void);
extern void ReadMultiXactIdRange(MultiXactId *oldest, MultiXactId *next);
extern bool MultiXactIdIsRunning(MultiXactId multi, bool isLockOnly);
extern void MultiXactIdSetOldestMember(void);
-extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **xids,
- bool allow_old, bool isLockOnly);
+extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
+ bool from_pgupgrade, bool isLockOnly);
extern bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2);
extern bool MultiXactIdPrecedesOrEquals(MultiXactId multi1,
MultiXactId multi2);
@@ -140,7 +140,8 @@ extern void MultiXactGetCheckptMulti(bool is_shutdown,
Oid *oldestMultiDB);
extern void CheckPointMultiXact(void);
extern MultiXactId GetOldestMultiXactId(void);
-extern void TruncateMultiXact(MultiXactId oldestMulti, Oid oldestMultiDB);
+extern void TruncateMultiXact(MultiXactId newOldestMulti,
+ Oid newOldestMultiDB);
extern void MultiXactSetNextMXact(MultiXactId nextMulti,
MultiXactOffset nextMultiOffset);
extern void MultiXactAdvanceNextMXact(MultiXactId minMulti,
diff --git a/src/include/access/rewriteheap.h b/src/include/access/rewriteheap.h
index 353cbb292..5cc04756a 100644
--- a/src/include/access/rewriteheap.h
+++ b/src/include/access/rewriteheap.h
@@ -21,13 +21,13 @@
/* struct definition is private to rewriteheap.c */
typedef struct RewriteStateData *RewriteState;
-extern RewriteState begin_heap_rewrite(Relation OldHeap, Relation NewHeap,
- TransactionId OldestXmin, TransactionId FreezeXid,
- MultiXactId MultiXactCutoff);
+extern RewriteState begin_heap_rewrite(Relation old_heap, Relation new_heap,
+ TransactionId oldest_xmin, TransactionId freeze_xid,
+ MultiXactId cutoff_multi);
extern void end_heap_rewrite(RewriteState state);
-extern void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple,
- HeapTuple newTuple);
-extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple);
+extern void rewrite_heap_tuple(RewriteState state, HeapTuple old_tuple,
+ HeapTuple new_tuple);
+extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple);
/*
* On-Disk data format for an individual logical rewrite mapping.
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index ffe265d2a..e45d73eae 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -863,13 +863,13 @@ typedef struct TableAmRoutine
* for the relation. Works for tables, views, foreign tables and partitioned
* tables.
*/
-extern const TupleTableSlotOps *table_slot_callbacks(Relation rel);
+extern const TupleTableSlotOps *table_slot_callbacks(Relation relation);
/*
* Returns slot using the callbacks returned by table_slot_callbacks(), and
* registers it on *reglist.
*/
-extern TupleTableSlot *table_slot_create(Relation rel, List **reglist);
+extern TupleTableSlot *table_slot_create(Relation relation, List **reglist);
/* ----------------------------------------------------------------------------
@@ -895,7 +895,7 @@ table_beginscan(Relation rel, Snapshot snapshot,
* Like table_beginscan(), but for scanning catalog. It'll automatically use a
* snapshot appropriate for scanning catalog relations.
*/
-extern TableScanDesc table_beginscan_catalog(Relation rel, int nkeys,
+extern TableScanDesc table_beginscan_catalog(Relation relation, int nkeys,
struct ScanKeyData *key);
/*
@@ -1133,7 +1133,7 @@ extern void table_parallelscan_initialize(Relation rel,
*
* Caller must hold a suitable lock on the relation.
*/
-extern TableScanDesc table_beginscan_parallel(Relation rel,
+extern TableScanDesc table_beginscan_parallel(Relation relation,
ParallelTableScanDesc pscan);
/*
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h
index df8e73af4..de9040c4b 100644
--- a/src/include/commands/cluster.h
+++ b/src/include/commands/cluster.h
@@ -45,7 +45,7 @@ extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
bool check_constraints,
bool is_internal,
TransactionId frozenXid,
- MultiXactId minMulti,
+ MultiXactId cutoffMulti,
char newrelpersistence);
#endif /* CLUSTER_H */
diff --git a/src/include/replication/snapbuild.h b/src/include/replication/snapbuild.h
index e6adea24f..f126ff2e0 100644
--- a/src/include/replication/snapbuild.h
+++ b/src/include/replication/snapbuild.h
@@ -59,24 +59,24 @@ struct xl_running_xacts;
extern void CheckPointSnapBuild(void);
-extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *cache,
+extern SnapBuild *AllocateSnapshotBuilder(struct ReorderBuffer *reorder,
TransactionId xmin_horizon, XLogRecPtr start_lsn,
bool need_full_snapshot,
XLogRecPtr two_phase_at);
-extern void FreeSnapshotBuilder(SnapBuild *cache);
+extern void FreeSnapshotBuilder(SnapBuild *builder);
extern void SnapBuildSnapDecRefcount(Snapshot snap);
extern Snapshot SnapBuildInitialSnapshot(SnapBuild *builder);
-extern const char *SnapBuildExportSnapshot(SnapBuild *snapstate);
+extern const char *SnapBuildExportSnapshot(SnapBuild *builder);
extern void SnapBuildClearExportedSnapshot(void);
extern void SnapBuildResetExportedSnapshotState(void);
-extern SnapBuildState SnapBuildCurrentState(SnapBuild *snapstate);
+extern SnapBuildState SnapBuildCurrentState(SnapBuild *builder);
extern Snapshot SnapBuildGetOrBuildSnapshot(SnapBuild *builder,
TransactionId xid);
-extern bool SnapBuildXactNeedsSkip(SnapBuild *snapstate, XLogRecPtr ptr);
+extern bool SnapBuildXactNeedsSkip(SnapBuild *builder, XLogRecPtr ptr);
extern XLogRecPtr SnapBuildGetTwoPhaseAt(SnapBuild *builder);
extern void SnapBuildSetTwoPhaseAt(SnapBuild *builder, XLogRecPtr ptr);
@@ -86,7 +86,8 @@ extern void SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn,
extern bool SnapBuildProcessChange(SnapBuild *builder, TransactionId xid,
XLogRecPtr lsn);
extern void SnapBuildProcessNewCid(SnapBuild *builder, TransactionId xid,
- XLogRecPtr lsn, struct xl_heap_new_cid *cid);
+ XLogRecPtr lsn,
+ struct xl_heap_new_cid *xlrec);
extern void SnapBuildProcessRunningXacts(SnapBuild *builder, XLogRecPtr lsn,
struct xl_running_xacts *running);
extern void SnapBuildSerializationPoint(SnapBuild *builder, XLogRecPtr lsn);
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 503cda46e..7e355585a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -420,13 +420,13 @@ heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
* ----------------
*/
Datum
-nocachegetattr(HeapTuple tuple,
+nocachegetattr(HeapTuple tup,
int attnum,
TupleDesc tupleDesc)
{
- HeapTupleHeader tup = tuple->t_data;
+ HeapTupleHeader td = tup->t_data;
char *tp; /* ptr to data part of tuple */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ bits8 *bp = td->t_bits; /* ptr to null bitmap in tuple */
bool slow = false; /* do we have to walk attrs? */
int off; /* current offset within data */
@@ -441,7 +441,7 @@ nocachegetattr(HeapTuple tuple,
attnum--;
- if (!HeapTupleNoNulls(tuple))
+ if (!HeapTupleNoNulls(tup))
{
/*
* there's a null somewhere in the tuple
@@ -470,7 +470,7 @@ nocachegetattr(HeapTuple tuple,
}
}
- tp = (char *) tup + tup->t_hoff;
+ tp = (char *) td + td->t_hoff;
if (!slow)
{
@@ -489,7 +489,7 @@ nocachegetattr(HeapTuple tuple,
* target. If there aren't any, it's safe to cheaply initialize the
* cached offsets for these attrs.
*/
- if (HeapTupleHasVarWidth(tuple))
+ if (HeapTupleHasVarWidth(tup))
{
int j;
@@ -565,7 +565,7 @@ nocachegetattr(HeapTuple tuple,
{
Form_pg_attribute att = TupleDescAttr(tupleDesc, i);
- if (HeapTupleHasNulls(tuple) && att_isnull(i, bp))
+ if (HeapTupleHasNulls(tup) && att_isnull(i, bp))
{
usecache = false;
continue; /* this cannot be the target att */
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 588716606..eb811d751 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -108,7 +108,7 @@ static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status
static void index_delete_sort(TM_IndexDeleteOp *delstate);
static int bottomup_sort_and_shrink(TM_IndexDeleteOp *delstate);
static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup);
-static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_required,
+static HeapTuple ExtractReplicaIdentity(Relation relation, HeapTuple tp, bool key_required,
bool *copy);
diff --git a/src/backend/access/heap/heapam_visibility.c b/src/backend/access/heap/heapam_visibility.c
index ff0b8a688..6e33d1c88 100644
--- a/src/backend/access/heap/heapam_visibility.c
+++ b/src/backend/access/heap/heapam_visibility.c
@@ -1763,30 +1763,30 @@ HeapTupleSatisfiesHistoricMVCC(HeapTuple htup, Snapshot snapshot,
* if so, the indicated buffer is marked dirty.
*/
bool
-HeapTupleSatisfiesVisibility(HeapTuple tup, Snapshot snapshot, Buffer buffer)
+HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot, Buffer buffer)
{
switch (snapshot->snapshot_type)
{
case SNAPSHOT_MVCC:
- return HeapTupleSatisfiesMVCC(tup, snapshot, buffer);
+ return HeapTupleSatisfiesMVCC(htup, snapshot, buffer);
break;
case SNAPSHOT_SELF:
- return HeapTupleSatisfiesSelf(tup, snapshot, buffer);
+ return HeapTupleSatisfiesSelf(htup, snapshot, buffer);
break;
case SNAPSHOT_ANY:
- return HeapTupleSatisfiesAny(tup, snapshot, buffer);
+ return HeapTupleSatisfiesAny(htup, snapshot, buffer);
break;
case SNAPSHOT_TOAST:
- return HeapTupleSatisfiesToast(tup, snapshot, buffer);
+ return HeapTupleSatisfiesToast(htup, snapshot, buffer);
break;
case SNAPSHOT_DIRTY:
- return HeapTupleSatisfiesDirty(tup, snapshot, buffer);
+ return HeapTupleSatisfiesDirty(htup, snapshot, buffer);
break;
case SNAPSHOT_HISTORIC_MVCC:
- return HeapTupleSatisfiesHistoricMVCC(tup, snapshot, buffer);
+ return HeapTupleSatisfiesHistoricMVCC(htup, snapshot, buffer);
break;
case SNAPSHOT_NON_VACUUMABLE:
- return HeapTupleSatisfiesNonVacuumable(tup, snapshot, buffer);
+ return HeapTupleSatisfiesNonVacuumable(htup, snapshot, buffer);
break;
}
diff --git a/src/backend/access/heap/visibilitymap.c b/src/backend/access/heap/visibilitymap.c
index ed72eb7b6..d62761728 100644
--- a/src/backend/access/heap/visibilitymap.c
+++ b/src/backend/access/heap/visibilitymap.c
@@ -137,7 +137,7 @@ static void vm_extend(Relation rel, BlockNumber vm_nblocks);
* any I/O. Returns true if any bits have been cleared and false otherwise.
*/
bool
-visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
+visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf, uint8 flags)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
int mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -152,21 +152,21 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
elog(DEBUG1, "vm_clear %s %d", RelationGetRelationName(rel), heapBlk);
#endif
- if (!BufferIsValid(buf) || BufferGetBlockNumber(buf) != mapBlock)
+ if (!BufferIsValid(vmbuf) || BufferGetBlockNumber(vmbuf) != mapBlock)
elog(ERROR, "wrong buffer passed to visibilitymap_clear");
- LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
- map = PageGetContents(BufferGetPage(buf));
+ LockBuffer(vmbuf, BUFFER_LOCK_EXCLUSIVE);
+ map = PageGetContents(BufferGetPage(vmbuf));
if (map[mapByte] & mask)
{
map[mapByte] &= ~mask;
- MarkBufferDirty(buf);
+ MarkBufferDirty(vmbuf);
cleared = true;
}
- LockBuffer(buf, BUFFER_LOCK_UNLOCK);
+ LockBuffer(vmbuf, BUFFER_LOCK_UNLOCK);
return cleared;
}
@@ -180,43 +180,43 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
* shouldn't hold a lock on the heap page while doing that. Then, call
* visibilitymap_set to actually set the bit.
*
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by
* an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
* the bit for heapBlk.
*
* If the page doesn't exist in the map file yet, it is extended.
*/
void
-visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
/* Reuse the old pinned buffer if possible */
- if (BufferIsValid(*buf))
+ if (BufferIsValid(*vmbuf))
{
- if (BufferGetBlockNumber(*buf) == mapBlock)
+ if (BufferGetBlockNumber(*vmbuf) == mapBlock)
return;
- ReleaseBuffer(*buf);
+ ReleaseBuffer(*vmbuf);
}
- *buf = vm_readbuf(rel, mapBlock, true);
+ *vmbuf = vm_readbuf(rel, mapBlock, true);
}
/*
* visibilitymap_pin_ok - do we already have the correct page pinned?
*
- * On entry, buf should be InvalidBuffer or a valid buffer returned by
+ * On entry, vmbuf should be InvalidBuffer or a valid buffer returned by
* an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
* relation. The return value indicates whether the buffer covers the
* given heapBlk.
*/
bool
-visibilitymap_pin_ok(BlockNumber heapBlk, Buffer buf)
+visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
- return BufferIsValid(buf) && BufferGetBlockNumber(buf) == mapBlock;
+ return BufferIsValid(vmbuf) && BufferGetBlockNumber(vmbuf) == mapBlock;
}
/*
@@ -314,11 +314,11 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
* Are all tuples on heapBlk visible to all or are marked frozen, according
* to the visibility map?
*
- * On entry, *buf should be InvalidBuffer or a valid buffer returned by an
+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by an
* earlier call to visibilitymap_pin or visibilitymap_get_status on the same
- * relation. On return, *buf is a valid buffer with the map page containing
+ * relation. On return, *vmbuf is a valid buffer with the map page containing
* the bit for heapBlk, or InvalidBuffer. The caller is responsible for
- * releasing *buf after it's done testing and setting bits.
+ * releasing *vmbuf after it's done testing and setting bits.
*
* NOTE: This function is typically called without a lock on the heap page,
* so somebody else could change the bit just after we look at it. In fact,
@@ -328,7 +328,7 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
* all concurrency issues!
*/
uint8
-visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
+visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
{
BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK(heapBlk);
uint32 mapByte = HEAPBLK_TO_MAPBYTE(heapBlk);
@@ -341,23 +341,23 @@ visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
#endif
/* Reuse the old pinned buffer if possible */
- if (BufferIsValid(*buf))
+ if (BufferIsValid(*vmbuf))
{
- if (BufferGetBlockNumber(*buf) != mapBlock)
+ if (BufferGetBlockNumber(*vmbuf) != mapBlock)
{
- ReleaseBuffer(*buf);
- *buf = InvalidBuffer;
+ ReleaseBuffer(*vmbuf);
+ *vmbuf = InvalidBuffer;
}
}
- if (!BufferIsValid(*buf))
+ if (!BufferIsValid(*vmbuf))
{
- *buf = vm_readbuf(rel, mapBlock, false);
- if (!BufferIsValid(*buf))
+ *vmbuf = vm_readbuf(rel, mapBlock, false);
+ if (!BufferIsValid(*vmbuf))
return false;
}
- map = PageGetContents(BufferGetPage(*buf));
+ map = PageGetContents(BufferGetPage(*vmbuf));
/*
* A single byte read is atomic. There could be memory-ordering effects
diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c
index b3d1a6c3f..094b24c7c 100644
--- a/src/backend/access/table/tableam.c
+++ b/src/backend/access/table/tableam.c
@@ -172,19 +172,18 @@ table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan,
}
TableScanDesc
-table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
+table_beginscan_parallel(Relation relation, ParallelTableScanDesc pscan)
{
Snapshot snapshot;
uint32 flags = SO_TYPE_SEQSCAN |
SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE;
- Assert(RelationGetRelid(relation) == parallel_scan->phs_relid);
+ Assert(RelationGetRelid(relation) == pscan->phs_relid);
- if (!parallel_scan->phs_snapshot_any)
+ if (!pscan->phs_snapshot_any)
{
/* Snapshot was serialized -- restore it */
- snapshot = RestoreSnapshot((char *) parallel_scan +
- parallel_scan->phs_snapshot_off);
+ snapshot = RestoreSnapshot((char *) pscan + pscan->phs_snapshot_off);
RegisterSnapshot(snapshot);
flags |= SO_TEMP_SNAPSHOT;
}
@@ -195,7 +194,7 @@ table_beginscan_parallel(Relation relation, ParallelTableScanDesc parallel_scan)
}
return relation->rd_tableam->scan_begin(relation, snapshot, 0, NULL,
- parallel_scan, flags);
+ pscan, flags);
}
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index ec57f56ad..a7383f553 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1214,14 +1214,14 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
* range, that is, greater to or equal than oldestMultiXactId, and less than
* nextMXact. Otherwise, an error is raised.
*
- * onlyLock must be set to true if caller is certain that the given multi
+ * isLockOnly must be set to true if caller is certain that the given multi
* is used only to lock tuples; can be false without loss of correctness,
* but passing a true means we can return quickly without checking for
* old updates.
*/
int
GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
- bool from_pgupgrade, bool onlyLock)
+ bool from_pgupgrade, bool isLockOnly)
{
int pageno;
int prev_pageno;
@@ -1263,7 +1263,7 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
* we can skip checking if the value is older than our oldest visible
* multi. It cannot possibly still be running.
*/
- if (onlyLock &&
+ if (isLockOnly &&
MultiXactIdPrecedes(multi, OldestVisibleMXactId[MyBackendId]))
{
debug_elog2(DEBUG2, "GetMembers: a locker-only multi is too old");
--
2.34.1
v3-0002-Harmonize-parameter-names-in-timezone-code.patchapplication/octet-stream; name=v3-0002-Harmonize-parameter-names-in-timezone-code.patchDownload
From 55e1f25da7b13d70342a7be414b3d2e64869a2cc Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 17 Sep 2022 15:40:08 -0700
Subject: [PATCH v3 2/6] Harmonize parameter names in timezone code.
---
src/timezone/localtime.c | 16 +++++++++-------
src/timezone/pgtz.c | 8 ++++----
src/timezone/strftime.c | 10 +++++-----
src/timezone/zic.c | 34 ++++++++++++++++++----------------
4 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/src/timezone/localtime.c b/src/timezone/localtime.c
index fa3c05903..ad83c7ee5 100644
--- a/src/timezone/localtime.c
+++ b/src/timezone/localtime.c
@@ -82,13 +82,15 @@ struct rule
* Prototypes for static functions.
*/
-static struct pg_tm *gmtsub(pg_time_t const *, int32, struct pg_tm *);
-static bool increment_overflow(int *, int);
-static bool increment_overflow_time(pg_time_t *, int32);
-static int64 leapcorr(struct state const *, pg_time_t);
-static struct pg_tm *timesub(pg_time_t const *, int32, struct state const *,
- struct pg_tm *);
-static bool typesequiv(struct state const *, int, int);
+static struct pg_tm *gmtsub(pg_time_t const *timep, int32 offset,
+ struct pg_tm *tmp);
+static bool increment_overflow(int *ip, int j);
+static bool increment_overflow_time(pg_time_t *tp, int32 j);
+static int64 leapcorr(struct state const *sp, pg_time_t t);
+static struct pg_tm *timesub(pg_time_t const *timep,
+ int32 offset, struct state const *sp,
+ struct pg_tm *tmp);
+static bool typesequiv(struct state const *sp, int a, int b);
/*
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c
index 72f9e3d5e..40096ed79 100644
--- a/src/timezone/pgtz.c
+++ b/src/timezone/pgtz.c
@@ -232,7 +232,7 @@ init_timezone_hashtable(void)
* default timezone setting is later overridden from postgresql.conf.
*/
pg_tz *
-pg_tzset(const char *name)
+pg_tzset(const char *tzname)
{
pg_tz_cache *tzp;
struct state tzstate;
@@ -240,7 +240,7 @@ pg_tzset(const char *name)
char canonname[TZ_STRLEN_MAX + 1];
char *p;
- if (strlen(name) > TZ_STRLEN_MAX)
+ if (strlen(tzname) > TZ_STRLEN_MAX)
return NULL; /* not going to fit */
if (!timezone_cache)
@@ -254,8 +254,8 @@ pg_tzset(const char *name)
* a POSIX-style timezone spec.)
*/
p = uppername;
- while (*name)
- *p++ = pg_toupper((unsigned char) *name++);
+ while (*tzname)
+ *p++ = pg_toupper((unsigned char) *tzname++);
*p = '\0';
tzp = (pg_tz_cache *) hash_search(timezone_cache,
diff --git a/src/timezone/strftime.c b/src/timezone/strftime.c
index dd6c7db86..9247a3415 100644
--- a/src/timezone/strftime.c
+++ b/src/timezone/strftime.c
@@ -111,11 +111,11 @@ enum warn
IN_NONE, IN_SOME, IN_THIS, IN_ALL
};
-static char *_add(const char *, char *, const char *);
-static char *_conv(int, const char *, char *, const char *);
-static char *_fmt(const char *, const struct pg_tm *, char *, const char *,
- enum warn *);
-static char *_yconv(int, int, bool, bool, char *, char const *);
+static char *_add(const char *str, char *pt, const char *ptlim);
+static char *_conv(int n, const char *format, char *pt, const char *ptlim);
+static char *_fmt(const char *format, const struct pg_tm *t, char *pt, const char *ptlim,
+ enum warn *warnp);
+static char *_yconv(int a, int b, bool convert_top, bool convert_yy, char *pt, char const *ptlim);
/*
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 0ea6ead2d..d6c514192 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -123,30 +123,32 @@ static void error(const char *string,...) pg_attribute_printf(1, 2);
static void warning(const char *string,...) pg_attribute_printf(1, 2);
static void usage(FILE *stream, int status) pg_attribute_noreturn();
static void addtt(zic_t starttime, int type);
-static int addtype(zic_t, char const *, bool, bool, bool);
-static void leapadd(zic_t, int, int);
+static int addtype(zic_t utoff, char const *abbr,
+ bool isdst, bool ttisstd, bool ttisut);
+static void leapadd(zic_t t, int correction, int rolling);
static void adjleap(void);
static void associate(void);
-static void dolink(const char *, const char *, bool);
-static char **getfields(char *buf);
+static void dolink(char const *target, char const *linkname,
+ bool staysymlink);
+static char **getfields(char *cp);
static zic_t gethms(const char *string, const char *errstring);
-static zic_t getsave(char *, bool *);
-static void inexpires(char **, int);
-static void infile(const char *filename);
+static zic_t getsave(char *field, bool *isdst);
+static void inexpires(char **fields, int nfields);
+static void infile(const char *name);
static void inleap(char **fields, int nfields);
static void inlink(char **fields, int nfields);
static void inrule(char **fields, int nfields);
static bool inzcont(char **fields, int nfields);
static bool inzone(char **fields, int nfields);
-static bool inzsub(char **, int, bool);
-static bool itsdir(char const *);
-static bool itssymlink(char const *);
+static bool inzsub(char **fields, int nfields, bool iscont);
+static bool itsdir(char const *name);
+static bool itssymlink(char const *name);
static bool is_alpha(char a);
-static char lowerit(char);
-static void mkdirs(char const *, bool);
-static void newabbr(const char *abbr);
+static char lowerit(char a);
+static void mkdirs(char const *argname, bool ancestors);
+static void newabbr(const char *string);
static zic_t oadd(zic_t t1, zic_t t2);
-static void outzone(const struct zone *zp, ptrdiff_t ntzones);
+static void outzone(const struct zone *zpfirst, ptrdiff_t zonecount);
static zic_t rpytime(const struct rule *rp, zic_t wantedy);
static void rulesub(struct rule *rp,
const char *loyearp, const char *hiyearp,
@@ -304,8 +306,8 @@ struct lookup
const int l_value;
};
-static struct lookup const *byword(const char *string,
- const struct lookup *lp);
+static struct lookup const *byword(const char *word,
+ const struct lookup *table);
static struct lookup const zi_line_codes[] = {
{"Rule", LC_RULE},
--
2.34.1
On Mon, 19 Sept 2022 at 15:04, Peter Geoghegan <pg@bowt.ie> wrote:
The general structure of the patchset is now a little more worked out.
Although it's still not close to being commitable, it should give you
a better idea of the kind of structure that I'm aiming for. I think
that this should be broken into a few different parts based on the
area of the codebase affected (not the type of check used). Even that
aspect needs more work, because there is still one massive patch --
this is now the sixth and final patch.
Thanks for updating the patches.
I'm slightly confused about "still not close to being commitable"
along with "this is now the sixth and final patch.". That seems to
imply that you're not planning to send any more patches but you don't
think this is commitable. I'm assuming I've misunderstood that.
I don't have any problems with 0001, 0002 or 0003.
Looking at 0004 I see a few issues:
1. ConnectDatabase() seems to need a bit more work in the header
comment. There's a reference to AH and AHX. The parameter is now
called "A".
2. setup_connection() still references AH->use_role in the comments
(line 1102). Similar problem on line 1207 with AH->sync_snapshot_id
3. setupDumpWorker() still makes references to AH->sync_snapshot_id
and AH->use_role in the comments. The parameter is now called "A".
4. dumpSearchPath() still has a comment which references AH->searchpath
0005 looks fine.
I've not looked at 0006 again.
David
On Sun, Sep 18, 2022 at 9:07 PM David Rowley <dgrowleyml@gmail.com> wrote:
I'm slightly confused about "still not close to being commitable"
along with "this is now the sixth and final patch.". That seems to
imply that you're not planning to send any more patches but you don't
think this is commitable. I'm assuming I've misunderstood that.
I meant that the "big patch" now has a new order -- it is sixth/last in
the newly revised patchset, v3. I don't know how many more patch
revisions will be required, but at least one or two more revisions
seem likely.
Here is the stuff that it less ready, or at least seems ambiguous:
1. The pg_dump patch is relatively opinionated about how to resolve
inconsistencies, and makes quite a few changes to the .c side.
Seeking out the "lesser inconsistency" resulted in more lines being
changed. Maybe you won't see it the same way (maybe you'll prefer the
other trade-off). That's just how it ended up.
2. The same thing is true to a much smaller degree with the jsonb patch.
3. The big patch itself is...well, very big. And written on autopilot,
to a certain degree. So that one just needs more careful examination,
on general principle.
Looking at 0004 I see a few issues:
1. ConnectDatabase() seems to need a bit more work in the header
comment. There's a reference to AH and AHX. The parameter is now
called "A".2. setup_connection() still references AH->use_role in the comments
(line 1102). Similar problem on line 1207 with AH->sync_snapshot_id3. setupDumpWorker() still makes references to AH->sync_snapshot_id
and AH->use_role in the comments. The parameter is now called "A".4. dumpSearchPath() still has a comment which references AH->searchpath
Will fix all those in the next revision. Thanks.
--
Peter Geoghegan
On Sun, Sep 18, 2022 at 9:17 PM Peter Geoghegan <pg@bowt.ie> wrote:
Will fix all those in the next revision. Thanks.
Attached revision v4 fixes those pg_dump patch items.
It also breaks out the ecpg changes into their own patch. Looks like
ecpg requires the same treatment as the timezone code and the regex
code -- it generally doesn't use named parameters in function
declarations, so the majority of its function declarations need to be
adjusted. The overall code churn impact is higher than it was with the
other two modules.
--
Peter Geoghegan
Attachments:
v4-0002-Harmonize-parameter-names-in-jsonb-code.patchapplication/octet-stream; name=v4-0002-Harmonize-parameter-names-in-jsonb-code.patchDownload
From 6e87701f86c7f7b7529a6959adf23b6b461ee8e0 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 17 Sep 2022 18:19:39 -0700
Subject: [PATCH v4 2/4] Harmonize parameter names in jsonb code.
Make sure that function declarations use names that exactly match the
corresponding names from function definitions. Having parameter names
that are reliably consistent in this way will make it easier to reason
about groups of related C functions from the same translation unit as a
module. It will also make certain refactoring tasks easier.
Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy. Later commits will do the
same for other parts of the codebase.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
---
src/include/utils/jsonb.h | 6 +--
src/backend/utils/adt/jsonb.c | 12 ++---
src/backend/utils/adt/jsonb_util.c | 74 +++++++++++++--------------
src/backend/utils/adt/jsonpath_exec.c | 2 +-
4 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index 4cbe6edf2..b03c17d73 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -379,13 +379,13 @@ typedef struct JsonbIterator
extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
extern uint32 getJsonbLength(const JsonbContainer *jc, int index);
extern int compareJsonbContainers(JsonbContainer *a, JsonbContainer *b);
-extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *findJsonbValueFromContainer(JsonbContainer *container,
uint32 flags,
JsonbValue *key);
extern JsonbValue *getKeyJsonValueFromContainer(JsonbContainer *container,
const char *keyVal, int keyLen,
JsonbValue *res);
-extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *sheader,
+extern JsonbValue *getIthJsonbValueFromContainer(JsonbContainer *container,
uint32 i);
extern JsonbValue *pushJsonbValue(JsonbParseState **pstate,
JsonbIteratorToken seq, JsonbValue *jbval);
@@ -406,7 +406,7 @@ extern char *JsonbToCString(StringInfo out, JsonbContainer *in,
extern char *JsonbToCStringIndent(StringInfo out, JsonbContainer *in,
int estimated_len);
extern bool JsonbExtractScalar(JsonbContainer *jbc, JsonbValue *res);
-extern const char *JsonbTypeName(JsonbValue *jb);
+extern const char *JsonbTypeName(JsonbValue *val);
extern Datum jsonb_set_element(Jsonb *jb, Datum *path, int path_len,
JsonbValue *newval);
diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c
index 88b0000f9..9e14922ec 100644
--- a/src/backend/utils/adt/jsonb.c
+++ b/src/backend/utils/adt/jsonb.c
@@ -188,12 +188,12 @@ JsonbContainerTypeName(JsonbContainer *jbc)
* Get the type name of a jsonb value.
*/
const char *
-JsonbTypeName(JsonbValue *jbv)
+JsonbTypeName(JsonbValue *val)
{
- switch (jbv->type)
+ switch (val->type)
{
case jbvBinary:
- return JsonbContainerTypeName(jbv->val.binary.data);
+ return JsonbContainerTypeName(val->val.binary.data);
case jbvObject:
return "object";
case jbvArray:
@@ -207,7 +207,7 @@ JsonbTypeName(JsonbValue *jbv)
case jbvNull:
return "null";
case jbvDatetime:
- switch (jbv->val.datetime.typid)
+ switch (val->val.datetime.typid)
{
case DATEOID:
return "date";
@@ -221,11 +221,11 @@ JsonbTypeName(JsonbValue *jbv)
return "timestamp with time zone";
default:
elog(ERROR, "unrecognized jsonb value datetime type: %d",
- jbv->val.datetime.typid);
+ val->val.datetime.typid);
}
return "unknown";
default:
- elog(ERROR, "unrecognized jsonb value type: %d", jbv->type);
+ elog(ERROR, "unrecognized jsonb value type: %d", val->type);
return "unknown";
}
}
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c
index 60442758b..7d6a1ed23 100644
--- a/src/backend/utils/adt/jsonb_util.c
+++ b/src/backend/utils/adt/jsonb_util.c
@@ -57,13 +57,13 @@ static short padBufferToInt(StringInfo buffer);
static JsonbIterator *iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent);
static JsonbIterator *freeAndGetParent(JsonbIterator *it);
static JsonbParseState *pushState(JsonbParseState **pstate);
-static void appendKey(JsonbParseState *pstate, JsonbValue *scalarVal);
+static void appendKey(JsonbParseState *pstate, JsonbValue *string);
static void appendValue(JsonbParseState *pstate, JsonbValue *scalarVal);
static void appendElement(JsonbParseState *pstate, JsonbValue *scalarVal);
static int lengthCompareJsonbStringValue(const void *a, const void *b);
static int lengthCompareJsonbString(const char *val1, int len1,
const char *val2, int len2);
-static int lengthCompareJsonbPair(const void *a, const void *b, void *arg);
+static int lengthCompareJsonbPair(const void *a, const void *b, void *binequal);
static void uniqueifyJsonbObject(JsonbValue *object);
static JsonbValue *pushJsonbValueScalar(JsonbParseState **pstate,
JsonbIteratorToken seq,
@@ -1394,22 +1394,22 @@ JsonbHashScalarValueExtended(const JsonbValue *scalarVal, uint64 *hash,
* Are two scalar JsonbValues of the same type a and b equal?
*/
static bool
-equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+equalsJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return true;
case jbvString:
- return lengthCompareJsonbStringValue(aScalar, bScalar) == 0;
+ return lengthCompareJsonbStringValue(a, b) == 0;
case jbvNumeric:
return DatumGetBool(DirectFunctionCall2(numeric_eq,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- return aScalar->val.boolean == bScalar->val.boolean;
+ return a->val.boolean == b->val.boolean;
default:
elog(ERROR, "invalid jsonb scalar type");
@@ -1426,28 +1426,28 @@ equalsJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
* operators, where a lexical sort order is generally expected.
*/
static int
-compareJsonbScalarValue(JsonbValue *aScalar, JsonbValue *bScalar)
+compareJsonbScalarValue(JsonbValue *a, JsonbValue *b)
{
- if (aScalar->type == bScalar->type)
+ if (a->type == b->type)
{
- switch (aScalar->type)
+ switch (a->type)
{
case jbvNull:
return 0;
case jbvString:
- return varstr_cmp(aScalar->val.string.val,
- aScalar->val.string.len,
- bScalar->val.string.val,
- bScalar->val.string.len,
+ return varstr_cmp(a->val.string.val,
+ a->val.string.len,
+ b->val.string.val,
+ b->val.string.len,
DEFAULT_COLLATION_OID);
case jbvNumeric:
return DatumGetInt32(DirectFunctionCall2(numeric_cmp,
- PointerGetDatum(aScalar->val.numeric),
- PointerGetDatum(bScalar->val.numeric)));
+ PointerGetDatum(a->val.numeric),
+ PointerGetDatum(b->val.numeric)));
case jbvBool:
- if (aScalar->val.boolean == bScalar->val.boolean)
+ if (a->val.boolean == b->val.boolean)
return 0;
- else if (aScalar->val.boolean > bScalar->val.boolean)
+ else if (a->val.boolean > b->val.boolean)
return 1;
else
return -1;
@@ -1608,13 +1608,13 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
}
static void
-convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbArray(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerhead;
int nElems = val->val.array.nElems;
/* Remember where in the buffer this array starts. */
@@ -1627,15 +1627,15 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nElems | JB_FARRAY;
+ containerhead = nElems | JB_FARRAY;
if (val->val.array.rawScalar)
{
Assert(nElems == 1);
Assert(level == 0);
- header |= JB_FSCALAR;
+ containerhead |= JB_FSCALAR;
}
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ appendToBuffer(buffer, (char *) &containerhead, sizeof(uint32));
/* Reserve space for the JEntries of the elements. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nElems);
@@ -1688,17 +1688,17 @@ convertJsonbArray(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int level)
+convertJsonbObject(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
{
int base_offset;
int jentry_offset;
int i;
int totallen;
- uint32 header;
+ uint32 containerheader;
int nPairs = val->val.object.nPairs;
/* Remember where in the buffer this object starts. */
@@ -1711,8 +1711,8 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
* Construct the header Jentry and store it in the beginning of the
* variable-length payload.
*/
- header = nPairs | JB_FOBJECT;
- appendToBuffer(buffer, (char *) &header, sizeof(uint32));
+ containerheader = nPairs | JB_FOBJECT;
+ appendToBuffer(buffer, (char *) &containerheader, sizeof(uint32));
/* Reserve space for the JEntries of the keys and values. */
jentry_offset = reserveFromBuffer(buffer, sizeof(JEntry) * nPairs * 2);
@@ -1804,11 +1804,11 @@ convertJsonbObject(StringInfo buffer, JEntry *pheader, JsonbValue *val, int leve
JENTRY_OFFLENMASK)));
/* Initialize the header of this node in the container's JEntry array */
- *pheader = JENTRY_ISCONTAINER | totallen;
+ *header = JENTRY_ISCONTAINER | totallen;
}
static void
-convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
+convertJsonbScalar(StringInfo buffer, JEntry *header, JsonbValue *scalarVal)
{
int numlen;
short padlen;
@@ -1816,13 +1816,13 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
switch (scalarVal->type)
{
case jbvNull:
- *jentry = JENTRY_ISNULL;
+ *header = JENTRY_ISNULL;
break;
case jbvString:
appendToBuffer(buffer, scalarVal->val.string.val, scalarVal->val.string.len);
- *jentry = scalarVal->val.string.len;
+ *header = scalarVal->val.string.len;
break;
case jbvNumeric:
@@ -1831,11 +1831,11 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
appendToBuffer(buffer, (char *) scalarVal->val.numeric, numlen);
- *jentry = JENTRY_ISNUMERIC | (padlen + numlen);
+ *header = JENTRY_ISNUMERIC | (padlen + numlen);
break;
case jbvBool:
- *jentry = (scalarVal->val.boolean) ?
+ *header = (scalarVal->val.boolean) ?
JENTRY_ISBOOL_TRUE : JENTRY_ISBOOL_FALSE;
break;
@@ -1851,7 +1851,7 @@ convertJsonbScalar(StringInfo buffer, JEntry *jentry, JsonbValue *scalarVal)
len = strlen(buf);
appendToBuffer(buffer, buf, len);
- *jentry = len;
+ *header = len;
}
break;
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 9f4192e07..8d83b2edb 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -252,7 +252,7 @@ static int JsonbType(JsonbValue *jb);
static JsonbValue *getScalar(JsonbValue *scalar, enum jbvType type);
static JsonbValue *wrapItemsInArray(const JsonValueList *items);
static int compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
- bool useTz, bool *have_error);
+ bool useTz, bool *cast_error);
/****************** User interface to JsonPath executor ********************/
--
2.34.1
v4-0004-Harmonize-parameter-names-in-miscellaneous-code.patchapplication/octet-stream; name=v4-0004-Harmonize-parameter-names-in-miscellaneous-code.patchDownload
From d4935be740b99016fd2384ad2b6dbfe78a879fc2 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 16:48:24 -0700
Subject: [PATCH v4 4/4] Harmonize parameter names in miscellaneous code.
TODO: Split this up some more.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
---
src/include/bootstrap/bootstrap.h | 4 +-
src/include/commands/alter.h | 2 +-
src/include/commands/conversioncmds.h | 2 +-
src/include/commands/matview.h | 2 +-
src/include/commands/policy.h | 2 +-
src/include/commands/publicationcmds.h | 2 +-
src/include/commands/schemacmds.h | 4 +-
src/include/commands/seclabel.h | 2 +-
src/include/commands/sequence.h | 8 +--
src/include/commands/tablecmds.h | 2 +-
src/include/commands/tablespace.h | 4 +-
src/include/commands/trigger.h | 14 ++--
src/include/commands/typecmds.h | 2 +-
src/include/common/fe_memutils.h | 4 +-
src/include/common/kwlookup.h | 2 +-
src/include/common/scram-common.h | 2 +-
src/include/fe_utils/cancel.h | 2 +-
src/include/fe_utils/mbprint.h | 3 +-
src/include/fe_utils/parallel_slot.h | 2 +-
src/include/fe_utils/recovery_gen.h | 2 +-
src/include/fe_utils/simple_list.h | 2 +-
src/include/fe_utils/string_utils.h | 2 +-
src/include/foreign/foreign.h | 5 +-
src/include/funcapi.h | 2 +-
src/include/libpq/pqmq.h | 2 +-
src/include/nodes/extensible.h | 4 +-
src/include/nodes/nodes.h | 2 +-
src/include/nodes/params.h | 4 +-
src/include/nodes/pg_list.h | 4 +-
src/include/nodes/value.h | 2 +-
src/include/optimizer/appendinfo.h | 2 +-
src/include/optimizer/clauses.h | 4 +-
src/include/optimizer/cost.h | 2 +-
src/include/optimizer/paths.h | 4 +-
src/include/optimizer/planmain.h | 2 +-
src/include/optimizer/prep.h | 2 +-
src/include/parser/analyze.h | 2 +-
src/include/parser/parse_agg.h | 2 +-
src/include/parser/parse_oper.h | 4 +-
src/include/parser/parse_relation.h | 2 +-
src/include/partitioning/partbounds.h | 4 +-
src/include/pgstat.h | 10 +--
src/include/pgtime.h | 4 +-
src/include/port.h | 8 +--
src/include/postmaster/bgworker.h | 2 +-
src/include/postmaster/syslogger.h | 2 +-
src/include/rewrite/rewriteManip.h | 2 +-
src/include/snowball/libstemmer/header.h | 2 +-
.../statistics/extended_stats_internal.h | 2 +-
src/include/statistics/statistics.h | 4 +-
src/include/tcop/cmdtag.h | 2 +-
src/include/tsearch/ts_utils.h | 4 +-
src/include/utils/acl.h | 6 +-
src/include/utils/attoptcache.h | 2 +-
src/include/utils/builtins.h | 8 +--
src/include/utils/datetime.h | 2 +-
src/include/utils/multirangetypes.h | 6 +-
src/include/utils/numeric.h | 2 +-
src/include/utils/pgstat_internal.h | 4 +-
src/include/utils/rangetypes.h | 4 +-
src/include/utils/regproc.h | 2 +-
src/include/utils/relcache.h | 2 +-
src/include/utils/relmapper.h | 2 +-
src/include/utils/selfuncs.h | 4 +-
src/include/utils/snapmgr.h | 2 +-
src/include/utils/timestamp.h | 4 +-
src/include/utils/tuplesort.h | 2 +-
src/include/utils/xml.h | 2 +-
src/backend/backup/basebackup.c | 2 +-
src/backend/bootstrap/bootstrap.c | 10 +--
src/backend/commands/event_trigger.c | 2 +-
src/backend/commands/explain.c | 2 +-
src/backend/commands/indexcmds.c | 2 +-
src/backend/commands/lockcmds.c | 2 +-
src/backend/commands/opclasscmds.c | 2 +-
src/backend/commands/schemacmds.c | 6 +-
src/backend/commands/tablecmds.c | 6 +-
src/backend/commands/trigger.c | 8 +--
src/backend/lib/dshash.c | 2 +-
src/backend/lib/integerset.c | 4 +-
src/backend/libpq/be-secure-openssl.c | 4 +-
src/backend/optimizer/geqo/geqo_selection.c | 2 +-
src/backend/optimizer/path/costsize.c | 72 +++++++++----------
src/backend/optimizer/plan/createplan.c | 2 +-
src/backend/optimizer/plan/planner.c | 4 +-
src/backend/optimizer/util/plancat.c | 3 +-
src/backend/parser/gram.y | 3 +-
src/backend/parser/parse_clause.c | 2 +-
src/backend/parser/parse_utilcmd.c | 2 +-
src/backend/partitioning/partbounds.c | 6 +-
src/backend/postmaster/postmaster.c | 6 +-
src/backend/statistics/extended_stats.c | 4 +-
src/backend/utils/adt/datetime.c | 22 +++---
src/backend/utils/adt/geo_ops.c | 8 +--
src/backend/utils/adt/like.c | 4 +-
src/backend/utils/adt/numeric.c | 6 +-
src/backend/utils/adt/rangetypes.c | 4 +-
src/backend/utils/adt/ri_triggers.c | 2 +-
src/backend/utils/adt/timestamp.c | 4 +-
src/backend/utils/adt/xml.c | 2 +-
src/backend/utils/cache/relmapper.c | 2 +-
src/backend/utils/error/elog.c | 2 +-
src/backend/utils/misc/guc.c | 2 +-
src/backend/utils/misc/queryjumble.c | 3 +-
src/backend/utils/sort/tuplesortvariants.c | 2 +-
src/backend/utils/time/snapmgr.c | 29 ++++----
src/fe_utils/cancel.c | 4 +-
src/bin/initdb/initdb.c | 2 +-
src/bin/pg_amcheck/pg_amcheck.c | 2 +-
src/bin/pg_basebackup/pg_receivewal.c | 2 +-
src/bin/pg_basebackup/streamutil.h | 2 +-
src/bin/pg_basebackup/walmethods.h | 8 +--
src/bin/pg_rewind/file_ops.h | 4 +-
src/bin/pg_rewind/pg_rewind.h | 2 +-
src/bin/pg_upgrade/info.c | 2 +-
src/bin/pg_upgrade/pg_upgrade.h | 2 +-
src/bin/pg_upgrade/relfilenumber.c | 2 +-
src/bin/pg_verifybackup/pg_verifybackup.c | 2 +-
src/bin/pg_waldump/compat.c | 6 +-
src/bin/pgbench/pgbench.h | 8 +--
src/bin/psql/describe.h | 6 +-
src/bin/scripts/common.h | 2 +-
src/interfaces/libpq/fe-connect.c | 2 +-
src/interfaces/libpq/fe-exec.c | 14 ++--
src/interfaces/libpq/fe-secure-common.h | 4 +-
src/interfaces/libpq/fe-secure-openssl.c | 4 +-
src/interfaces/libpq/libpq-fe.h | 4 +-
src/pl/plpgsql/src/pl_exec.c | 2 +-
128 files changed, 281 insertions(+), 277 deletions(-)
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h
index 49d4ad560..89f5b01b3 100644
--- a/src/include/bootstrap/bootstrap.h
+++ b/src/include/bootstrap/bootstrap.h
@@ -34,8 +34,8 @@ extern PGDLLIMPORT int numattr;
extern void BootstrapModeMain(int argc, char *argv[], bool check_only) pg_attribute_noreturn();
-extern void closerel(char *name);
-extern void boot_openrel(char *name);
+extern void closerel(char *relname);
+extern void boot_openrel(char *relname);
extern void DefineAttr(char *name, char *type, int attnum, int nullness);
extern void InsertOneTuple(void);
diff --git a/src/include/commands/alter.h b/src/include/commands/alter.h
index 52f5e6f6d..fddfa3b85 100644
--- a/src/include/commands/alter.h
+++ b/src/include/commands/alter.h
@@ -29,7 +29,7 @@ extern Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid,
ObjectAddresses *objsMoved);
extern ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
-extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
+extern void AlterObjectOwner_internal(Relation rel, Oid objectId,
Oid new_ownerId);
#endif /* ALTER_H */
diff --git a/src/include/commands/conversioncmds.h b/src/include/commands/conversioncmds.h
index ab736fb62..da3136527 100644
--- a/src/include/commands/conversioncmds.h
+++ b/src/include/commands/conversioncmds.h
@@ -18,6 +18,6 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
+extern ObjectAddress CreateConversionCommand(CreateConversionStmt *stmt);
#endif /* CONVERSIONCMDS_H */
diff --git a/src/include/commands/matview.h b/src/include/commands/matview.h
index a067da39d..7fbb2564a 100644
--- a/src/include/commands/matview.h
+++ b/src/include/commands/matview.h
@@ -26,7 +26,7 @@ extern void SetMatViewPopulatedState(Relation relation, bool newstate);
extern ObjectAddress ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
ParamListInfo params, QueryCompletion *qc);
-extern DestReceiver *CreateTransientRelDestReceiver(Oid oid);
+extern DestReceiver *CreateTransientRelDestReceiver(Oid transientoid);
extern bool MatViewIncrementalMaintenanceIsEnabled(void);
diff --git a/src/include/commands/policy.h b/src/include/commands/policy.h
index c5f3753da..f05bb66c6 100644
--- a/src/include/commands/policy.h
+++ b/src/include/commands/policy.h
@@ -23,7 +23,7 @@ extern void RelationBuildRowSecurity(Relation relation);
extern void RemovePolicyById(Oid policy_id);
-extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid objid);
+extern bool RemoveRoleFromObjectPolicy(Oid roleid, Oid classid, Oid policy_id);
extern ObjectAddress CreatePolicy(CreatePolicyStmt *stmt);
extern ObjectAddress AlterPolicy(AlterPolicyStmt *stmt);
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
index 57df3fc1e..249119657 100644
--- a/src/include/commands/publicationcmds.h
+++ b/src/include/commands/publicationcmds.h
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
extern void RemovePublicationSchemaById(Oid psoid);
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
-extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
extern void InvalidatePublicationRels(List *relids);
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
List *ancestors, bool pubviaroot);
diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h
index 8c21f2a2c..e6eb2aaa6 100644
--- a/src/include/commands/schemacmds.h
+++ b/src/include/commands/schemacmds.h
@@ -18,12 +18,12 @@
#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
-extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
+extern Oid CreateSchemaCommand(CreateSchemaStmt *stmt,
const char *queryString,
int stmt_location, int stmt_len);
extern ObjectAddress RenameSchema(const char *oldname, const char *newname);
extern ObjectAddress AlterSchemaOwner(const char *name, Oid newOwnerId);
-extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId);
+extern void AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId);
#endif /* SCHEMACMDS_H */
diff --git a/src/include/commands/seclabel.h b/src/include/commands/seclabel.h
index 1577988f1..d8dec9965 100644
--- a/src/include/commands/seclabel.h
+++ b/src/include/commands/seclabel.h
@@ -28,7 +28,7 @@ extern ObjectAddress ExecSecLabelStmt(SecLabelStmt *stmt);
typedef void (*check_object_relabel_type) (const ObjectAddress *object,
const char *seclabel);
-extern void register_label_provider(const char *provider,
+extern void register_label_provider(const char *provider_name,
check_object_relabel_type hook);
#endif /* SECLABEL_H */
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index d38c0e238..b3b04ccfa 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -55,16 +55,16 @@ extern int64 nextval_internal(Oid relid, bool check_permissions);
extern Datum nextval(PG_FUNCTION_ARGS);
extern List *sequence_options(Oid relid);
-extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
+extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq);
extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
extern void DeleteSequenceTuple(Oid relid);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
-extern void seq_redo(XLogReaderState *rptr);
-extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
+extern void seq_redo(XLogReaderState *record);
+extern void seq_desc(StringInfo buf, XLogReaderState *record);
extern const char *seq_identify(uint8 info);
-extern void seq_mask(char *pagedata, BlockNumber blkno);
+extern void seq_mask(char *page, BlockNumber blkno);
#endif /* SEQUENCE_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 0c48654b9..03f14d6be 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -66,7 +66,7 @@ extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
extern bool CheckRelationTableSpaceMove(Relation rel, Oid newTableSpaceId);
extern void SetRelationTableSpace(Relation rel, Oid newTableSpaceId,
- RelFileNumber newRelFileNumber);
+ RelFileNumber newRelFilenumber);
extern ObjectAddress renameatt(RenameStmt *stmt);
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 1f8090711..a11c9e947 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -62,8 +62,8 @@ extern char *get_tablespace_name(Oid spc_oid);
extern bool directory_is_empty(const char *path);
extern void remove_tablespace_symlink(const char *linkloc);
-extern void tblspc_redo(XLogReaderState *rptr);
-extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
+extern void tblspc_redo(XLogReaderState *record);
+extern void tblspc_desc(StringInfo buf, XLogReaderState *record);
extern const char *tblspc_identify(uint8 info);
#endif /* TABLESPACE_H */
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index b7b6bd600..b0a928bbe 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -166,7 +166,7 @@ extern void TriggerSetParentTrigger(Relation trigRel,
Oid parentTrigId,
Oid childTableId);
extern void RemoveTriggerById(Oid trigOid);
-extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);
+extern Oid get_trigger_oid(Oid relid, const char *trigname, bool missing_ok);
extern ObjectAddress renametrig(RenameStmt *stmt);
@@ -231,22 +231,22 @@ extern bool ExecBRUpdateTriggers(EState *estate,
ResultRelInfo *relinfo,
ItemPointer tupleid,
HeapTuple fdw_trigtuple,
- TupleTableSlot *slot,
- TM_FailureData *tmfdp);
+ TupleTableSlot *newslot,
+ TM_FailureData *tmfd);
extern void ExecARUpdateTriggers(EState *estate,
ResultRelInfo *relinfo,
ResultRelInfo *src_partinfo,
ResultRelInfo *dst_partinfo,
ItemPointer tupleid,
HeapTuple fdw_trigtuple,
- TupleTableSlot *slot,
+ TupleTableSlot *newslot,
List *recheckIndexes,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
extern bool ExecIRUpdateTriggers(EState *estate,
ResultRelInfo *relinfo,
HeapTuple trigtuple,
- TupleTableSlot *slot);
+ TupleTableSlot *newslot);
extern void ExecBSTruncateTriggers(EState *estate,
ResultRelInfo *relinfo);
extern void ExecASTruncateTriggers(EState *estate,
@@ -267,9 +267,9 @@ extern bool AfterTriggerPendingOnRel(Oid relid);
* in utils/adt/ri_triggers.c
*/
extern bool RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_FKey_fk_upd_check_required(Trigger *trigger, Relation fk_rel,
- TupleTableSlot *old_slot, TupleTableSlot *new_slot);
+ TupleTableSlot *oldslot, TupleTableSlot *newslot);
extern bool RI_Initial_Check(Trigger *trigger,
Relation fk_rel, Relation pk_rel);
extern void RI_PartitionRemove_Check(Trigger *trigger, Relation fk_rel,
diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h
index a17bedb85..532bc49c3 100644
--- a/src/include/commands/typecmds.h
+++ b/src/include/commands/typecmds.h
@@ -34,7 +34,7 @@ extern Oid AssignTypeMultirangeArrayOid(void);
extern ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw);
extern ObjectAddress AlterDomainNotNull(List *names, bool notNull);
-extern ObjectAddress AlterDomainAddConstraint(List *names, Node *constr,
+extern ObjectAddress AlterDomainAddConstraint(List *names, Node *newConstraint,
ObjectAddress *constrAddr);
extern ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName);
extern ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName,
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index 63f2b6a80..a1751b370 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -26,8 +26,8 @@ extern char *pg_strdup(const char *in);
extern void *pg_malloc(size_t size);
extern void *pg_malloc0(size_t size);
extern void *pg_malloc_extended(size_t size, int flags);
-extern void *pg_realloc(void *pointer, size_t size);
-extern void pg_free(void *pointer);
+extern void *pg_realloc(void *ptr, size_t size);
+extern void pg_free(void *ptr);
/*
* Variants with easier notation and more type safety
diff --git a/src/include/common/kwlookup.h b/src/include/common/kwlookup.h
index 48d7f08b8..8384e33a5 100644
--- a/src/include/common/kwlookup.h
+++ b/src/include/common/kwlookup.h
@@ -32,7 +32,7 @@ typedef struct ScanKeywordList
} ScanKeywordList;
-extern int ScanKeywordLookup(const char *text, const ScanKeywordList *keywords);
+extern int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords);
/* Code that wants to retrieve the text of the N'th keyword should use this. */
static inline const char *
diff --git a/src/include/common/scram-common.h b/src/include/common/scram-common.h
index d1f840c11..e1f5e786e 100644
--- a/src/include/common/scram-common.h
+++ b/src/include/common/scram-common.h
@@ -49,7 +49,7 @@
extern int scram_SaltedPassword(const char *password, const char *salt,
int saltlen, int iterations, uint8 *result,
const char **errstr);
-extern int scram_H(const uint8 *str, int len, uint8 *result,
+extern int scram_H(const uint8 *input, int len, uint8 *result,
const char **errstr);
extern int scram_ClientKey(const uint8 *salted_password, uint8 *result,
const char **errstr);
diff --git a/src/include/fe_utils/cancel.h b/src/include/fe_utils/cancel.h
index 3b84daf6e..c256b04f4 100644
--- a/src/include/fe_utils/cancel.h
+++ b/src/include/fe_utils/cancel.h
@@ -27,6 +27,6 @@ extern void ResetCancelConn(void);
* A callback can be optionally set up to be called at cancellation
* time.
*/
-extern void setup_cancel_handler(void (*cancel_callback) (void));
+extern void setup_cancel_handler(void (*query_cancel_callback) (void));
#endif /* CANCEL_H */
diff --git a/src/include/fe_utils/mbprint.h b/src/include/fe_utils/mbprint.h
index 5dd218178..6bcd9e078 100644
--- a/src/include/fe_utils/mbprint.h
+++ b/src/include/fe_utils/mbprint.h
@@ -24,6 +24,7 @@ extern int pg_wcswidth(const char *pwcs, size_t len, int encoding);
extern void pg_wcsformat(const unsigned char *pwcs, size_t len, int encoding,
struct lineptr *lines, int count);
extern void pg_wcssize(const unsigned char *pwcs, size_t len, int encoding,
- int *width, int *height, int *format_size);
+ int *result_width, int *result_height,
+ int *result_format_size);
#endif /* MBPRINT_H */
diff --git a/src/include/fe_utils/parallel_slot.h b/src/include/fe_utils/parallel_slot.h
index 8ce63c937..199df9bb0 100644
--- a/src/include/fe_utils/parallel_slot.h
+++ b/src/include/fe_utils/parallel_slot.h
@@ -58,7 +58,7 @@ ParallelSlotClearHandler(ParallelSlot *slot)
slot->handler_context = NULL;
}
-extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *slots,
+extern ParallelSlot *ParallelSlotsGetIdle(ParallelSlotArray *sa,
const char *dbname);
extern ParallelSlotArray *ParallelSlotsSetup(int numslots, ConnParams *cparams,
diff --git a/src/include/fe_utils/recovery_gen.h b/src/include/fe_utils/recovery_gen.h
index 83e181a22..934952f31 100644
--- a/src/include/fe_utils/recovery_gen.h
+++ b/src/include/fe_utils/recovery_gen.h
@@ -21,7 +21,7 @@
#define MINIMUM_VERSION_FOR_RECOVERY_GUC 120000
extern PQExpBuffer GenerateRecoveryConfig(PGconn *pgconn,
- char *pg_replication_slot);
+ char *replication_slot);
extern void WriteRecoveryConfig(PGconn *pgconn, char *target_dir,
PQExpBuffer contents);
diff --git a/src/include/fe_utils/simple_list.h b/src/include/fe_utils/simple_list.h
index 9261a7b0a..757fd6ac5 100644
--- a/src/include/fe_utils/simple_list.h
+++ b/src/include/fe_utils/simple_list.h
@@ -65,6 +65,6 @@ extern void simple_string_list_destroy(SimpleStringList *list);
extern const char *simple_string_list_not_touched(SimpleStringList *list);
-extern void simple_ptr_list_append(SimplePtrList *list, void *val);
+extern void simple_ptr_list_append(SimplePtrList *list, void *ptr);
#endif /* SIMPLE_LIST_H */
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index fa4deb249..0927cb19b 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -24,7 +24,7 @@ extern PGDLLIMPORT int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);
/* Functions */
-extern const char *fmtId(const char *identifier);
+extern const char *fmtId(const char *rawid);
extern const char *fmtQualifiedId(const char *schema, const char *id);
extern char *formatPGVersionNumber(int version_number, bool include_minor,
diff --git a/src/include/foreign/foreign.h b/src/include/foreign/foreign.h
index 75538110f..ac8212553 100644
--- a/src/include/foreign/foreign.h
+++ b/src/include/foreign/foreign.h
@@ -67,12 +67,13 @@ typedef struct ForeignTable
extern ForeignServer *GetForeignServer(Oid serverid);
extern ForeignServer *GetForeignServerExtended(Oid serverid,
bits16 flags);
-extern ForeignServer *GetForeignServerByName(const char *name, bool missing_ok);
+extern ForeignServer *GetForeignServerByName(const char *srvname,
+ bool missing_ok);
extern UserMapping *GetUserMapping(Oid userid, Oid serverid);
extern ForeignDataWrapper *GetForeignDataWrapper(Oid fdwid);
extern ForeignDataWrapper *GetForeignDataWrapperExtended(Oid fdwid,
bits16 flags);
-extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *name,
+extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *fdwname,
bool missing_ok);
extern ForeignTable *GetForeignTable(Oid relid);
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index dc3d819a1..10dbe3981 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -348,7 +348,7 @@ extern void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx);
* "VARIADIC NULL".
*/
extern int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start,
- bool convert_unknown, Datum **values,
+ bool convert_unknown, Datum **args,
Oid **types, bool **nulls);
#endif /* FUNCAPI_H */
diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h
index 6687c8f4c..0d7b43d83 100644
--- a/src/include/libpq/pqmq.h
+++ b/src/include/libpq/pqmq.h
@@ -19,6 +19,6 @@
extern void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh);
extern void pq_set_parallel_leader(pid_t pid, BackendId backend_id);
-extern void pq_parse_errornotice(StringInfo str, ErrorData *edata);
+extern void pq_parse_errornotice(StringInfo msg, ErrorData *edata);
#endif /* PQMQ_H */
diff --git a/src/include/nodes/extensible.h b/src/include/nodes/extensible.h
index 34936db89..820b90484 100644
--- a/src/include/nodes/extensible.h
+++ b/src/include/nodes/extensible.h
@@ -72,8 +72,8 @@ typedef struct ExtensibleNodeMethods
void (*nodeRead) (struct ExtensibleNode *node);
} ExtensibleNodeMethods;
-extern void RegisterExtensibleNodeMethods(const ExtensibleNodeMethods *method);
-extern const ExtensibleNodeMethods *GetExtensibleNodeMethods(const char *name,
+extern void RegisterExtensibleNodeMethods(const ExtensibleNodeMethods *methods);
+extern const ExtensibleNodeMethods *GetExtensibleNodeMethods(const char *extnodename,
bool missing_ok);
/*
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index cdd6debfa..a80f43e54 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -218,7 +218,7 @@ extern int16 *readAttrNumberCols(int numCols);
/*
* nodes/copyfuncs.c
*/
-extern void *copyObjectImpl(const void *obj);
+extern void *copyObjectImpl(const void *from);
/* cast result back to argument type, if supported by compiler */
#ifdef HAVE_TYPEOF
diff --git a/src/include/nodes/params.h b/src/include/nodes/params.h
index de2dd907e..543543d68 100644
--- a/src/include/nodes/params.h
+++ b/src/include/nodes/params.h
@@ -163,8 +163,8 @@ extern ParamListInfo copyParamList(ParamListInfo from);
extern Size EstimateParamListSpace(ParamListInfo paramLI);
extern void SerializeParamList(ParamListInfo paramLI, char **start_address);
extern ParamListInfo RestoreParamList(char **start_address);
-extern char *BuildParamLogString(ParamListInfo params, char **paramTextValues,
- int valueLen);
+extern char *BuildParamLogString(ParamListInfo params, char **knownTextValues,
+ int maxlen);
extern void ParamsErrorCallback(void *arg);
#endif /* PARAMS_H */
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h
index a6e04d04a..dc991626b 100644
--- a/src/include/nodes/pg_list.h
+++ b/src/include/nodes/pg_list.h
@@ -619,9 +619,9 @@ extern void list_deduplicate_oid(List *list);
extern void list_free(List *list);
extern void list_free_deep(List *list);
-extern pg_nodiscard List *list_copy(const List *list);
+extern pg_nodiscard List *list_copy(const List *oldlist);
extern pg_nodiscard List *list_copy_head(const List *oldlist, int len);
-extern pg_nodiscard List *list_copy_tail(const List *list, int nskip);
+extern pg_nodiscard List *list_copy_tail(const List *oldlist, int nskip);
extern pg_nodiscard List *list_copy_deep(const List *oldlist);
typedef int (*list_sort_comparator) (const ListCell *a, const ListCell *b);
diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h
index 5e83b843d..91878e8b9 100644
--- a/src/include/nodes/value.h
+++ b/src/include/nodes/value.h
@@ -83,7 +83,7 @@ typedef struct BitString
extern Integer *makeInteger(int i);
extern Float *makeFloat(char *numericStr);
-extern Boolean *makeBoolean(bool var);
+extern Boolean *makeBoolean(bool val);
extern String *makeString(char *str);
extern BitString *makeBitString(char *str);
diff --git a/src/include/optimizer/appendinfo.h b/src/include/optimizer/appendinfo.h
index 5e80a741a..28568fab5 100644
--- a/src/include/optimizer/appendinfo.h
+++ b/src/include/optimizer/appendinfo.h
@@ -40,7 +40,7 @@ extern void get_translated_update_targetlist(PlannerInfo *root, Index relid,
List **update_colnos);
extern AppendRelInfo **find_appinfos_by_relids(PlannerInfo *root,
Relids relids, int *nappinfos);
-extern void add_row_identity_var(PlannerInfo *root, Var *rowid_var,
+extern void add_row_identity_var(PlannerInfo *root, Var *orig_var,
Index rtindex, const char *rowid_name);
extern void add_row_identity_columns(PlannerInfo *root, Index rtindex,
RangeTblEntry *target_rte,
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index 6c5203dc4..ff242d1b6 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -40,8 +40,8 @@ extern bool contain_leaked_vars(Node *clause);
extern Relids find_nonnullable_rels(Node *clause);
extern List *find_nonnullable_vars(Node *clause);
-extern List *find_forced_null_vars(Node *clause);
-extern Var *find_forced_null_var(Node *clause);
+extern List *find_forced_null_vars(Node *node);
+extern Var *find_forced_null_var(Node *node);
extern bool is_pseudo_constant_clause(Node *clause);
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 9e91da711..2e2eb705f 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -169,7 +169,7 @@ extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path,
JoinCostWorkspace *workspace,
JoinPathExtraData *extra);
extern void cost_gather(GatherPath *path, PlannerInfo *root,
- RelOptInfo *baserel, ParamPathInfo *param_info, double *rows);
+ RelOptInfo *rel, ParamPathInfo *param_info, double *rows);
extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
RelOptInfo *rel, ParamPathInfo *param_info,
Cost input_startup_cost, Cost input_total_cost,
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index d11cdac7f..881386997 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -170,8 +170,8 @@ extern void add_child_rel_equivalences(PlannerInfo *root,
extern void add_child_join_rel_equivalences(PlannerInfo *root,
int nappinfos,
AppendRelInfo **appinfos,
- RelOptInfo *parent_rel,
- RelOptInfo *child_rel);
+ RelOptInfo *parent_joinrel,
+ RelOptInfo *child_joinrel);
extern List *generate_implied_equalities_for_column(PlannerInfo *root,
RelOptInfo *rel,
ec_matches_callback_type callback,
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 1566f435b..9dffdcfd1 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -115,6 +115,6 @@ extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
extern bool trivial_subqueryscan(SubqueryScan *plan);
extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
extern void record_plan_type_dependency(PlannerInfo *root, Oid typid);
-extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *root);
+extern bool extract_query_dependencies_walker(Node *node, PlannerInfo *context);
#endif /* PLANMAIN_H */
diff --git a/src/include/optimizer/prep.h b/src/include/optimizer/prep.h
index 2b11ff1d1..5b4f350b3 100644
--- a/src/include/optimizer/prep.h
+++ b/src/include/optimizer/prep.h
@@ -45,7 +45,7 @@ extern PlanRowMark *get_plan_rowmark(List *rowmarks, Index rtindex);
* prototypes for prepagg.c
*/
extern void get_agg_clause_costs(PlannerInfo *root, AggSplit aggsplit,
- AggClauseCosts *agg_costs);
+ AggClauseCosts *costs);
extern void preprocess_aggrefs(PlannerInfo *root, Node *clause);
/*
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h
index dc379547c..3d3a5918c 100644
--- a/src/include/parser/analyze.h
+++ b/src/include/parser/analyze.h
@@ -43,7 +43,7 @@ extern List *transformInsertRow(ParseState *pstate, List *exprlist,
List *stmtcols, List *icolumns, List *attrnos,
bool strip_indirection);
extern List *transformUpdateTargetList(ParseState *pstate,
- List *targetList);
+ List *origTlist);
extern Query *transformTopLevelStmt(ParseState *pstate, RawStmt *parseTree);
extern Query *transformStmt(ParseState *pstate, Node *parseTree);
diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h
index c56822f64..0856af5b4 100644
--- a/src/include/parser/parse_agg.h
+++ b/src/include/parser/parse_agg.h
@@ -19,7 +19,7 @@ extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
List *args, List *aggorder,
bool agg_distinct);
-extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *g);
+extern Node *transformGroupingFunc(ParseState *pstate, GroupingFunc *p);
extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
WindowDef *windef);
diff --git a/src/include/parser/parse_oper.h b/src/include/parser/parse_oper.h
index e15b62290..7a57b199b 100644
--- a/src/include/parser/parse_oper.h
+++ b/src/include/parser/parse_oper.h
@@ -29,8 +29,8 @@ extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
/* Routines to find operators matching a name and given input types */
/* NB: the selected operator may require coercion of the input types! */
-extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2,
- bool noError, int location);
+extern Operator oper(ParseState *pstate, List *opname, Oid ltypeId,
+ Oid rtypeId, bool noError, int location);
extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
bool noError, int location);
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index de21c3c64..484db165d 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.h
@@ -88,7 +88,7 @@ extern ParseNamespaceItem *addRangeTableEntryForJoin(ParseState *pstate,
List *aliasvars,
List *leftcols,
List *rightcols,
- Alias *joinalias,
+ Alias *join_using_alias,
Alias *alias,
bool inFromCl);
extern ParseNamespaceItem *addRangeTableEntryForCTE(ParseState *pstate,
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index b1e3f1b84..1f5b706d8 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -98,7 +98,7 @@ typedef struct PartitionBoundInfoData
#define partition_bound_accepts_nulls(bi) ((bi)->null_index != -1)
#define partition_bound_has_default(bi) ((bi)->default_index != -1)
-extern int get_hash_partition_greatest_modulus(PartitionBoundInfo b);
+extern int get_hash_partition_greatest_modulus(PartitionBoundInfo bound);
extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
Oid *partcollation,
Datum *values, bool *isnull);
@@ -125,7 +125,7 @@ extern void check_new_partition_bound(char *relname, Relation parent,
PartitionBoundSpec *spec,
ParseState *pstate);
extern void check_default_partition_contents(Relation parent,
- Relation defaultRel,
+ Relation default_rel,
PartitionBoundSpec *new_spec);
extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc,
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index ac28f813b..ad7334a0d 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -417,7 +417,7 @@ extern long pgstat_report_stat(bool force);
extern void pgstat_force_next_flush(void);
extern void pgstat_reset_counters(void);
-extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objectid);
+extern void pgstat_reset(PgStat_Kind kind, Oid dboid, Oid objoid);
extern void pgstat_reset_of_kind(PgStat_Kind kind);
/* stats accessors */
@@ -474,7 +474,7 @@ extern void pgstat_report_connect(Oid dboid);
#define pgstat_count_conn_txn_idle_time(n) \
(pgStatTransactionIdleTime += (n))
-extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dbid);
+extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dboid);
/*
* Functions in pgstat_function.c
@@ -489,7 +489,7 @@ extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo,
extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu,
bool finalize);
-extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid funcid);
+extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid func_id);
extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
@@ -499,7 +499,7 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
extern void pgstat_create_relation(Relation rel);
extern void pgstat_drop_relation(Relation rel);
-extern void pgstat_copy_relation_stats(Relation dstrel, Relation srcrel);
+extern void pgstat_copy_relation_stats(Relation dst, Relation src);
extern void pgstat_init_relation(Relation rel);
extern void pgstat_assoc_relation(Relation rel);
@@ -571,7 +571,7 @@ extern void pgstat_twophase_postabort(TransactionId xid, uint16 info,
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry(Oid relid);
extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry_ext(bool shared,
- Oid relid);
+ Oid reloid);
extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
diff --git a/src/include/pgtime.h b/src/include/pgtime.h
index 1c44be8ba..9ee590600 100644
--- a/src/include/pgtime.h
+++ b/src/include/pgtime.h
@@ -75,8 +75,8 @@ extern bool pg_tz_acceptable(pg_tz *tz);
/* these functions are in strftime.c */
-extern size_t pg_strftime(char *s, size_t max, const char *format,
- const struct pg_tm *tm);
+extern size_t pg_strftime(char *s, size_t maxsize, const char *format,
+ const struct pg_tm *t);
/* these functions and variables are in pgtz.c */
diff --git a/src/include/port.h b/src/include/port.h
index fe48618df..3562d471b 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -46,14 +46,14 @@ extern bool pg_set_block(pgsocket sock);
/* Portable path handling for Unix/Win32 (in path.c) */
-extern bool has_drive_prefix(const char *filename);
+extern bool has_drive_prefix(const char *path);
extern char *first_dir_separator(const char *filename);
extern char *last_dir_separator(const char *filename);
extern char *first_path_var_separator(const char *pathlist);
extern void join_path_components(char *ret_path,
const char *head, const char *tail);
extern void canonicalize_path(char *path);
-extern void make_native_path(char *path);
+extern void make_native_path(char *filename);
extern void cleanup_path(char *path);
extern bool path_contains_parent_reference(const char *path);
extern bool path_is_relative_and_below_cwd(const char *path);
@@ -439,7 +439,7 @@ extern void qsort_arg(void *base, size_t nel, size_t elsize,
extern void qsort_interruptible(void *base, size_t nel, size_t elsize,
qsort_arg_comparator cmp, void *arg);
-extern void *bsearch_arg(const void *key, const void *base,
+extern void *bsearch_arg(const void *key, const void *base0,
size_t nmemb, size_t size,
int (*compar) (const void *, const void *, void *),
void *arg);
@@ -479,7 +479,7 @@ extern pqsigfunc pqsignal(int signo, pqsigfunc func);
extern char *escape_single_quotes_ascii(const char *src);
/* common/wait_error.c */
-extern char *wait_result_to_str(int exit_status);
+extern char *wait_result_to_str(int exitstatus);
extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
diff --git a/src/include/postmaster/bgworker.h b/src/include/postmaster/bgworker.h
index 96975bdc9..271b94616 100644
--- a/src/include/postmaster/bgworker.h
+++ b/src/include/postmaster/bgworker.h
@@ -121,7 +121,7 @@ extern bool RegisterDynamicBackgroundWorker(BackgroundWorker *worker,
/* Query the status of a bgworker */
extern BgwHandleStatus GetBackgroundWorkerPid(BackgroundWorkerHandle *handle,
pid_t *pidp);
-extern BgwHandleStatus WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pid);
+extern BgwHandleStatus WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pidp);
extern BgwHandleStatus
WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle *);
extern const char *GetBackgroundWorkerTypeByPid(pid_t pid);
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
index 6436724f3..d4c33c844 100644
--- a/src/include/postmaster/syslogger.h
+++ b/src/include/postmaster/syslogger.h
@@ -84,7 +84,7 @@ extern PGDLLIMPORT HANDLE syslogPipe[2];
extern int SysLogger_Start(void);
-extern void write_syslogger_file(const char *buffer, int count, int dest);
+extern void write_syslogger_file(const char *buffer, int count, int destination);
#ifdef EXEC_BACKEND
extern void SysLoggerMain(int argc, char *argv[]) pg_attribute_noreturn();
diff --git a/src/include/rewrite/rewriteManip.h b/src/include/rewrite/rewriteManip.h
index 98b9b3a28..f001ca41b 100644
--- a/src/include/rewrite/rewriteManip.h
+++ b/src/include/rewrite/rewriteManip.h
@@ -42,7 +42,7 @@ typedef enum ReplaceVarsNoMatchOption
extern void OffsetVarNodes(Node *node, int offset, int sublevels_up);
-extern void ChangeVarNodes(Node *node, int old_varno, int new_varno,
+extern void ChangeVarNodes(Node *node, int rt_index, int new_index,
int sublevels_up);
extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up,
int min_sublevels_up);
diff --git a/src/include/snowball/libstemmer/header.h b/src/include/snowball/libstemmer/header.h
index bf172d5b9..ef5a54640 100644
--- a/src/include/snowball/libstemmer/header.h
+++ b/src/include/snowball/libstemmer/header.h
@@ -45,7 +45,7 @@ extern int eq_v_b(struct SN_env * z, const symbol * p);
extern int find_among(struct SN_env * z, const struct among * v, int v_size);
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
-extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
+extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr);
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
extern int slice_from_v(struct SN_env * z, const symbol * p);
extern int slice_del(struct SN_env * z);
diff --git a/src/include/statistics/extended_stats_internal.h b/src/include/statistics/extended_stats_internal.h
index 71f852c15..906919d88 100644
--- a/src/include/statistics/extended_stats_internal.h
+++ b/src/include/statistics/extended_stats_internal.h
@@ -79,7 +79,7 @@ extern MVDependencies *statext_dependencies_deserialize(bytea *data);
extern MCVList *statext_mcv_build(StatsBuildData *data,
double totalrows, int stattarget);
-extern bytea *statext_mcv_serialize(MCVList *mcv, VacAttrStats **stats);
+extern bytea *statext_mcv_serialize(MCVList *mcvlist, VacAttrStats **stats);
extern MCVList *statext_mcv_deserialize(bytea *data);
extern MultiSortSupport multi_sort_init(int ndims);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index bb7ef1240..0351927a2 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -102,8 +102,8 @@ extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalro
int numrows, HeapTuple *rows,
int natts, VacAttrStats **vacattrstats);
extern int ComputeExtStatisticsRows(Relation onerel,
- int natts, VacAttrStats **stats);
-extern bool statext_is_kind_built(HeapTuple htup, char kind);
+ int natts, VacAttrStats **vacattrstats);
+extern bool statext_is_kind_built(HeapTuple htup, char type);
extern Selectivity dependencies_clauselist_selectivity(PlannerInfo *root,
List *clauses,
int varRelid,
diff --git a/src/include/tcop/cmdtag.h b/src/include/tcop/cmdtag.h
index b9e8992a4..60e3179c7 100644
--- a/src/include/tcop/cmdtag.h
+++ b/src/include/tcop/cmdtag.h
@@ -53,6 +53,6 @@ extern const char *GetCommandTagName(CommandTag commandTag);
extern bool command_tag_display_rowcount(CommandTag commandTag);
extern bool command_tag_event_trigger_ok(CommandTag commandTag);
extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
-extern CommandTag GetCommandTagEnum(const char *tagname);
+extern CommandTag GetCommandTagEnum(const char *commandname);
#endif /* CMDTAG_H */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
index c36c711da..fd73b3844 100644
--- a/src/include/tsearch/ts_utils.h
+++ b/src/include/tsearch/ts_utils.h
@@ -32,8 +32,8 @@ typedef struct TSVectorParseStateData *TSVectorParseState;
extern TSVectorParseState init_tsvector_parser(char *input, int flags);
extern void reset_tsvector_parser(TSVectorParseState state, char *input);
extern bool gettoken_tsvector(TSVectorParseState state,
- char **token, int *len,
- WordEntryPos **pos, int *poslen,
+ char **strval, int *lenval,
+ WordEntryPos **pos_ptr, int *poslen,
char **endptr);
extern void close_tsvector_parser(TSVectorParseState state);
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 3d6411197..9a4df3a5d 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -214,8 +214,8 @@ extern bool is_member_of_role_nosuper(Oid member, Oid role);
extern bool is_admin_of_role(Oid member, Oid role);
extern Oid select_best_admin(Oid member, Oid role);
extern void check_is_member_of_role(Oid member, Oid role);
-extern Oid get_role_oid(const char *rolename, bool missing_ok);
-extern Oid get_role_oid_or_public(const char *rolename);
+extern Oid get_role_oid(const char *rolname, bool missing_ok);
+extern Oid get_role_oid_or_public(const char *rolname);
extern Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok);
extern void check_rolespec_name(const RoleSpec *role, const char *detail_msg);
extern HeapTuple get_rolespec_tuple(const RoleSpec *role);
@@ -285,7 +285,7 @@ extern AclResult pg_parameter_acl_aclcheck(Oid acl_oid, Oid roleid,
AclMode mode);
extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode);
extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode);
-extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid,
+extern AclResult pg_largeobject_aclcheck_snapshot(Oid lobj_oid, Oid roleid,
AclMode mode, Snapshot snapshot);
extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode);
extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode);
diff --git a/src/include/utils/attoptcache.h b/src/include/utils/attoptcache.h
index ee37af950..49ae64721 100644
--- a/src/include/utils/attoptcache.h
+++ b/src/include/utils/attoptcache.h
@@ -23,6 +23,6 @@ typedef struct AttributeOpts
float8 n_distinct_inherited;
} AttributeOpts;
-extern AttributeOpts *get_attribute_options(Oid spcid, int attnum);
+extern AttributeOpts *get_attribute_options(Oid attrelid, int attnum);
#endif /* ATTOPTCACHE_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 221c3e6c3..81631f164 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -47,10 +47,10 @@ extern int16 pg_strtoint16(const char *s);
extern int32 pg_strtoint32(const char *s);
extern int64 pg_strtoint64(const char *s);
extern int pg_itoa(int16 i, char *a);
-extern int pg_ultoa_n(uint32 l, char *a);
-extern int pg_ulltoa_n(uint64 l, char *a);
-extern int pg_ltoa(int32 l, char *a);
-extern int pg_lltoa(int64 ll, char *a);
+extern int pg_ultoa_n(uint32 value, char *a);
+extern int pg_ulltoa_n(uint64 value, char *a);
+extern int pg_ltoa(int32 value, char *a);
+extern int pg_lltoa(int64 value, char *a);
extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
extern char *pg_ultostr(char *str, uint32 value);
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 4527e8251..2cae346be 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -327,7 +327,7 @@ extern int DecodeTimezoneAbbrev(int field, char *lowtoken,
extern int DecodeSpecial(int field, char *lowtoken, int *val);
extern int DecodeUnits(int field, char *lowtoken, int *val);
-extern int j2day(int jd);
+extern int j2day(int date);
extern Node *TemporalSimplify(int32 max_precis, Node *node);
diff --git a/src/include/utils/multirangetypes.h b/src/include/utils/multirangetypes.h
index 915330f99..bc3339205 100644
--- a/src/include/utils/multirangetypes.h
+++ b/src/include/utils/multirangetypes.h
@@ -64,7 +64,7 @@ extern bool multirange_ne_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr2);
extern bool multirange_contains_elem_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
- Datum elem);
+ Datum val);
extern bool multirange_contains_range_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
const RangeType *r);
@@ -115,11 +115,11 @@ extern MultirangeType *multirange_intersect_internal(Oid mltrngtypoid,
extern TypeCacheEntry *multirange_get_typcache(FunctionCallInfo fcinfo,
Oid mltrngtypid);
extern void multirange_deserialize(TypeCacheEntry *rangetyp,
- const MultirangeType *range,
+ const MultirangeType *multirange,
int32 *range_count,
RangeType ***ranges);
extern MultirangeType *make_multirange(Oid mltrngtypoid,
- TypeCacheEntry *typcache,
+ TypeCacheEntry *rangetyp,
int32 range_count, RangeType **ranges);
extern MultirangeType *make_empty_multirange(Oid mltrngtypoid,
TypeCacheEntry *rangetyp);
diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h
index 3caa74dfe..09d355e81 100644
--- a/src/include/utils/numeric.h
+++ b/src/include/utils/numeric.h
@@ -85,6 +85,6 @@ extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2,
bool *have_error);
extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2,
bool *have_error);
-extern int32 numeric_int4_opt_error(Numeric num, bool *error);
+extern int32 numeric_int4_opt_error(Numeric num, bool *have_error);
#endif /* _PG_NUMERIC_H_ */
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 901d2041d..40a360285 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -567,7 +567,7 @@ extern void pgstat_relation_delete_pending_cb(PgStat_EntryRef *entry_ref);
*/
extern void pgstat_replslot_reset_timestamp_cb(PgStatShared_Common *header, TimestampTz ts);
-extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *tmp, NameData *name);
+extern void pgstat_replslot_to_serialized_name_cb(const PgStatShared_Common *header, NameData *name);
extern bool pgstat_replslot_from_serialized_name_cb(const NameData *name, PgStat_HashKey *key);
@@ -579,7 +579,7 @@ extern void pgstat_attach_shmem(void);
extern void pgstat_detach_shmem(void);
extern PgStat_EntryRef *pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objoid,
- bool create, bool *found);
+ bool create, bool *created_entry);
extern bool pgstat_lock_entry(PgStat_EntryRef *entry_ref, bool nowait);
extern bool pgstat_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait);
extern void pgstat_unlock_entry(PgStat_EntryRef *entry_ref);
diff --git a/src/include/utils/rangetypes.h b/src/include/utils/rangetypes.h
index 993fad4fc..b62f1ea48 100644
--- a/src/include/utils/rangetypes.h
+++ b/src/include/utils/rangetypes.h
@@ -141,8 +141,8 @@ extern int range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1,
extern int range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1,
const RangeBound *b2);
extern int range_compare(const void *key1, const void *key2, void *arg);
-extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound bound1,
- RangeBound bound2);
+extern bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound boundA,
+ RangeBound boundB);
extern RangeType *make_empty_range(TypeCacheEntry *typcache);
extern bool range_split_internal(TypeCacheEntry *typcache, const RangeType *r1,
const RangeType *r2, RangeType **output1,
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h
index a36ceba7a..0e2965ff9 100644
--- a/src/include/utils/regproc.h
+++ b/src/include/utils/regproc.h
@@ -28,7 +28,7 @@ extern char *format_operator_extended(Oid operator_oid, bits16 flags);
extern List *stringToQualifiedNameList(const char *string);
extern char *format_procedure(Oid procedure_oid);
extern char *format_procedure_qualified(Oid procedure_oid);
-extern void format_procedure_parts(Oid operator_oid, List **objnames,
+extern void format_procedure_parts(Oid procedure_oid, List **objnames,
List **objargs, bool missing_ok);
extern char *format_operator(Oid operator_oid);
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index ba35d6b3b..73106b6fc 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -50,7 +50,7 @@ extern Oid RelationGetReplicaIndex(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);
extern List *RelationGetDummyIndexExpressions(Relation relation);
extern List *RelationGetIndexPredicate(Relation relation);
-extern Datum *RelationGetIndexRawAttOptions(Relation relation);
+extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
typedef enum IndexAttrBitmapKind
diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h
index 2bb2e255f..92f1f779a 100644
--- a/src/include/utils/relmapper.h
+++ b/src/include/utils/relmapper.h
@@ -37,7 +37,7 @@ typedef struct xl_relmap_update
extern RelFileNumber RelationMapOidToFilenumber(Oid relationId, bool shared);
-extern Oid RelationMapFilenumberToOid(RelFileNumber relationId, bool shared);
+extern Oid RelationMapFilenumberToOid(RelFileNumber filenumber, bool shared);
extern RelFileNumber RelationMapOidToFilenumberForDatabase(char *dbpath,
Oid relationId);
extern void RelationMapCopy(Oid dbid, Oid tsid, char *srcdbpath,
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
index d485b9bfc..49af4ed2e 100644
--- a/src/include/utils/selfuncs.h
+++ b/src/include/utils/selfuncs.h
@@ -181,11 +181,11 @@ extern double ineq_histogram_selectivity(PlannerInfo *root,
Oid collation,
Datum constval, Oid consttype);
extern double var_eq_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Datum constval, bool constisnull,
bool varonleft, bool negate);
extern double var_eq_non_const(VariableStatData *vardata,
- Oid oproid, Oid collation,
+ Oid operator, Oid collation,
Node *other,
bool varonleft, bool negate);
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 06eafdf11..9f4dd5360 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -169,7 +169,7 @@ extern bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
/* Support for catalog timetravel for logical decoding */
struct HTAB;
extern struct HTAB *HistoricSnapshotGetTupleCids(void);
-extern void SetupHistoricSnapshot(Snapshot snapshot_now, struct HTAB *tuplecids);
+extern void SetupHistoricSnapshot(Snapshot historic_snapshot, struct HTAB *tuplecids);
extern void TeardownHistoricSnapshot(bool is_error);
extern bool HistoricSnapshotActive(void);
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index edf3a9731..820c08941 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -83,10 +83,10 @@ extern pg_time_t timestamptz_to_time_t(TimestampTz t);
extern const char *timestamptz_to_str(TimestampTz t);
-extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *dt);
+extern int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result);
extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm,
fsec_t *fsec, const char **tzn, pg_tz *attimezone);
-extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec);
+extern void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec);
extern void interval2itm(Interval span, struct pg_itm *itm);
extern int itm2interval(struct pg_itm *itm, Interval *span);
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index e82b5a638..444127499 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -372,7 +372,7 @@ extern const char *tuplesort_space_type_name(TuplesortSpaceType t);
extern int tuplesort_merge_order(int64 allowedMem);
-extern Size tuplesort_estimate_shared(int nworkers);
+extern Size tuplesort_estimate_shared(int nWorkers);
extern void tuplesort_initialize_shared(Sharedsort *shared, int nWorkers,
dsm_segment *seg);
extern void tuplesort_attach_shared(Sharedsort *shared, dsm_segment *seg);
diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h
index 6620a6261..bfd0abf9c 100644
--- a/src/include/utils/xml.h
+++ b/src/include/utils/xml.h
@@ -64,7 +64,7 @@ extern xmltype *xmlconcat(List *args);
extern xmltype *xmlelement(XmlExpr *xexpr,
Datum *named_argvalue, bool *named_argnull,
Datum *argvalue, bool *argnull);
-extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace);
+extern xmltype *xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace);
extern xmltype *xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null);
extern xmltype *xmlroot(xmltype *data, text *version, int standalone);
extern bool xml_is_document(xmltype *arg);
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
index 1f1cff1a5..dd103a868 100644
--- a/src/backend/backup/basebackup.c
+++ b/src/backend/backup/basebackup.c
@@ -74,7 +74,7 @@ typedef struct
pg_checksum_type manifest_checksum_type;
} basebackup_options;
-static int64 sendTablespace(bbsink *sink, char *path, char *oid, bool sizeonly,
+static int64 sendTablespace(bbsink *sink, char *path, char *spcoid, bool sizeonly,
struct backup_manifest_info *manifest);
static int64 sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly,
List *tablespaces, bool sendtblspclinks,
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index 58752368e..22635f809 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -463,19 +463,19 @@ boot_openrel(char *relname)
* ----------------
*/
void
-closerel(char *name)
+closerel(char *relname)
{
- if (name)
+ if (relname)
{
if (boot_reldesc)
{
- if (strcmp(RelationGetRelationName(boot_reldesc), name) != 0)
+ if (strcmp(RelationGetRelationName(boot_reldesc), relname) != 0)
elog(ERROR, "close of %s when %s was expected",
- name, RelationGetRelationName(boot_reldesc));
+ relname, RelationGetRelationName(boot_reldesc));
}
else
elog(ERROR, "close of %s before any relation was opened",
- name);
+ relname);
}
if (boot_reldesc == NULL)
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 635d05405..441f29d68 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -94,7 +94,7 @@ static void AlterEventTriggerOwner_internal(Relation rel,
static void error_duplicate_filter_variable(const char *defname);
static Datum filter_list_to_array(List *filterlist);
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
- Oid evtOwner, Oid funcoid, List *tags);
+ Oid evtOwner, Oid funcoid, List *taglist);
static void validate_ddl_tags(const char *filtervar, List *taglist);
static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 053d2ca5a..f86983c66 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -111,7 +111,7 @@ static void show_incremental_sort_info(IncrementalSortState *incrsortstate,
static void show_hash_info(HashState *hashstate, ExplainState *es);
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
ExplainState *es);
-static void show_hashagg_info(AggState *hashstate, ExplainState *es);
+static void show_hashagg_info(AggState *aggstate, ExplainState *es);
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
ExplainState *es);
static void show_instrumentation_count(const char *qlabel, int which,
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index cf98d9e60..fd56066c1 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -98,7 +98,7 @@ static Oid ReindexTable(RangeVar *relation, ReindexParams *params,
bool isTopLevel);
static void ReindexMultipleTables(const char *objectName,
ReindexObjectType objectKind, ReindexParams *params);
-static void reindex_error_callback(void *args);
+static void reindex_error_callback(void *arg);
static void ReindexPartitions(Oid relid, ReindexParams *params,
bool isTopLevel);
static void ReindexMultipleInternal(List *relids,
diff --git a/src/backend/commands/lockcmds.c b/src/backend/commands/lockcmds.c
index b97b8b043..b0747ce29 100644
--- a/src/backend/commands/lockcmds.c
+++ b/src/backend/commands/lockcmds.c
@@ -29,7 +29,7 @@
#include "utils/syscache.h"
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait);
-static AclResult LockTableAclCheck(Oid relid, LOCKMODE lockmode, Oid userid);
+static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid);
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid,
Oid oldrelid, void *arg);
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 7a931ab75..775553ec7 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -52,7 +52,7 @@
static void AlterOpFamilyAdd(AlterOpFamilyStmt *stmt,
Oid amoid, Oid opfamilyoid,
int maxOpNumber, int maxProcNumber,
- int opclassOptsProcNumber, List *items);
+ int optsProcNumber, List *items);
static void AlterOpFamilyDrop(AlterOpFamilyStmt *stmt,
Oid amoid, Oid opfamilyoid,
int maxOpNumber, int maxProcNumber,
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index a583aa430..134610497 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -285,16 +285,16 @@ RenameSchema(const char *oldname, const char *newname)
}
void
-AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
+AlterSchemaOwner_oid(Oid schemaoid, Oid newOwnerId)
{
HeapTuple tup;
Relation rel;
rel = table_open(NamespaceRelationId, RowExclusiveLock);
- tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(oid));
+ tup = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(schemaoid));
if (!HeapTupleIsValid(tup))
- elog(ERROR, "cache lookup failed for schema %u", oid);
+ elog(ERROR, "cache lookup failed for schema %u", schemaoid);
AlterSchemaOwner_internal(tup, rel, newOwnerId);
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e3233a8f3..6c52edd9b 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -550,7 +550,7 @@ static ObjectAddress ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
AlterTableCmd *cmd, LOCKMODE lockmode);
static void RememberConstraintForRebuilding(Oid conoid, AlteredTableInfo *tab);
static void RememberIndexForRebuilding(Oid indoid, AlteredTableInfo *tab);
-static void RememberStatisticsForRebuilding(Oid indoid, AlteredTableInfo *tab);
+static void RememberStatisticsForRebuilding(Oid stxoid, AlteredTableInfo *tab);
static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab,
LOCKMODE lockmode);
static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
@@ -610,7 +610,7 @@ static void ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partPa
List **partexprs, Oid *partopclass, Oid *partcollation, char strategy);
static void CreateInheritance(Relation child_rel, Relation parent_rel);
static void RemoveInheritance(Relation child_rel, Relation parent_rel,
- bool allow_detached);
+ bool expect_detached);
static ObjectAddress ATExecAttachPartition(List **wqueue, Relation rel,
PartitionCmd *cmd,
AlterTableUtilityContext *context);
@@ -627,7 +627,7 @@ static ObjectAddress ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab,
static void DetachPartitionFinalize(Relation rel, Relation partRel,
bool concurrent, Oid defaultPartOid);
static ObjectAddress ATExecDetachPartitionFinalize(Relation rel, RangeVar *name);
-static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation rel,
+static ObjectAddress ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx,
RangeVar *name);
static void validatePartitionedIndex(Relation partedIdx, Relation partedTbl);
static void refuseDupeIndexAttach(Relation parentIdx, Relation partIdx,
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 5ad18d2de..6f5a5262c 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -86,8 +86,8 @@ static bool GetTupleForTrigger(EState *estate,
ItemPointer tid,
LockTupleMode lockmode,
TupleTableSlot *oldslot,
- TupleTableSlot **newSlot,
- TM_FailureData *tmfpd);
+ TupleTableSlot **epqslot,
+ TM_FailureData *tmfdp);
static bool TriggerEnabled(EState *estate, ResultRelInfo *relinfo,
Trigger *trigger, TriggerEvent event,
Bitmapset *modifiedCols,
@@ -101,7 +101,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
ResultRelInfo *src_partinfo,
ResultRelInfo *dst_partinfo,
int event, bool row_trigger,
- TupleTableSlot *oldtup, TupleTableSlot *newtup,
+ TupleTableSlot *oldslot, TupleTableSlot *newslot,
List *recheckIndexes, Bitmapset *modifiedCols,
TransitionCaptureState *transition_capture,
bool is_crosspart_update);
@@ -3871,7 +3871,7 @@ static void TransitionTableAddTuple(EState *estate,
Tuplestorestate *tuplestore);
static void AfterTriggerFreeQuery(AfterTriggersQueryData *qs);
static SetConstraintState SetConstraintStateCreate(int numalloc);
-static SetConstraintState SetConstraintStateCopy(SetConstraintState state);
+static SetConstraintState SetConstraintStateCopy(SetConstraintState origstate);
static SetConstraintState SetConstraintStateAddItem(SetConstraintState state,
Oid tgoid, bool tgisdeferred);
static void cancel_prior_stmt_triggers(Oid relid, CmdType cmdType, int tgevent);
diff --git a/src/backend/lib/dshash.c b/src/backend/lib/dshash.c
index c5c032a59..d39cde9cc 100644
--- a/src/backend/lib/dshash.c
+++ b/src/backend/lib/dshash.c
@@ -167,7 +167,7 @@ struct dshash_table
static void delete_item(dshash_table *hash_table,
dshash_table_item *item);
-static void resize(dshash_table *hash_table, size_t new_size);
+static void resize(dshash_table *hash_table, size_t new_size_log2);
static inline void ensure_valid_bucket_pointers(dshash_table *hash_table);
static inline dshash_table_item *find_in_bucket(dshash_table *hash_table,
const void *key,
diff --git a/src/backend/lib/integerset.c b/src/backend/lib/integerset.c
index 41d3abdb0..345cd1b3a 100644
--- a/src/backend/lib/integerset.c
+++ b/src/backend/lib/integerset.c
@@ -264,9 +264,9 @@ static void intset_update_upper(IntegerSet *intset, int level,
intset_node *child, uint64 child_key);
static void intset_flush_buffered_values(IntegerSet *intset);
-static int intset_binsrch_uint64(uint64 value, uint64 *arr, int arr_elems,
+static int intset_binsrch_uint64(uint64 item, uint64 *arr, int arr_elems,
bool nextkey);
-static int intset_binsrch_leaf(uint64 value, leaf_item *arr, int arr_elems,
+static int intset_binsrch_leaf(uint64 item, leaf_item *arr, int arr_elems,
bool nextkey);
static uint64 simple8b_encode(const uint64 *ints, int *num_encoded, uint64 base);
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 035655738..cb702e0fd 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -62,10 +62,10 @@ static BIO_METHOD *my_BIO_s_socket(void);
static int my_SSL_set_fd(Port *port, int fd);
static DH *load_dh_file(char *filename, bool isServerStart);
-static DH *load_dh_buffer(const char *, size_t);
+static DH *load_dh_buffer(const char *buffer, size_t len);
static int ssl_external_passwd_cb(char *buf, int size, int rwflag, void *userdata);
static int dummy_ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);
-static int verify_cb(int, X509_STORE_CTX *);
+static int verify_cb(int ok, X509_STORE_CTX *ctx);
static void info_cb(const SSL *ssl, int type, int args);
static bool initialize_dh(SSL_CTX *context, bool isServerStart);
static bool initialize_ecdh(SSL_CTX *context, bool isServerStart);
diff --git a/src/backend/optimizer/geqo/geqo_selection.c b/src/backend/optimizer/geqo/geqo_selection.c
index 50f678a49..fd3f6894d 100644
--- a/src/backend/optimizer/geqo/geqo_selection.c
+++ b/src/backend/optimizer/geqo/geqo_selection.c
@@ -42,7 +42,7 @@
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_selection.h"
-static int linear_rand(PlannerInfo *root, int max, double bias);
+static int linear_rand(PlannerInfo *root, int pool_size, double bias);
/*
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index f486d4244..a4f581e8c 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -2517,38 +2517,38 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)
* Determines and returns the cost of an Append node.
*/
void
-cost_append(AppendPath *apath, PlannerInfo *root)
+cost_append(AppendPath *path, PlannerInfo *root)
{
ListCell *l;
- apath->path.startup_cost = 0;
- apath->path.total_cost = 0;
- apath->path.rows = 0;
+ path->path.startup_cost = 0;
+ path->path.total_cost = 0;
+ path->path.rows = 0;
- if (apath->subpaths == NIL)
+ if (path->subpaths == NIL)
return;
- if (!apath->path.parallel_aware)
+ if (!path->path.parallel_aware)
{
- List *pathkeys = apath->path.pathkeys;
+ List *pathkeys = path->path.pathkeys;
if (pathkeys == NIL)
{
- Path *subpath = (Path *) linitial(apath->subpaths);
+ Path *subpath = (Path *) linitial(path->subpaths);
/*
* For an unordered, non-parallel-aware Append we take the startup
* cost as the startup cost of the first subpath.
*/
- apath->path.startup_cost = subpath->startup_cost;
+ path->path.startup_cost = subpath->startup_cost;
/* Compute rows and costs as sums of subplan rows and costs. */
- foreach(l, apath->subpaths)
+ foreach(l, path->subpaths)
{
Path *subpath = (Path *) lfirst(l);
- apath->path.rows += subpath->rows;
- apath->path.total_cost += subpath->total_cost;
+ path->path.rows += subpath->rows;
+ path->path.total_cost += subpath->total_cost;
}
}
else
@@ -2571,7 +2571,7 @@ cost_append(AppendPath *apath, PlannerInfo *root)
* account for possibly injecting sorts into subpaths that aren't
* natively ordered.
*/
- foreach(l, apath->subpaths)
+ foreach(l, path->subpaths)
{
Path *subpath = (Path *) lfirst(l);
Path sort_path; /* dummy for result of cost_sort */
@@ -2592,26 +2592,26 @@ cost_append(AppendPath *apath, PlannerInfo *root)
subpath->pathtarget->width,
0.0,
work_mem,
- apath->limit_tuples);
+ path->limit_tuples);
subpath = &sort_path;
}
- apath->path.rows += subpath->rows;
- apath->path.startup_cost += subpath->startup_cost;
- apath->path.total_cost += subpath->total_cost;
+ path->path.rows += subpath->rows;
+ path->path.startup_cost += subpath->startup_cost;
+ path->path.total_cost += subpath->total_cost;
}
}
}
else /* parallel-aware */
{
int i = 0;
- double parallel_divisor = get_parallel_divisor(&apath->path);
+ double parallel_divisor = get_parallel_divisor(&path->path);
/* Parallel-aware Append never produces ordered output. */
- Assert(apath->path.pathkeys == NIL);
+ Assert(path->path.pathkeys == NIL);
/* Calculate startup cost. */
- foreach(l, apath->subpaths)
+ foreach(l, path->subpaths)
{
Path *subpath = (Path *) lfirst(l);
@@ -2621,10 +2621,10 @@ cost_append(AppendPath *apath, PlannerInfo *root)
* first few subplans that immediately get a worker assigned.
*/
if (i == 0)
- apath->path.startup_cost = subpath->startup_cost;
- else if (i < apath->path.parallel_workers)
- apath->path.startup_cost = Min(apath->path.startup_cost,
- subpath->startup_cost);
+ path->path.startup_cost = subpath->startup_cost;
+ else if (i < path->path.parallel_workers)
+ path->path.startup_cost = Min(path->path.startup_cost,
+ subpath->startup_cost);
/*
* Apply parallel divisor to subpaths. Scale the number of rows
@@ -2633,36 +2633,36 @@ cost_append(AppendPath *apath, PlannerInfo *root)
* Also add the cost of partial paths to the total cost, but
* ignore non-partial paths for now.
*/
- if (i < apath->first_partial_path)
- apath->path.rows += subpath->rows / parallel_divisor;
+ if (i < path->first_partial_path)
+ path->path.rows += subpath->rows / parallel_divisor;
else
{
double subpath_parallel_divisor;
subpath_parallel_divisor = get_parallel_divisor(subpath);
- apath->path.rows += subpath->rows * (subpath_parallel_divisor /
- parallel_divisor);
- apath->path.total_cost += subpath->total_cost;
+ path->path.rows += subpath->rows * (subpath_parallel_divisor /
+ parallel_divisor);
+ path->path.total_cost += subpath->total_cost;
}
- apath->path.rows = clamp_row_est(apath->path.rows);
+ path->path.rows = clamp_row_est(path->path.rows);
i++;
}
/* Add cost for non-partial subpaths. */
- apath->path.total_cost +=
- append_nonpartial_cost(apath->subpaths,
- apath->first_partial_path,
- apath->path.parallel_workers);
+ path->path.total_cost +=
+ append_nonpartial_cost(path->subpaths,
+ path->first_partial_path,
+ path->path.parallel_workers);
}
/*
* Although Append does not do any selection or projection, it's not free;
* add a small per-tuple overhead.
*/
- apath->path.total_cost +=
- cpu_tuple_cost * APPEND_CPU_COST_MULTIPLIER * apath->path.rows;
+ path->path.total_cost +=
+ cpu_tuple_cost * APPEND_CPU_COST_MULTIPLIER * path->path.rows;
}
/*
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index cd8a3ef7c..ab4d8e201 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -311,7 +311,7 @@ static ModifyTable *make_modifytable(PlannerInfo *root, Plan *subplan,
List *updateColnosLists,
List *withCheckOptionLists, List *returningLists,
List *rowMarks, OnConflictExpr *onconflict,
- List *mergeActionList, int epqParam);
+ List *mergeActionLists, int epqParam);
static GatherMerge *create_gather_merge_plan(PlannerInfo *root,
GatherMergePath *best_path);
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index c0bdc77d3..8014d1fd2 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -3086,13 +3086,13 @@ extract_rollup_sets(List *groupingSets)
* gets implemented in one pass.)
*/
static List *
-reorder_grouping_sets(List *groupingsets, List *sortclause)
+reorder_grouping_sets(List *groupingSets, List *sortclause)
{
ListCell *lc;
List *previous = NIL;
List *result = NIL;
- foreach(lc, groupingsets)
+ foreach(lc, groupingSets)
{
List *candidate = (List *) lfirst(lc);
List *new_elems = list_difference_int(candidate, previous);
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 5012bfe14..6d5718ee4 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -75,7 +75,8 @@ static List *build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
static List *get_relation_statistics(RelOptInfo *rel, Relation relation);
static void set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
Relation relation);
-static PartitionScheme find_partition_scheme(PlannerInfo *root, Relation rel);
+static PartitionScheme find_partition_scheme(PlannerInfo *root,
+ Relation relation);
static void set_baserel_partition_key_exprs(Relation relation,
RelOptInfo *rel);
static void set_baserel_partition_constraint(Relation relation,
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 82f03fc9c..9920b56a8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -205,8 +205,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args,
static List *mergeTableFuncParameters(List *func_args, List *columns);
static TypeName *TableFuncTypeName(List *columns);
static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_t yyscanner);
-static RangeVar *makeRangeVarFromQualifiedName(char *name, List *rels,
- int location,
+static RangeVar *makeRangeVarFromQualifiedName(char *name, List *namelist, int location,
core_yyscan_t yyscanner);
static void SplitColQualList(List *qualList,
List **constraintList, CollateClause **collClause,
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 061d0bcc5..202a38f81 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -67,7 +67,7 @@ static ParseNamespaceItem *transformRangeSubselect(ParseState *pstate,
static ParseNamespaceItem *transformRangeFunction(ParseState *pstate,
RangeFunction *r);
static ParseNamespaceItem *transformRangeTableFunc(ParseState *pstate,
- RangeTableFunc *t);
+ RangeTableFunc *rtf);
static TableSampleClause *transformRangeTableSample(ParseState *pstate,
RangeTableSample *rts);
static ParseNamespaceItem *getNSItemForSpecialRelationTypes(ParseState *pstate,
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 6d283006e..bd068bba0 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -139,7 +139,7 @@ static void transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd);
static List *transformPartitionRangeBounds(ParseState *pstate, List *blist,
Relation parent);
static void validateInfiniteBounds(ParseState *pstate, List *blist);
-static Const *transformPartitionBoundValue(ParseState *pstate, Node *con,
+static Const *transformPartitionBoundValue(ParseState *pstate, Node *val,
const char *colName, Oid colType, int32 colTypmod,
Oid partCollation);
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 57c9b5181..7f74ed212 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -104,7 +104,7 @@ static PartitionBoundInfo create_list_bounds(PartitionBoundSpec **boundspecs,
static PartitionBoundInfo create_range_bounds(PartitionBoundSpec **boundspecs,
int nparts, PartitionKey key, int **mapping);
static PartitionBoundInfo merge_list_bounds(FmgrInfo *partsupfunc,
- Oid *collations,
+ Oid *partcollation,
RelOptInfo *outer_rel,
RelOptInfo *inner_rel,
JoinType jointype,
@@ -123,8 +123,8 @@ static void free_partition_map(PartitionMap *map);
static bool is_dummy_partition(RelOptInfo *rel, int part_index);
static int merge_matching_partitions(PartitionMap *outer_map,
PartitionMap *inner_map,
- int outer_part,
- int inner_part,
+ int outer_index,
+ int inner_index,
int *next_index);
static int process_outer_partition(PartitionMap *outer_map,
PartitionMap *inner_map,
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index de1184ad7..383bc4776 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -414,7 +414,7 @@ static void report_fork_failure_to_client(Port *port, int errnum);
static CAC_state canAcceptConnections(int backend_type);
static bool RandomCancelKey(int32 *cancel_key);
static void signal_child(pid_t pid, int signal);
-static bool SignalSomeChildren(int signal, int targets);
+static bool SignalSomeChildren(int signal, int target);
static void TerminateChildren(int signal);
#define SignalChildren(sig) SignalSomeChildren(sig, BACKEND_TYPE_ALL)
@@ -2598,9 +2598,9 @@ ConnCreate(int serverFd)
* to do here.
*/
static void
-ConnFree(Port *conn)
+ConnFree(Port *port)
{
- free(conn);
+ free(port);
}
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index ee05e230e..ab97e71dd 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -83,7 +83,7 @@ static void statext_store(Oid statOid, bool inh,
MVNDistinct *ndistinct, MVDependencies *dependencies,
MCVList *mcv, Datum exprs, VacAttrStats **stats);
static int statext_compute_stattarget(int stattarget,
- int natts, VacAttrStats **stats);
+ int nattrs, VacAttrStats **stats);
/* Information needed to analyze a single simple expression. */
typedef struct AnlExprData
@@ -99,7 +99,7 @@ static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs);
static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
static AnlExprData *build_expr_data(List *exprs, int stattarget);
-static StatsBuildData *make_build_data(Relation onerel, StatExtEntry *stat,
+static StatsBuildData *make_build_data(Relation rel, StatExtEntry *stat,
int numrows, HeapTuple *rows,
VacAttrStats **stats, int stattarget);
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 43fff50d4..350039cc8 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -32,7 +32,7 @@
#include "utils/memutils.h"
#include "utils/tzparser.h"
-static int DecodeNumber(int flen, char *field, bool haveTextMonth,
+static int DecodeNumber(int flen, char *str, bool haveTextMonth,
int fmask, int *tmask,
struct pg_tm *tm, fsec_t *fsec, bool *is2digits);
static int DecodeNumberField(int len, char *str,
@@ -281,26 +281,26 @@ static const datetkn *abbrevcache[MAXDATEFIELDS] = {NULL};
*/
int
-date2j(int y, int m, int d)
+date2j(int year, int month, int day)
{
int julian;
int century;
- if (m > 2)
+ if (month > 2)
{
- m += 1;
- y += 4800;
+ month += 1;
+ year += 4800;
}
else
{
- m += 13;
- y += 4799;
+ month += 13;
+ year += 4799;
}
- century = y / 100;
- julian = y * 365 - 32167;
- julian += y / 4 - century + century / 4;
- julian += 7834 * m / 256 + d;
+ century = year / 100;
+ julian = year * 365 - 32167;
+ julian += year / 4 - century + century / 4;
+ julian += 7834 * month / 256 + day;
return julian;
} /* date2j() */
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f1b632ef3..d78002b90 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -90,7 +90,7 @@ static inline float8 line_sl(LINE *line);
static inline float8 line_invsl(LINE *line);
static bool line_interpt_line(Point *result, LINE *l1, LINE *l2);
static bool line_contain_point(LINE *line, Point *point);
-static float8 line_closept_point(Point *result, LINE *line, Point *pt);
+static float8 line_closept_point(Point *result, LINE *line, Point *point);
/* Routines for line segments */
static inline void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
@@ -98,8 +98,8 @@ static inline float8 lseg_sl(LSEG *lseg);
static inline float8 lseg_invsl(LSEG *lseg);
static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line);
static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2);
-static int lseg_crossing(float8 x, float8 y, float8 px, float8 py);
-static bool lseg_contain_point(LSEG *lseg, Point *point);
+static int lseg_crossing(float8 x, float8 y, float8 prev_x, float8 prev_y);
+static bool lseg_contain_point(LSEG *lseg, Point *pt);
static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt);
static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line);
static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg);
@@ -115,7 +115,7 @@ static bool box_contain_point(BOX *box, Point *point);
static bool box_contain_box(BOX *contains_box, BOX *contained_box);
static bool box_contain_lseg(BOX *box, LSEG *lseg);
static bool box_interpt_lseg(Point *result, BOX *box, LSEG *lseg);
-static float8 box_closept_point(Point *result, BOX *box, Point *point);
+static float8 box_closept_point(Point *result, BOX *box, Point *pt);
static float8 box_closept_lseg(Point *result, BOX *box, LSEG *lseg);
/* Routines for circles */
diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c
index e02fc3725..8e671b9fa 100644
--- a/src/backend/utils/adt/like.c
+++ b/src/backend/utils/adt/like.c
@@ -33,11 +33,11 @@
static int SB_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
-static text *SB_do_like_escape(text *, text *);
+static text *SB_do_like_escape(text *pat, text *esc);
static int MB_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
-static text *MB_do_like_escape(text *, text *);
+static text *MB_do_like_escape(text *pat, text *esc);
static int UTF8_MatchText(const char *t, int tlen, const char *p, int plen,
pg_locale_t locale, bool locale_is_c);
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 920a63b00..85ee9ec42 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -499,7 +499,7 @@ static void zero_var(NumericVar *var);
static const char *set_var_from_str(const char *str, const char *cp,
NumericVar *dest);
-static void set_var_from_num(Numeric value, NumericVar *dest);
+static void set_var_from_num(Numeric num, NumericVar *dest);
static void init_var_from_num(Numeric num, NumericVar *dest);
static void set_var_from_var(const NumericVar *value, NumericVar *dest);
static char *get_str_from_var(const NumericVar *var);
@@ -510,7 +510,7 @@ static void numericvar_deserialize(StringInfo buf, NumericVar *var);
static Numeric duplicate_numeric(Numeric num);
static Numeric make_result(const NumericVar *var);
-static Numeric make_result_opt_error(const NumericVar *var, bool *error);
+static Numeric make_result_opt_error(const NumericVar *var, bool *have_error);
static void apply_typmod(NumericVar *var, int32 typmod);
static void apply_typmod_special(Numeric num, int32 typmod);
@@ -591,7 +591,7 @@ static void compute_bucket(Numeric operand, Numeric bound1, Numeric bound2,
const NumericVar *count_var, bool reversed_bounds,
NumericVar *result_var);
-static void accum_sum_add(NumericSumAccum *accum, const NumericVar *var1);
+static void accum_sum_add(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_rescale(NumericSumAccum *accum, const NumericVar *val);
static void accum_sum_carry(NumericSumAccum *accum);
static void accum_sum_reset(NumericSumAccum *accum);
diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c
index aa4c53e0a..b09cb4905 100644
--- a/src/backend/utils/adt/rangetypes.c
+++ b/src/backend/utils/adt/rangetypes.c
@@ -55,14 +55,14 @@ typedef struct RangeIOData
static RangeIOData *get_range_io_data(FunctionCallInfo fcinfo, Oid rngtypid,
IOFuncSelector func);
static char range_parse_flags(const char *flags_str);
-static void range_parse(const char *input_str, char *flags, char **lbound_str,
+static void range_parse(const char *string, char *flags, char **lbound_str,
char **ubound_str);
static const char *range_parse_bound(const char *string, const char *ptr,
char **bound_str, bool *infinite);
static char *range_deparse(char flags, const char *lbound_str,
const char *ubound_str);
static char *range_bound_escape(const char *value);
-static Size datum_compute_size(Size sz, Datum datum, bool typbyval,
+static Size datum_compute_size(Size data_length, Datum val, bool typbyval,
char typalign, int16 typlen, char typstorage);
static Pointer datum_write(Pointer ptr, Datum datum, bool typbyval,
char typalign, int16 typlen, char typstorage);
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 51b3fdc9a..1d503e7e0 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -196,7 +196,7 @@ static void ri_GenerateQual(StringInfo buf,
Oid opoid,
const char *rightop, Oid rightoptype);
static void ri_GenerateQualCollation(StringInfo buf, Oid collation);
-static int ri_NullCheck(TupleDesc tupdesc, TupleTableSlot *slot,
+static int ri_NullCheck(TupleDesc tupDesc, TupleTableSlot *slot,
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
static void ri_BuildQueryKey(RI_QueryKey *key,
const RI_ConstraintInfo *riinfo,
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 021b760f4..9799647e1 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -2034,9 +2034,9 @@ time2t(const int hour, const int min, const int sec, const fsec_t fsec)
}
static Timestamp
-dt2local(Timestamp dt, int tz)
+dt2local(Timestamp dt, int timezone)
{
- dt -= (tz * USECS_PER_SEC);
+ dt -= (timezone * USECS_PER_SEC);
return dt;
}
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 606088cdf..d32cb1143 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -121,7 +121,7 @@ static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt);
static void xml_errorHandler(void *data, xmlErrorPtr error);
static void xml_ereport_by_code(int level, int sqlcode,
- const char *msg, int errcode);
+ const char *msg, int code);
static void chopStringInfoNewlines(StringInfo str);
static void appendStringInfoLineSeparator(StringInfo str);
diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c
index e7345e141..626656860 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -137,7 +137,7 @@ static RelMapFile pending_local_updates;
/* non-export function prototypes */
static void apply_map_update(RelMapFile *map, Oid relationId,
- RelFileNumber filenumber, bool add_okay);
+ RelFileNumber fileNumber, bool add_okay);
static void merge_map_updates(RelMapFile *map, const RelMapFile *updates,
bool add_okay);
static void load_relmap_file(bool shared, bool lock_held);
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 96c694da8..eb724a9d7 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -179,7 +179,7 @@ static const char *err_gettext(const char *str) pg_attribute_format_arg(1);
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip);
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str);
static void write_console(const char *line, int len);
-static const char *process_log_prefix_padding(const char *p, int *padding);
+static const char *process_log_prefix_padding(const char *p, int *ppadding);
static void log_line_prefix(StringInfo buf, ErrorData *edata);
static void send_message_to_server_log(ErrorData *edata);
static void send_message_to_frontend(ErrorData *edata);
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index b11d609bb..8c2e08fad 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -225,7 +225,7 @@ static void reapply_stacked_values(struct config_generic *variable,
Oid cursrole);
static bool validate_option_array_item(const char *name, const char *value,
bool skipIfNoPermissions);
-static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head_p);
+static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head);
static void replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
const char *name, const char *value);
static bool valid_custom_variable_name(const char *name);
diff --git a/src/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c
index a67487e5f..6e75acda2 100644
--- a/src/backend/utils/misc/queryjumble.c
+++ b/src/backend/utils/misc/queryjumble.c
@@ -45,7 +45,8 @@ int compute_query_id = COMPUTE_QUERY_ID_AUTO;
/* True when compute_query_id is ON, or AUTO and a module requests them */
bool query_id_enabled = false;
-static uint64 compute_utility_query_id(const char *str, int query_location, int query_len);
+static uint64 compute_utility_query_id(const char *query_text,
+ int query_location, int query_len);
static void AppendJumble(JumbleState *jstate,
const unsigned char *item, Size size);
static void JumbleQueryInternal(JumbleState *jstate, Query *query);
diff --git a/src/backend/utils/sort/tuplesortvariants.c b/src/backend/utils/sort/tuplesortvariants.c
index 7ad4429ad..afa5bdbf0 100644
--- a/src/backend/utils/sort/tuplesortvariants.c
+++ b/src/backend/utils/sort/tuplesortvariants.c
@@ -56,7 +56,7 @@ static int comparetup_cluster(const SortTuple *a, const SortTuple *b,
static void writetup_cluster(Tuplesortstate *state, LogicalTape *tape,
SortTuple *stup);
static void readtup_cluster(Tuplesortstate *state, SortTuple *stup,
- LogicalTape *tape, unsigned int len);
+ LogicalTape *tape, unsigned int tuplen);
static int comparetup_index_btree(const SortTuple *a, const SortTuple *b,
Tuplesortstate *state);
static int comparetup_index_hash(const SortTuple *a, const SortTuple *b,
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 9b504c974..f1f2ddac1 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -680,9 +680,9 @@ FreeSnapshot(Snapshot snapshot)
* with active refcount=1. Otherwise, only increment the refcount.
*/
void
-PushActiveSnapshot(Snapshot snap)
+PushActiveSnapshot(Snapshot snapshot)
{
- PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
+ PushActiveSnapshotWithLevel(snapshot, GetCurrentTransactionNestLevel());
}
/*
@@ -694,11 +694,11 @@ PushActiveSnapshot(Snapshot snap)
* must not be deeper than the current top of the snapshot stack.
*/
void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
+PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
{
ActiveSnapshotElt *newactive;
- Assert(snap != InvalidSnapshot);
+ Assert(snapshot != InvalidSnapshot);
Assert(ActiveSnapshot == NULL || snap_level >= ActiveSnapshot->as_level);
newactive = MemoryContextAlloc(TopTransactionContext, sizeof(ActiveSnapshotElt));
@@ -707,10 +707,11 @@ PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
* Checking SecondarySnapshot is probably useless here, but it seems
* better to be sure.
*/
- if (snap == CurrentSnapshot || snap == SecondarySnapshot || !snap->copied)
- newactive->as_snap = CopySnapshot(snap);
+ if (snapshot == CurrentSnapshot || snapshot == SecondarySnapshot ||
+ !snapshot->copied)
+ newactive->as_snap = CopySnapshot(snapshot);
else
- newactive->as_snap = snap;
+ newactive->as_snap = snapshot;
newactive->as_next = ActiveSnapshot;
newactive->as_level = snap_level;
@@ -2119,20 +2120,20 @@ HistoricSnapshotGetTupleCids(void)
* SerializedSnapshotData.
*/
Size
-EstimateSnapshotSpace(Snapshot snap)
+EstimateSnapshotSpace(Snapshot snapshot)
{
Size size;
- Assert(snap != InvalidSnapshot);
- Assert(snap->snapshot_type == SNAPSHOT_MVCC);
+ Assert(snapshot != InvalidSnapshot);
+ Assert(snapshot->snapshot_type == SNAPSHOT_MVCC);
/* We allocate any XID arrays needed in the same palloc block. */
size = add_size(sizeof(SerializedSnapshotData),
- mul_size(snap->xcnt, sizeof(TransactionId)));
- if (snap->subxcnt > 0 &&
- (!snap->suboverflowed || snap->takenDuringRecovery))
+ mul_size(snapshot->xcnt, sizeof(TransactionId)));
+ if (snapshot->subxcnt > 0 &&
+ (!snapshot->suboverflowed || snapshot->takenDuringRecovery))
size = add_size(size,
- mul_size(snap->subxcnt, sizeof(TransactionId)));
+ mul_size(snapshot->subxcnt, sizeof(TransactionId)));
return size;
}
diff --git a/src/fe_utils/cancel.c b/src/fe_utils/cancel.c
index 8d9ea19de..32195cb70 100644
--- a/src/fe_utils/cancel.c
+++ b/src/fe_utils/cancel.c
@@ -183,9 +183,9 @@ handle_sigint(SIGNAL_ARGS)
* Register query cancellation callback for SIGINT.
*/
void
-setup_cancel_handler(void (*callback) (void))
+setup_cancel_handler(void (*query_cancel_callback) (void))
{
- cancel_callback = callback;
+ cancel_callback = query_cancel_callback;
cancel_sent_msg = _("Cancel request sent\n");
cancel_not_sent_msg = _("Could not send cancel request: ");
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 28f22b25b..f61a04305 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -275,7 +275,7 @@ static char *escape_quotes_bki(const char *src);
static int locale_date_order(const char *locale);
static void check_locale_name(int category, const char *locale,
char **canonname);
-static bool check_locale_encoding(const char *locale, int encoding);
+static bool check_locale_encoding(const char *locale, int user_enc);
static void setlocales(void);
static void usage(const char *progname);
void setup_pgdata(void);
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index fea35e4b1..9ce4b11f1 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -197,7 +197,7 @@ static void append_btree_pattern(PatternInfoArray *pia, const char *pattern,
static void compile_database_list(PGconn *conn, SimplePtrList *databases,
const char *initial_dbname);
static void compile_relation_list_one_db(PGconn *conn, SimplePtrList *relations,
- const DatabaseInfo *datinfo,
+ const DatabaseInfo *dat,
uint64 *pagecount);
#define log_no_match(...) do { \
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c
index a7180e295..f98ec557d 100644
--- a/src/bin/pg_basebackup/pg_receivewal.c
+++ b/src/bin/pg_basebackup/pg_receivewal.c
@@ -63,7 +63,7 @@ static DIR *get_destination_dir(char *dest_folder);
static void close_destination_dir(DIR *dest_dir, char *dest_folder);
static XLogRecPtr FindStreamingStart(uint32 *tli);
static void StreamLog(void);
-static bool stop_streaming(XLogRecPtr segendpos, uint32 timeline,
+static bool stop_streaming(XLogRecPtr xlogpos, uint32 timeline,
bool segment_finished);
static void
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 8638f81f3..1537ef47e 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -44,7 +44,7 @@ extern bool RunIdentifySystem(PGconn *conn, char **sysid,
extern void AppendPlainCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
- char *option_value);
+ char *option_name);
extern void AppendStringCommandOption(PQExpBuffer buf,
bool use_new_option_syntax,
char *option_name, char *option_value);
diff --git a/src/bin/pg_basebackup/walmethods.h b/src/bin/pg_basebackup/walmethods.h
index 0d7728d08..8ba1f2ada 100644
--- a/src/bin/pg_basebackup/walmethods.h
+++ b/src/bin/pg_basebackup/walmethods.h
@@ -123,10 +123,10 @@ struct WalWriteMethod
* not all those required for pg_receivewal)
*/
WalWriteMethod *CreateWalDirectoryMethod(const char *basedir,
- pg_compress_algorithm compression_algo,
- int compression, bool sync);
+ pg_compress_algorithm compression_algorithm,
+ int compression_level, bool sync);
WalWriteMethod *CreateWalTarMethod(const char *tarbase,
- pg_compress_algorithm compression_algo,
- int compression, bool sync);
+ pg_compress_algorithm compression_algorithm,
+ int compression_level, bool sync);
const char *GetLastWalMethodError(WalWriteMethod *wwmethod);
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
index 54a853bd4..e6277c463 100644
--- a/src/bin/pg_rewind/file_ops.h
+++ b/src/bin/pg_rewind/file_ops.h
@@ -17,8 +17,8 @@ extern void write_target_range(char *buf, off_t begin, size_t size);
extern void close_target_file(void);
extern void remove_target_file(const char *path, bool missing_ok);
extern void truncate_target_file(const char *path, off_t newsize);
-extern void create_target(file_entry_t *t);
-extern void remove_target(file_entry_t *t);
+extern void create_target(file_entry_t *entry);
+extern void remove_target(file_entry_t *entry);
extern void sync_target_dir(void);
extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h
index 8b4b50a33..80c276285 100644
--- a/src/bin/pg_rewind/pg_rewind.h
+++ b/src/bin/pg_rewind/pg_rewind.h
@@ -37,7 +37,7 @@ extern uint64 fetch_done;
extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
int tliIndex, XLogRecPtr endpoint,
const char *restoreCommand);
-extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
+extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
int tliIndex,
XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
XLogRecPtr *lastchkptredo,
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 53ea348e2..f18cf9712 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -23,7 +23,7 @@ static void free_db_and_rel_infos(DbInfoArr *db_arr);
static void get_db_infos(ClusterInfo *cluster);
static void get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo);
static void free_rel_infos(RelInfoArr *rel_arr);
-static void print_db_infos(DbInfoArr *dbinfo);
+static void print_db_infos(DbInfoArr *db_arr);
static void print_rel_infos(RelInfoArr *rel_arr);
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index 60c3c8dd6..e379aa466 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -358,7 +358,7 @@ void generate_old_dump(void);
#define EXEC_PSQL_ARGS "--echo-queries --set ON_ERROR_STOP=on --no-psqlrc --dbname=template1"
-bool exec_prog(const char *log_file, const char *opt_log_file,
+bool exec_prog(const char *log_filename, const char *opt_log_file,
bool report_error, bool exit_on_error, const char *fmt,...) pg_attribute_printf(5, 6);
void verify_directories(void);
bool pid_lock_file_exists(const char *datadir);
diff --git a/src/bin/pg_upgrade/relfilenumber.c b/src/bin/pg_upgrade/relfilenumber.c
index c3c7402ef..c3f3d6bc0 100644
--- a/src/bin/pg_upgrade/relfilenumber.c
+++ b/src/bin/pg_upgrade/relfilenumber.c
@@ -16,7 +16,7 @@
#include "pg_upgrade.h"
static void transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace);
-static void transfer_relfile(FileNameMap *map, const char *suffix, bool vm_must_add_frozenbit);
+static void transfer_relfile(FileNameMap *map, const char *type_suffix, bool vm_must_add_frozenbit);
/*
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index 63d02719a..2c0d285de 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -134,7 +134,7 @@ static void verify_backup_file(verifier_context *context,
static void report_extra_backup_files(verifier_context *context);
static void verify_backup_checksums(verifier_context *context);
static void verify_file_checksum(verifier_context *context,
- manifest_file *m, char *pathname);
+ manifest_file *m, char *fullpath);
static void parse_required_wal(verifier_context *context,
char *pg_waldump_path,
char *wal_directory,
diff --git a/src/bin/pg_waldump/compat.c b/src/bin/pg_waldump/compat.c
index 6a3386e97..38e0036e2 100644
--- a/src/bin/pg_waldump/compat.c
+++ b/src/bin/pg_waldump/compat.c
@@ -46,19 +46,19 @@ timestamptz_to_time_t(TimestampTz t)
* moved into src/common. That's a large project though.
*/
const char *
-timestamptz_to_str(TimestampTz dt)
+timestamptz_to_str(TimestampTz t)
{
static char buf[MAXDATELEN + 1];
char ts[MAXDATELEN + 1];
char zone[MAXDATELEN + 1];
- time_t result = (time_t) timestamptz_to_time_t(dt);
+ time_t result = (time_t) timestamptz_to_time_t(t);
struct tm *ltime = localtime(&result);
strftime(ts, sizeof(ts), "%Y-%m-%d %H:%M:%S", ltime);
strftime(zone, sizeof(zone), "%Z", ltime);
snprintf(buf, sizeof(buf), "%s.%06d %s",
- ts, (int) (dt % USECS_PER_SEC), zone);
+ ts, (int) (t % USECS_PER_SEC), zone);
return buf;
}
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index abbdc443a..40903bc16 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -158,10 +158,10 @@ extern char *expr_scanner_get_substring(PsqlScanState state,
extern int expr_scanner_get_lineno(PsqlScanState state, int offset);
extern void syntax_error(const char *source, int lineno, const char *line,
- const char *cmd, const char *msg,
- const char *more, int col) pg_attribute_noreturn();
+ const char *command, const char *msg,
+ const char *more, int column) pg_attribute_noreturn();
-extern bool strtoint64(const char *str, bool errorOK, int64 *pi);
-extern bool strtodouble(const char *str, bool errorOK, double *pd);
+extern bool strtoint64(const char *str, bool errorOK, int64 *result);
+extern bool strtodouble(const char *str, bool errorOK, double *dv);
#endif /* PGBENCH_H */
diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h
index 7872c71f5..bd051e09c 100644
--- a/src/bin/psql/describe.h
+++ b/src/bin/psql/describe.h
@@ -127,16 +127,16 @@ bool describeSubscriptions(const char *pattern, bool verbose);
/* \dAc */
extern bool listOperatorClasses(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAf */
extern bool listOperatorFamilies(const char *access_method_pattern,
- const char *opclass_pattern,
+ const char *type_pattern,
bool verbose);
/* \dAo */
-extern bool listOpFamilyOperators(const char *accessMethod_pattern,
+extern bool listOpFamilyOperators(const char *access_method_pattern,
const char *family_pattern, bool verbose);
/* \dAp */
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 84a1be72f..9d91ad87c 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -18,7 +18,7 @@
extern void splitTableColumnsSpec(const char *spec, int encoding,
char **table, const char **columns);
-extern void appendQualifiedRelation(PQExpBuffer buf, const char *name,
+extern void appendQualifiedRelation(PQExpBuffer buf, const char *spec,
PGconn *conn, bool echo);
extern bool yesno_prompt(const char *question);
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 917b19e0e..746e9b4f1 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -381,7 +381,7 @@ static void closePGconn(PGconn *conn);
static void release_conn_addrinfo(PGconn *conn);
static void sendTerminateConn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
-static PQconninfoOption *parse_connection_string(const char *conninfo,
+static PQconninfoOption *parse_connection_string(const char *connstr,
PQExpBuffer errorMessage, bool use_defaults);
static int uri_prefix_length(const char *connstr);
static bool recognized_connection_string(const char *connstr);
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index bb874f7f5..ca0b184af 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2808,7 +2808,7 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* PQgetline - gets a newline-terminated string from the backend.
*
* Chiefly here so that applications can use "COPY <rel> to stdout"
- * and read the output string. Returns a null-terminated string in s.
+ * and read the output string. Returns a null-terminated string in 'string'.
*
* XXX this routine is now deprecated, because it can't handle binary data.
* If called during a COPY BINARY we return EOF.
@@ -2828,11 +2828,11 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* 1 in other cases (i.e., the buffer was filled before \n is reached)
*/
int
-PQgetline(PGconn *conn, char *s, int maxlen)
+PQgetline(PGconn *conn, char *string, int maxlen)
{
- if (!s || maxlen <= 0)
+ if (!string || maxlen <= 0)
return EOF;
- *s = '\0';
+ *string = '\0';
/* maxlen must be at least 3 to hold the \. terminator! */
if (maxlen < 3)
return EOF;
@@ -2840,7 +2840,7 @@ PQgetline(PGconn *conn, char *s, int maxlen)
if (!conn)
return EOF;
- return pqGetline3(conn, s, maxlen);
+ return pqGetline3(conn, string, maxlen);
}
/*
@@ -2892,9 +2892,9 @@ PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
* send failure.
*/
int
-PQputline(PGconn *conn, const char *s)
+PQputline(PGconn *conn, const char *string)
{
- return PQputnbytes(conn, s, strlen(s));
+ return PQputnbytes(conn, string, strlen(string));
}
/*
diff --git a/src/interfaces/libpq/fe-secure-common.h b/src/interfaces/libpq/fe-secure-common.h
index d18db7138..415a93898 100644
--- a/src/interfaces/libpq/fe-secure-common.h
+++ b/src/interfaces/libpq/fe-secure-common.h
@@ -22,8 +22,8 @@ extern int pq_verify_peer_name_matches_certificate_name(PGconn *conn,
const char *namedata, size_t namelen,
char **store_name);
extern int pq_verify_peer_name_matches_certificate_ip(PGconn *conn,
- const unsigned char *addrdata,
- size_t addrlen,
+ const unsigned char *ipdata,
+ size_t iplen,
char **store_name);
extern bool pq_verify_peer_name_matches_certificate(PGconn *conn);
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index 3798bb3f1..aea466173 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -68,14 +68,14 @@
static int verify_cb(int ok, X509_STORE_CTX *ctx);
static int openssl_verify_peer_name_matches_certificate_name(PGconn *conn,
- ASN1_STRING *name,
+ ASN1_STRING *name_entry,
char **store_name);
static int openssl_verify_peer_name_matches_certificate_ip(PGconn *conn,
ASN1_OCTET_STRING *addr_entry,
char **store_name);
static void destroy_ssl_system(void);
static int initialize_SSL(PGconn *conn);
-static PostgresPollingStatusType open_client_SSL(PGconn *);
+static PostgresPollingStatusType open_client_SSL(PGconn *conn);
static char *SSLerrmessage(unsigned long ecode);
static void SSLerrfree(char *buf);
static int PQssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index 7986445f1..f7a5db4c2 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -483,7 +483,7 @@ extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
/* Deprecated routines for copy in/out */
-extern int PQgetline(PGconn *conn, char *string, int length);
+extern int PQgetline(PGconn *conn, char *string, int maxlen);
extern int PQputline(PGconn *conn, const char *string);
extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
@@ -591,7 +591,7 @@ extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_lengt
extern void PQprint(FILE *fout, /* output stream */
const PGresult *res,
- const PQprintOpt *ps); /* option structure */
+ const PQprintOpt *po); /* option structure */
/*
* really old printing routines
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 7bd2a9fff..a64734294 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -374,7 +374,7 @@ static ParamListInfo setup_param_list(PLpgSQL_execstate *estate,
PLpgSQL_expr *expr);
static ParamExternData *plpgsql_param_fetch(ParamListInfo params,
int paramid, bool speculative,
- ParamExternData *workspace);
+ ParamExternData *prm);
static void plpgsql_param_compile(ParamListInfo params, Param *param,
ExprState *state,
Datum *resv, bool *resnull);
--
2.34.1
v4-0003-Harmonize-parameter-names-in-ecpg-code.patchapplication/octet-stream; name=v4-0003-Harmonize-parameter-names-in-ecpg-code.patchDownload
From 96894e2f7b2945df0b12ebf1d8b2623a314393e1 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Mon, 19 Sep 2022 16:55:37 -0700
Subject: [PATCH v4 3/4] Harmonize parameter names in ecpg code.
---
src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 78 +++++++++++-------
src/interfaces/ecpg/include/ecpg_informix.h | 82 +++++++++----------
src/interfaces/ecpg/include/ecpglib.h | 50 +++++------
src/interfaces/ecpg/include/pgtypes_date.h | 20 ++---
.../ecpg/include/pgtypes_interval.h | 8 +-
src/interfaces/ecpg/include/pgtypes_numeric.h | 36 ++++----
.../ecpg/include/pgtypes_timestamp.h | 12 +--
src/interfaces/ecpg/pgtypeslib/dt.h | 22 ++---
.../ecpg/pgtypeslib/pgtypeslib_extern.h | 8 +-
src/interfaces/ecpg/preproc/c_keywords.c | 8 +-
src/interfaces/ecpg/preproc/output.c | 2 +-
src/interfaces/ecpg/preproc/preproc_extern.h | 63 ++++++++------
src/interfaces/ecpg/preproc/type.c | 2 +-
src/interfaces/ecpg/preproc/type.h | 24 +++---
.../ecpg/test/expected/preproc-outofscope.c | 36 ++++----
src/interfaces/ecpg/test/expected/sql-sqlda.c | 36 ++++----
16 files changed, 259 insertions(+), 228 deletions(-)
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
index c438cfb82..298386cb7 100644
--- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
+++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
@@ -172,52 +172,70 @@ bool ecpg_get_data(const PGresult *, int, int, int, enum ECPGttype type,
#ifdef ENABLE_THREAD_SAFETY
void ecpg_pthreads_init(void);
#endif
-struct connection *ecpg_get_connection(const char *);
-char *ecpg_alloc(long, int);
-char *ecpg_auto_alloc(long, int);
-char *ecpg_realloc(void *, long, int);
-void ecpg_free(void *);
-bool ecpg_init(const struct connection *, const char *, const int);
-char *ecpg_strdup(const char *, int);
-const char *ecpg_type_name(enum ECPGttype);
-int ecpg_dynamic_type(Oid);
-int sqlda_dynamic_type(Oid, enum COMPAT_MODE);
+struct connection *ecpg_get_connection(const char *connection_name);
+char *ecpg_alloc(long size, int lineno);
+char *ecpg_auto_alloc(long size, int lineno);
+char *ecpg_realloc(void *ptr, long size, int lineno);
+void ecpg_free(void *ptr);
+bool ecpg_init(const struct connection *con,
+ const char *connection_name,
+ const int lineno);
+char *ecpg_strdup(const char *string, int lineno);
+const char *ecpg_type_name(enum ECPGttype typ);
+int ecpg_dynamic_type(Oid type);
+int sqlda_dynamic_type(Oid type, enum COMPAT_MODE compat);
void ecpg_clear_auto_mem(void);
struct descriptor *ecpg_find_desc(int line, const char *name);
-struct prepared_statement *ecpg_find_prepared_statement(const char *,
- struct connection *, struct prepared_statement **);
+struct prepared_statement *ecpg_find_prepared_statement(const char *name,
+ struct connection *con,
+ struct prepared_statement **prev_);
bool ecpg_store_result(const PGresult *results, int act_field,
const struct statement *stmt, struct variable *var);
-bool ecpg_store_input(const int, const bool, const struct variable *, char **, bool);
+bool ecpg_store_input(const int lineno, const bool force_indicator,
+ const struct variable *var,
+ char **tobeinserted_p, bool quote);
void ecpg_free_params(struct statement *stmt, bool print);
-bool ecpg_do_prologue(int, const int, const int, const char *, const bool,
- enum ECPG_statement_type, const char *, va_list,
- struct statement **);
-bool ecpg_build_params(struct statement *);
+bool ecpg_do_prologue(int lineno, const int compat,
+ const int force_indicator, const char *connection_name,
+ const bool questionmarks, enum ECPG_statement_type statement_type,
+ const char *query, va_list args,
+ struct statement **stmt_out);
+bool ecpg_build_params(struct statement *stmt);
bool ecpg_autostart_transaction(struct statement *stmt);
bool ecpg_execute(struct statement *stmt);
-bool ecpg_process_output(struct statement *, bool);
-void ecpg_do_epilogue(struct statement *);
-bool ecpg_do(const int, const int, const int, const char *, const bool,
- const int, const char *, va_list);
+bool ecpg_process_output(struct statement *stmt, bool clear_result);
+void ecpg_do_epilogue(struct statement *stmt);
+bool ecpg_do(const int lineno, const int compat,
+ const int force_indicator, const char *connection_name,
+ const bool questionmarks, const int st, const char *query,
+ va_list args);
-bool ecpg_check_PQresult(PGresult *, int, PGconn *, enum COMPAT_MODE);
+bool ecpg_check_PQresult(PGresult *results, int lineno,
+ PGconn *connection, enum COMPAT_MODE compat);
void ecpg_raise(int line, int code, const char *sqlstate, const char *str);
void ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat);
-char *ecpg_prepared(const char *, struct connection *);
-bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *conn);
+char *ecpg_prepared(const char *name, struct connection *con);
+bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *con);
void ecpg_log(const char *format,...) pg_attribute_printf(1, 2);
-bool ecpg_auto_prepare(int, const char *, const int, char **, const char *);
-bool ecpg_register_prepared_stmt(struct statement *);
+bool ecpg_auto_prepare(int lineno, const char *connection_name,
+ const int compat, char **name,
+ const char *query);
+bool ecpg_register_prepared_stmt(struct statement *stmt);
void ecpg_init_sqlca(struct sqlca_t *sqlca);
-struct sqlda_compat *ecpg_build_compat_sqlda(int, PGresult *, int, enum COMPAT_MODE);
-void ecpg_set_compat_sqlda(int, struct sqlda_compat **, const PGresult *, int, enum COMPAT_MODE);
-struct sqlda_struct *ecpg_build_native_sqlda(int, PGresult *, int, enum COMPAT_MODE);
-void ecpg_set_native_sqlda(int, struct sqlda_struct **, const PGresult *, int, enum COMPAT_MODE);
+struct sqlda_compat *ecpg_build_compat_sqlda(int line, PGresult *res, int row,
+ enum COMPAT_MODE compat);
+void ecpg_set_compat_sqlda(int lineno, struct sqlda_compat **_sqlda,
+ const PGresult *res, int row,
+ enum COMPAT_MODE compat);
+struct sqlda_struct *ecpg_build_native_sqlda(int line, PGresult *res, int row,
+ enum COMPAT_MODE compat);
+void ecpg_set_native_sqlda(int lineno, struct sqlda_struct **_sqlda,
+ const PGresult *res, int row,
+ enum COMPAT_MODE compat);
unsigned ecpg_hex_dec_len(unsigned srclen);
unsigned ecpg_hex_enc_len(unsigned srclen);
unsigned ecpg_hex_encode(const char *src, unsigned len, char *dst);
diff --git a/src/interfaces/ecpg/include/ecpg_informix.h b/src/interfaces/ecpg/include/ecpg_informix.h
index a5260a554..5d918c379 100644
--- a/src/interfaces/ecpg/include/ecpg_informix.h
+++ b/src/interfaces/ecpg/include/ecpg_informix.h
@@ -33,55 +33,55 @@ extern "C"
{
#endif
-extern int rdatestr(date, char *);
-extern void rtoday(date *);
-extern int rjulmdy(date, short *);
-extern int rdefmtdate(date *, const char *, const char *);
-extern int rfmtdate(date, const char *, char *);
-extern int rmdyjul(short *, date *);
-extern int rstrdate(const char *, date *);
-extern int rdayofweek(date);
+extern int rdatestr(date d, char *str);
+extern void rtoday(date * d);
+extern int rjulmdy(date d, short *mdy);
+extern int rdefmtdate(date * d, const char *fmt, const char *str);
+extern int rfmtdate(date d, const char *fmt, char *str);
+extern int rmdyjul(short *mdy, date * d);
+extern int rstrdate(const char *str, date * d);
+extern int rdayofweek(date d);
-extern int rfmtlong(long, const char *, char *);
-extern int rgetmsg(int, char *, int);
-extern int risnull(int, const char *);
-extern int rsetnull(int, char *);
-extern int rtypalign(int, int);
-extern int rtypmsize(int, int);
-extern int rtypwidth(int, int);
-extern void rupshift(char *);
+extern int rfmtlong(long lng_val, const char *fmt, char *outbuf);
+extern int rgetmsg(int msgnum, char *s, int maxsize);
+extern int risnull(int t, const char *ptr);
+extern int rsetnull(int t, char *ptr);
+extern int rtypalign(int offset, int type);
+extern int rtypmsize(int type, int len);
+extern int rtypwidth(int sqltype, int sqllen);
+extern void rupshift(char *str);
-extern int byleng(char *, int);
-extern void ldchar(char *, int, char *);
+extern int byleng(char *str, int len);
+extern void ldchar(char *src, int len, char *dest);
-extern void ECPG_informix_set_var(int, void *, int);
-extern void *ECPG_informix_get_var(int);
+extern void ECPG_informix_set_var(int number, void *pointer, int lineno);
+extern void *ECPG_informix_get_var(int number);
extern void ECPG_informix_reset_sqlca(void);
/* Informix defines these in decimal.h */
-int decadd(decimal *, decimal *, decimal *);
-int deccmp(decimal *, decimal *);
-void deccopy(decimal *, decimal *);
-int deccvasc(const char *, int, decimal *);
-int deccvdbl(double, decimal *);
-int deccvint(int, decimal *);
-int deccvlong(long, decimal *);
-int decdiv(decimal *, decimal *, decimal *);
-int decmul(decimal *, decimal *, decimal *);
-int decsub(decimal *, decimal *, decimal *);
-int dectoasc(decimal *, char *, int, int);
-int dectodbl(decimal *, double *);
-int dectoint(decimal *, int *);
-int dectolong(decimal *, long *);
+int decadd(decimal *arg1, decimal *arg2, decimal *sum);
+int deccmp(decimal *arg1, decimal *arg2);
+void deccopy(decimal *src, decimal *target);
+int deccvasc(const char *cp, int len, decimal *np);
+int deccvdbl(double dbl, decimal *np);
+int deccvint(int in, decimal *np);
+int deccvlong(long lng, decimal *np);
+int decdiv(decimal *n1, decimal *n2, decimal *result);
+int decmul(decimal *n1, decimal *n2, decimal *result);
+int decsub(decimal *n1, decimal *n2, decimal *result);
+int dectoasc(decimal *np, char *cp, int len, int right);
+int dectodbl(decimal *np, double *dblp);
+int dectoint(decimal *np, int *ip);
+int dectolong(decimal *np, long *lngp);
/* Informix defines these in datetime.h */
-extern void dtcurrent(timestamp *);
-extern int dtcvasc(char *, timestamp *);
-extern int dtsub(timestamp *, timestamp *, interval *);
-extern int dttoasc(timestamp *, char *);
-extern int dttofmtasc(timestamp *, char *, int, char *);
-extern int intoasc(interval *, char *);
-extern int dtcvfmtasc(char *, char *, timestamp *);
+extern void dtcurrent(timestamp * ts);
+extern int dtcvasc(char *str, timestamp * ts);
+extern int dtsub(timestamp * ts1, timestamp * ts2, interval * iv);
+extern int dttoasc(timestamp * ts, char *output);
+extern int dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr);
+extern int intoasc(interval * i, char *str);
+extern int dtcvfmtasc(char *inbuf, char *fmtstr, timestamp * dtvalue);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index 00240109a..f983a27f9 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -49,20 +49,20 @@ extern "C"
{
#endif
-void ECPGdebug(int, FILE *);
-bool ECPGstatus(int, const char *);
-bool ECPGsetcommit(int, const char *, const char *);
-bool ECPGsetconn(int, const char *);
-bool ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
-bool ECPGdo(const int, const int, const int, const char *, const bool, const int, const char *,...);
-bool ECPGtrans(int, const char *, const char *);
-bool ECPGdisconnect(int, const char *);
-bool ECPGprepare(int, const char *, const bool, const char *, const char *);
-bool ECPGdeallocate(int, int, const char *, const char *);
-bool ECPGdeallocate_all(int, int, const char *);
-char *ECPGprepared_statement(const char *, const char *, int);
-PGconn *ECPGget_PGconn(const char *);
-PGTransactionStatusType ECPGtransactionStatus(const char *);
+void ECPGdebug(int n, FILE *dbgs);
+bool ECPGstatus(int lineno, const char *connection_name);
+bool ECPGsetcommit(int lineno, const char *mode, const char *connection_name);
+bool ECPGsetconn(int lineno, const char *connection_name);
+bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit);
+bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...);
+bool ECPGtrans(int lineno, const char *connection_name, const char *transaction);
+bool ECPGdisconnect(int lineno, const char *connection_name);
+bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable);
+bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name);
+bool ECPGdeallocate_all(int lineno, int compat, const char *connection_name);
+char *ECPGprepared_statement(const char *connection_name, const char *name, int lineno);
+PGconn *ECPGget_PGconn(const char *connection_name);
+PGTransactionStatusType ECPGtransactionStatus(const char *connection_name);
/* print an error message */
void sqlprint(void);
@@ -74,19 +74,19 @@ void sqlprint(void);
/* dynamic SQL */
-bool ECPGdo_descriptor(int, const char *, const char *, const char *);
-bool ECPGdeallocate_desc(int, const char *);
-bool ECPGallocate_desc(int, const char *);
-bool ECPGget_desc_header(int, const char *, int *);
-bool ECPGget_desc(int, const char *, int,...);
-bool ECPGset_desc_header(int, const char *, int);
-bool ECPGset_desc(int, const char *, int,...);
+bool ECPGdo_descriptor(int line, const char *connection, const char *descriptor, const char *query);
+bool ECPGdeallocate_desc(int line, const char *name);
+bool ECPGallocate_desc(int line, const char *name);
+bool ECPGget_desc_header(int lineno, const char *desc_name, int *count);
+bool ECPGget_desc(int lineno, const char *desc_name, int index,...);
+bool ECPGset_desc_header(int lineno, const char *desc_name, int count);
+bool ECPGset_desc(int lineno, const char *desc_name, int index,...);
-void ECPGset_noind_null(enum ECPGttype, void *);
-bool ECPGis_noind_null(enum ECPGttype, const void *);
-bool ECPGdescribe(int, int, bool, const char *, const char *,...);
+void ECPGset_noind_null(enum ECPGttype type, void *ptr);
+bool ECPGis_noind_null(enum ECPGttype type, const void *ptr);
+bool ECPGdescribe(int line, int compat, bool input, const char *connection_name, const char *stmt_name,...);
-void ECPGset_var(int, void *, int);
+void ECPGset_var(int number, void *pointer, int lineno);
void *ECPGget_var(int number);
/* dynamic result allocation */
diff --git a/src/interfaces/ecpg/include/pgtypes_date.h b/src/interfaces/ecpg/include/pgtypes_date.h
index c66809746..5490cf821 100644
--- a/src/interfaces/ecpg/include/pgtypes_date.h
+++ b/src/interfaces/ecpg/include/pgtypes_date.h
@@ -14,16 +14,16 @@ extern "C"
#endif
extern date * PGTYPESdate_new(void);
-extern void PGTYPESdate_free(date *);
-extern date PGTYPESdate_from_asc(char *, char **);
-extern char *PGTYPESdate_to_asc(date);
-extern date PGTYPESdate_from_timestamp(timestamp);
-extern void PGTYPESdate_julmdy(date, int *);
-extern void PGTYPESdate_mdyjul(int *, date *);
-extern int PGTYPESdate_dayofweek(date);
-extern void PGTYPESdate_today(date *);
-extern int PGTYPESdate_defmt_asc(date *, const char *, const char *);
-extern int PGTYPESdate_fmt_asc(date, const char *, char *);
+extern void PGTYPESdate_free(date * d);
+extern date PGTYPESdate_from_asc(char *str, char **endptr);
+extern char *PGTYPESdate_to_asc(date dDate);
+extern date PGTYPESdate_from_timestamp(timestamp dt);
+extern void PGTYPESdate_julmdy(date jd, int *mdy);
+extern void PGTYPESdate_mdyjul(int *mdy, date * jdate);
+extern int PGTYPESdate_dayofweek(date dDate);
+extern void PGTYPESdate_today(date * d);
+extern int PGTYPESdate_defmt_asc(date * d, const char *fmt, const char *str);
+extern int PGTYPESdate_fmt_asc(date dDate, const char *fmtstring, char *outbuf);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_interval.h b/src/interfaces/ecpg/include/pgtypes_interval.h
index 3b17cd1d1..8471b609d 100644
--- a/src/interfaces/ecpg/include/pgtypes_interval.h
+++ b/src/interfaces/ecpg/include/pgtypes_interval.h
@@ -36,10 +36,10 @@ extern "C"
#endif
extern interval * PGTYPESinterval_new(void);
-extern void PGTYPESinterval_free(interval *);
-extern interval * PGTYPESinterval_from_asc(char *, char **);
-extern char *PGTYPESinterval_to_asc(interval *);
-extern int PGTYPESinterval_copy(interval *, interval *);
+extern void PGTYPESinterval_free(interval *intvl);
+extern interval * PGTYPESinterval_from_asc(char *str, char **endptr);
+extern char *PGTYPESinterval_to_asc(interval *span);
+extern int PGTYPESinterval_copy(interval *intvlsrc, interval *intvldest);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_numeric.h b/src/interfaces/ecpg/include/pgtypes_numeric.h
index 5c763a9eb..61506f44c 100644
--- a/src/interfaces/ecpg/include/pgtypes_numeric.h
+++ b/src/interfaces/ecpg/include/pgtypes_numeric.h
@@ -43,24 +43,24 @@ extern "C"
numeric *PGTYPESnumeric_new(void);
decimal *PGTYPESdecimal_new(void);
-void PGTYPESnumeric_free(numeric *);
-void PGTYPESdecimal_free(decimal *);
-numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(numeric *, int);
-int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_cmp(numeric *, numeric *);
-int PGTYPESnumeric_from_int(signed int, numeric *);
-int PGTYPESnumeric_from_long(signed long int, numeric *);
-int PGTYPESnumeric_copy(numeric *, numeric *);
-int PGTYPESnumeric_from_double(double, numeric *);
-int PGTYPESnumeric_to_double(numeric *, double *);
-int PGTYPESnumeric_to_int(numeric *, int *);
-int PGTYPESnumeric_to_long(numeric *, long *);
-int PGTYPESnumeric_to_decimal(numeric *, decimal *);
-int PGTYPESnumeric_from_decimal(decimal *, numeric *);
+void PGTYPESnumeric_free(numeric *var);
+void PGTYPESdecimal_free(decimal *var);
+numeric *PGTYPESnumeric_from_asc(char *str, char **endptr);
+char *PGTYPESnumeric_to_asc(numeric *num, int dscale);
+int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_cmp(numeric *var1, numeric *var2);
+int PGTYPESnumeric_from_int(signed int int_val, numeric *var);
+int PGTYPESnumeric_from_long(signed long int long_val, numeric *var);
+int PGTYPESnumeric_copy(numeric *src, numeric *dst);
+int PGTYPESnumeric_from_double(double d, numeric *dst);
+int PGTYPESnumeric_to_double(numeric *nv, double *dp);
+int PGTYPESnumeric_to_int(numeric *nv, int *ip);
+int PGTYPESnumeric_to_long(numeric *nv, long *lp);
+int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst);
+int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_timestamp.h b/src/interfaces/ecpg/include/pgtypes_timestamp.h
index 3e2983789..412ecc2d4 100644
--- a/src/interfaces/ecpg/include/pgtypes_timestamp.h
+++ b/src/interfaces/ecpg/include/pgtypes_timestamp.h
@@ -15,12 +15,12 @@ extern "C"
{
#endif
-extern timestamp PGTYPEStimestamp_from_asc(char *, char **);
-extern char *PGTYPEStimestamp_to_asc(timestamp);
-extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *);
-extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *);
-extern void PGTYPEStimestamp_current(timestamp *);
-extern int PGTYPEStimestamp_defmt_asc(const char *, const char *, timestamp *);
+extern timestamp PGTYPEStimestamp_from_asc(char *str, char **endptr);
+extern char *PGTYPEStimestamp_to_asc(timestamp tstamp);
+extern int PGTYPEStimestamp_sub(timestamp * ts1, timestamp * ts2, interval * iv);
+extern int PGTYPEStimestamp_fmt_asc(timestamp * ts, char *output, int str_len, const char *fmtstr);
+extern void PGTYPEStimestamp_current(timestamp * ts);
+extern int PGTYPEStimestamp_defmt_asc(const char *str, const char *fmt, timestamp * d);
extern int PGTYPEStimestamp_add_interval(timestamp * tin, interval * span, timestamp * tout);
extern int PGTYPEStimestamp_sub_interval(timestamp * tin, interval * span, timestamp * tout);
diff --git a/src/interfaces/ecpg/pgtypeslib/dt.h b/src/interfaces/ecpg/pgtypeslib/dt.h
index 893c9b619..1ec38791f 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt.h
+++ b/src/interfaces/ecpg/pgtypeslib/dt.h
@@ -311,22 +311,22 @@ do { \
#define TIMESTAMP_IS_NOEND(j) ((j) == DT_NOEND)
#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
-int DecodeInterval(char **, int *, int, int *, struct tm *, fsec_t *);
-int DecodeTime(char *, int *, struct tm *, fsec_t *);
+int DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec);
+int DecodeTime(char *str, int *tmask, struct tm *tm, fsec_t *fsec);
void EncodeDateTime(struct tm *tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str, bool EuroDates);
void EncodeInterval(struct tm *tm, fsec_t fsec, int style, char *str);
-int tm2timestamp(struct tm *, fsec_t, int *, timestamp *);
+int tm2timestamp(struct tm *tm, fsec_t fsec, int *tzp, timestamp *result);
int DecodeUnits(int field, char *lowtoken, int *val);
bool CheckDateTokenTables(void);
void EncodeDateOnly(struct tm *tm, int style, char *str, bool EuroDates);
-int GetEpochTime(struct tm *);
-int ParseDateTime(char *, char *, char **, int *, int *, char **);
-int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, bool);
-void j2date(int, int *, int *, int *);
-void GetCurrentDateTime(struct tm *);
-int date2j(int, int, int);
-void TrimTrailingZeros(char *);
-void dt2time(double, int *, int *, int *, fsec_t *);
+int GetEpochTime(struct tm *tm);
+int ParseDateTime(char *timestr, char *lowstr, char **field, int *ftype, int *numfields, char **endstr);
+int DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec, bool EuroDates);
+void j2date(int jd, int *year, int *month, int *day);
+void GetCurrentDateTime(struct tm *tm);
+int date2j(int y, int m, int d);
+void TrimTrailingZeros(char *str);
+void dt2time(double jd, int *hour, int *min, int *sec, fsec_t *fsec);
int PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
int *year, int *month, int *day,
int *hour, int *minute, int *second,
diff --git a/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h b/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h
index 1012088b7..8e980966b 100644
--- a/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h
+++ b/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h
@@ -33,9 +33,11 @@ union un_fmt_comb
int64 int64_val;
};
-int pgtypes_fmt_replace(union un_fmt_comb, int, char **, int *);
+int pgtypes_fmt_replace(union un_fmt_comb replace_val,
+ int replace_type, char **output,
+ int *pstr_len);
-char *pgtypes_alloc(long);
-char *pgtypes_strdup(const char *);
+char *pgtypes_alloc(long size);
+char *pgtypes_strdup(const char *str);
#endif /* _ECPG_PGTYPESLIB_EXTERN_H */
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index e51c03610..14f20e2d2 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = {
* ScanKeywordLookup(), except we want case-sensitive matching.
*/
int
-ScanCKeywordLookup(const char *str)
+ScanCKeywordLookup(const char *text)
{
size_t len;
int h;
@@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str)
* Reject immediately if too long to be any keyword. This saves useless
* hashing work on long strings.
*/
- len = strlen(str);
+ len = strlen(text);
if (len > ScanCKeywords.max_kw_len)
return -1;
@@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str)
* Compute the hash function. Since it's a perfect hash, we need only
* match to the specific keyword it identifies.
*/
- h = ScanCKeywords_hash_func(str, len);
+ h = ScanCKeywords_hash_func(text, len);
/* An out-of-range result implies no match */
if (h < 0 || h >= ScanCKeywords.num_keywords)
@@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str)
kw = GetScanKeyword(h, &ScanCKeywords);
- if (strcmp(kw, str) == 0)
+ if (strcmp(kw, text) == 0)
return ScanCKeywordTokens[h];
return -1;
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index cf8aadd0b..6c0b8a27b 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -4,7 +4,7 @@
#include "preproc_extern.h"
-static void output_escaped_str(char *cmd, bool quoted);
+static void output_escaped_str(char *str, bool quoted);
void
output_line_number(void)
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 6be59b719..c5fd07fbd 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -65,41 +65,50 @@ extern const uint16 SQLScanKeywordTokens[];
extern const char *get_dtype(enum ECPGdtype);
extern void lex_init(void);
extern void output_line_number(void);
-extern void output_statement(char *, int, enum ECPG_statement_type);
-extern void output_prepare_statement(char *, char *);
-extern void output_deallocate_prepare_statement(char *);
-extern void output_simple_statement(char *, int);
+extern void output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st);
+extern void output_prepare_statement(char *name, char *stmt);
+extern void output_deallocate_prepare_statement(char *name);
+extern void output_simple_statement(char *stmt, int whenever_mode);
extern char *hashline_number(void);
extern int base_yyparse(void);
extern int base_yylex(void);
-extern void base_yyerror(const char *);
-extern void *mm_alloc(size_t);
-extern char *mm_strdup(const char *);
-extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
-extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
-extern void output_get_descr_header(char *);
-extern void output_get_descr(char *, char *);
-extern void output_set_descr_header(char *);
-extern void output_set_descr(char *, char *);
-extern void push_assignment(char *, enum ECPGdtype);
-extern struct variable *find_variable(char *);
-extern void whenever_action(int);
-extern void add_descriptor(char *, char *);
-extern void drop_descriptor(char *, char *);
-extern struct descriptor *lookup_descriptor(char *, char *);
+extern void base_yyerror(const char *error);
+extern void *mm_alloc(size_t size);
+extern char *mm_strdup(const char *string);
+extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
+extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
+extern void output_get_descr_header(char *desc_name);
+extern void output_get_descr(char *desc_name, char *index);
+extern void output_set_descr_header(char *desc_name);
+extern void output_set_descr(char *desc_name, char *index);
+extern void push_assignment(char *var, enum ECPGdtype value);
+extern struct variable *find_variable(char *name);
+extern void whenever_action(int mode);
+extern void add_descriptor(char *name, char *connection);
+extern void drop_descriptor(char *name, char *connection);
+extern struct descriptor *lookup_descriptor(char *name, char *connection);
extern struct variable *descriptor_variable(const char *name, int input);
extern struct variable *sqlda_variable(const char *name);
-extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
-extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
+extern void add_variable_to_head(struct arguments **list,
+ struct variable *var,
+ struct variable *ind);
+extern void add_variable_to_tail(struct arguments **list,
+ struct variable *var,
+ struct variable *ind);
extern void remove_variable_from_list(struct arguments **list, struct variable *var);
-extern void dump_variables(struct arguments *, int);
+extern void dump_variables(struct arguments *list, int mode);
extern struct typedefs *get_typedef(const char *name, bool noerror);
-extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool);
+extern void adjust_array(enum ECPGttype type_enum, char **dimension,
+ char **length, char *type_dimension,
+ char *type_index, int pointer_len,
+ bool type_definition);
extern void reset_variables(void);
-extern void check_indicator(struct ECPGtype *);
-extern void remove_typedefs(int);
-extern void remove_variables(int);
-extern struct variable *new_variable(const char *, struct ECPGtype *, int);
+extern void check_indicator(struct ECPGtype *var);
+extern void remove_typedefs(int brace_level);
+extern void remove_variables(int brace_level);
+extern struct variable *new_variable(const char *name,
+ struct ECPGtype *type,
+ int brace_level);
extern int ScanCKeywordLookup(const char *text);
extern int ScanECPGKeywordLookup(const char *text);
extern void parser_init(void);
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index d4b4da5ff..58119d110 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -233,7 +233,7 @@ get_type(enum ECPGttype type)
*/
static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize,
- char *arrsize, const char *size, const char *prefix, int);
+ char *arrsize, const char *size, const char *prefix, int counter);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize,
struct ECPGtype *type, struct ECPGtype *ind_type, const char *prefix, const char *ind_prefix);
diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h
index 08b739e5f..28edf0897 100644
--- a/src/interfaces/ecpg/preproc/type.h
+++ b/src/interfaces/ecpg/preproc/type.h
@@ -33,15 +33,15 @@ struct ECPGtype
};
/* Everything is malloced. */
-void ECPGmake_struct_member(const char *, struct ECPGtype *, struct ECPGstruct_member **);
-struct ECPGtype *ECPGmake_simple_type(enum ECPGttype, char *, int);
-struct ECPGtype *ECPGmake_array_type(struct ECPGtype *, char *);
-struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *, enum ECPGttype, char *, char *);
-struct ECPGstruct_member *ECPGstruct_member_dup(struct ECPGstruct_member *);
+void ECPGmake_struct_member(const char *name, struct ECPGtype *type, struct ECPGstruct_member **start);
+struct ECPGtype *ECPGmake_simple_type(enum ECPGttype type, char *size, int counter);
+struct ECPGtype *ECPGmake_array_type(struct ECPGtype *type, char *size);
+struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *rm, enum ECPGttype type, char *type_name, char *struct_sizeof);
+struct ECPGstruct_member *ECPGstruct_member_dup(struct ECPGstruct_member *rm);
/* Frees a type. */
-void ECPGfree_struct_member(struct ECPGstruct_member *);
-void ECPGfree_type(struct ECPGtype *);
+void ECPGfree_struct_member(struct ECPGstruct_member *rm);
+void ECPGfree_type(struct ECPGtype *type);
/* Dump a type.
The type is dumped as:
@@ -53,10 +53,12 @@ void ECPGfree_type(struct ECPGtype *);
size is the maxsize in case it is a varchar. Otherwise it is the size of
the variable (required to do array fetches of structs).
*/
-void ECPGdump_a_type(FILE *, const char *, struct ECPGtype *, const int,
- const char *, struct ECPGtype *, const int,
- const char *, const char *, char *,
- const char *, const char *);
+void ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype *type,
+ const int brace_level, const char *ind_name,
+ struct ECPGtype *ind_type, const int ind_brace_level,
+ const char *prefix, const char *ind_prefix,
+ char *arr_str_size, const char *struct_sizeof,
+ const char *ind_struct_sizeof);
/* A simple struct to keep a variable and its type. */
struct ECPGtemp_type
diff --git a/src/interfaces/ecpg/test/expected/preproc-outofscope.c b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
index 3a27c53e1..a040a6901 100644
--- a/src/interfaces/ecpg/test/expected/preproc-outofscope.c
+++ b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
@@ -70,24 +70,24 @@ extern "C"
numeric *PGTYPESnumeric_new(void);
decimal *PGTYPESdecimal_new(void);
-void PGTYPESnumeric_free(numeric *);
-void PGTYPESdecimal_free(decimal *);
-numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(numeric *, int);
-int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_cmp(numeric *, numeric *);
-int PGTYPESnumeric_from_int(signed int, numeric *);
-int PGTYPESnumeric_from_long(signed long int, numeric *);
-int PGTYPESnumeric_copy(numeric *, numeric *);
-int PGTYPESnumeric_from_double(double, numeric *);
-int PGTYPESnumeric_to_double(numeric *, double *);
-int PGTYPESnumeric_to_int(numeric *, int *);
-int PGTYPESnumeric_to_long(numeric *, long *);
-int PGTYPESnumeric_to_decimal(numeric *, decimal *);
-int PGTYPESnumeric_from_decimal(decimal *, numeric *);
+void PGTYPESnumeric_free(numeric *var);
+void PGTYPESdecimal_free(decimal *var);
+numeric *PGTYPESnumeric_from_asc(char *str, char **endptr);
+char *PGTYPESnumeric_to_asc(numeric *num, int dscale);
+int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_cmp(numeric *var1, numeric *var2);
+int PGTYPESnumeric_from_int(signed int int_val, numeric *var);
+int PGTYPESnumeric_from_long(signed long int long_val, numeric *var);
+int PGTYPESnumeric_copy(numeric *src, numeric *dst);
+int PGTYPESnumeric_from_double(double d, numeric *dst);
+int PGTYPESnumeric_to_double(numeric *nv, double *dp);
+int PGTYPESnumeric_to_int(numeric *nv, int *ip);
+int PGTYPESnumeric_to_long(numeric *nv, long *lp);
+int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst);
+int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/test/expected/sql-sqlda.c b/src/interfaces/ecpg/test/expected/sql-sqlda.c
index d474bd38b..ee1a67427 100644
--- a/src/interfaces/ecpg/test/expected/sql-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/sql-sqlda.c
@@ -92,24 +92,24 @@ extern "C"
numeric *PGTYPESnumeric_new(void);
decimal *PGTYPESdecimal_new(void);
-void PGTYPESnumeric_free(numeric *);
-void PGTYPESdecimal_free(decimal *);
-numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(numeric *, int);
-int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_cmp(numeric *, numeric *);
-int PGTYPESnumeric_from_int(signed int, numeric *);
-int PGTYPESnumeric_from_long(signed long int, numeric *);
-int PGTYPESnumeric_copy(numeric *, numeric *);
-int PGTYPESnumeric_from_double(double, numeric *);
-int PGTYPESnumeric_to_double(numeric *, double *);
-int PGTYPESnumeric_to_int(numeric *, int *);
-int PGTYPESnumeric_to_long(numeric *, long *);
-int PGTYPESnumeric_to_decimal(numeric *, decimal *);
-int PGTYPESnumeric_from_decimal(decimal *, numeric *);
+void PGTYPESnumeric_free(numeric *var);
+void PGTYPESdecimal_free(decimal *var);
+numeric *PGTYPESnumeric_from_asc(char *str, char **endptr);
+char *PGTYPESnumeric_to_asc(numeric *num, int dscale);
+int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_cmp(numeric *var1, numeric *var2);
+int PGTYPESnumeric_from_int(signed int int_val, numeric *var);
+int PGTYPESnumeric_from_long(signed long int long_val, numeric *var);
+int PGTYPESnumeric_copy(numeric *src, numeric *dst);
+int PGTYPESnumeric_from_double(double d, numeric *dst);
+int PGTYPESnumeric_to_double(numeric *nv, double *dp);
+int PGTYPESnumeric_to_int(numeric *nv, int *ip);
+int PGTYPESnumeric_to_long(numeric *nv, long *lp);
+int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst);
+int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst);
#ifdef __cplusplus
}
--
2.34.1
v4-0001-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchapplication/octet-stream; name=v4-0001-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchDownload
From 957301c070d1177ff2bfc748c9fc9abe89fd547b Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Sat, 3 Sep 2022 22:19:51 -0700
Subject: [PATCH v4 1/4] Harmonize parameter names in pg_dump/pg_dumpall.
Make sure that function declarations use names that exactly match the
corresponding names from function definitions. Having parameter names
that are reliably consistent in this way will make it easier to reason
about groups of related C functions from the same translation unit as a
module. It will also make certain refactoring tasks easier.
Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy. Later commits will do the
same for other parts of the codebase.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
---
src/bin/pg_dump/common.c | 2 +-
src/bin/pg_dump/parallel.c | 14 +-
src/bin/pg_dump/pg_backup.h | 36 ++--
src/bin/pg_dump/pg_backup_archiver.c | 75 ++++----
src/bin/pg_dump/pg_backup_archiver.h | 10 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_db.c | 40 ++--
src/bin/pg_dump/pg_backup_db.h | 12 +-
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_null.c | 8 +-
src/bin/pg_dump/pg_backup_tar.c | 4 +-
src/bin/pg_dump/pg_dump.c | 262 +++++++++++++-------------
src/bin/pg_dump/pg_dump.h | 6 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
14 files changed, 240 insertions(+), 239 deletions(-)
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 395f817fa..44fa52cc5 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -79,7 +79,7 @@ typedef struct _catalogIdMapEntry
static catalogid_hash *catalogIdHash = NULL;
-static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables,
+static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables);
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c8a70d9bc..ba6df9e0c 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -146,7 +146,7 @@ static int pgpipe(int handles[2]);
typedef struct ShutdownInformation
{
ParallelState *pstate;
- Archive *AHX;
+ Archive *A;
} ShutdownInformation;
static ShutdownInformation shutdown_info;
@@ -325,9 +325,9 @@ getThreadLocalPQExpBuffer(void)
* as soon as they've created the ArchiveHandle.
*/
void
-on_exit_close_archive(Archive *AHX)
+on_exit_close_archive(Archive *A)
{
- shutdown_info.AHX = AHX;
+ shutdown_info.A = A;
on_exit_nicely(archive_close_connection, &shutdown_info);
}
@@ -353,8 +353,8 @@ archive_close_connection(int code, void *arg)
*/
ShutdownWorkersHard(si->pstate);
- if (si->AHX)
- DisconnectDatabase(si->AHX);
+ if (si->A)
+ DisconnectDatabase(si->A);
}
else
{
@@ -378,8 +378,8 @@ archive_close_connection(int code, void *arg)
else
{
/* Non-parallel operation: just kill the leader DB connection */
- if (si->AHX)
- DisconnectDatabase(si->AHX);
+ if (si->A)
+ DisconnectDatabase(si->A);
}
}
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fcc5f6bd0..9dc441902 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -270,33 +270,33 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods.
*/
-typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+typedef int (*DataDumperPtr) (Archive *A, const void *userArg);
-typedef void (*SetupWorkerPtrType) (Archive *AH);
+typedef void (*SetupWorkerPtrType) (Archive *A);
/*
* Main archiver interface.
*/
-extern void ConnectDatabase(Archive *AHX,
+extern void ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect);
-extern void DisconnectDatabase(Archive *AHX);
-extern PGconn *GetConnection(Archive *AHX);
+extern void DisconnectDatabase(Archive *A);
+extern PGconn *GetConnection(Archive *A);
/* Called to write *data* to the archive */
-extern void WriteData(Archive *AH, const void *data, size_t dLen);
+extern void WriteData(Archive *A, const void *data, size_t dLen);
-extern int StartBlob(Archive *AH, Oid oid);
-extern int EndBlob(Archive *AH, Oid oid);
+extern int StartBlob(Archive *A, Oid oid);
+extern int EndBlob(Archive *A, Oid oid);
-extern void CloseArchive(Archive *AH);
+extern void CloseArchive(Archive *A);
-extern void SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt);
+extern void SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt);
-extern void ProcessArchiveRestoreOptions(Archive *AH);
+extern void ProcessArchiveRestoreOptions(Archive *A);
-extern void RestoreArchive(Archive *AH);
+extern void RestoreArchive(Archive *A);
/* Open an existing archive */
extern Archive *OpenArchive(const char *FileSpec, const ArchiveFormat fmt);
@@ -307,7 +307,7 @@ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt,
SetupWorkerPtrType setupDumpWorker);
/* The --list option */
-extern void PrintTOCSummary(Archive *AH);
+extern void PrintTOCSummary(Archive *A);
extern RestoreOptions *NewRestoreOptions(void);
@@ -316,13 +316,13 @@ extern void InitDumpOptions(DumpOptions *opts);
extern DumpOptions *dumpOptionsFromRestoreOptions(RestoreOptions *ropt);
/* Rearrange and filter TOC entries */
-extern void SortTocFromFile(Archive *AHX);
+extern void SortTocFromFile(Archive *A);
/* Convenience functions used only when writing DATA */
-extern void archputs(const char *s, Archive *AH);
-extern int archprintf(Archive *AH, const char *fmt,...) pg_attribute_printf(2, 3);
+extern void archputs(const char *s, Archive *A);
+extern int archprintf(Archive *A, const char *fmt,...) pg_attribute_printf(2, 3);
-#define appendStringLiteralAH(buf,str,AH) \
- appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings)
+#define appendStringLiteralArchive(buf,str,A) \
+ appendStringLiteral(buf, str, (A)->encoding, (A)->std_strings)
#endif /* PG_BACKUP_H */
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 233198afc..e459f2755 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -227,9 +227,9 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt)
* setup doesn't need to know anything much, so it's defined here.
*/
static void
-setupRestoreWorker(Archive *AHX)
+setupRestoreWorker(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ReopenPtr(AH);
}
@@ -261,10 +261,10 @@ OpenArchive(const char *FileSpec, const ArchiveFormat fmt)
/* Public */
void
-CloseArchive(Archive *AHX)
+CloseArchive(Archive *A)
{
int res = 0;
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ClosePtr(AH);
@@ -281,22 +281,22 @@ CloseArchive(Archive *AHX)
/* Public */
void
-SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt)
+SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt)
{
/* Caller can omit dump options, in which case we synthesize them */
if (dopt == NULL && ropt != NULL)
dopt = dumpOptionsFromRestoreOptions(ropt);
/* Save options for later access */
- AH->dopt = dopt;
- AH->ropt = ropt;
+ A->dopt = dopt;
+ A->ropt = ropt;
}
/* Public */
void
-ProcessArchiveRestoreOptions(Archive *AHX)
+ProcessArchiveRestoreOptions(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -349,9 +349,9 @@ ProcessArchiveRestoreOptions(Archive *AHX)
/* Public */
void
-RestoreArchive(Archive *AHX)
+RestoreArchive(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
bool parallel_mode;
TocEntry *te;
@@ -415,10 +415,10 @@ RestoreArchive(Archive *AHX)
* restore; allow the attempt regardless of the version of the restore
* target.
*/
- AHX->minRemoteVersion = 0;
- AHX->maxRemoteVersion = 9999999;
+ A->minRemoteVersion = 0;
+ A->maxRemoteVersion = 9999999;
- ConnectDatabase(AHX, &ropt->cparams, false);
+ ConnectDatabase(A, &ropt->cparams, false);
/*
* If we're talking to the DB directly, don't send comments since they
@@ -479,7 +479,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- StartTransaction(AHX);
+ StartTransaction(A);
else
ahprintf(AH, "BEGIN;\n\n");
}
@@ -724,7 +724,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- CommitTransaction(AHX);
+ CommitTransaction(A);
else
ahprintf(AH, "COMMIT;\n\n");
}
@@ -1031,9 +1031,9 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te)
/* Public */
void
-WriteData(Archive *AHX, const void *data, size_t dLen)
+WriteData(Archive *A, const void *data, size_t dLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->currToc)
pg_fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
@@ -1052,10 +1052,9 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
/* Public */
TocEntry *
-ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
- ArchiveOpts *opts)
+ArchiveEntry(Archive *A, CatalogId catalogId, DumpId dumpId, ArchiveOpts *opts)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
TocEntry *newToc;
newToc = (TocEntry *) pg_malloc0(sizeof(TocEntry));
@@ -1110,9 +1109,9 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
/* Public */
void
-PrintTOCSummary(Archive *AHX)
+PrintTOCSummary(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -1214,9 +1213,9 @@ PrintTOCSummary(Archive *AHX)
/* Called by a dumper to signal start of a BLOB */
int
-StartBlob(Archive *AHX, Oid oid)
+StartBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->StartBlobPtr)
pg_fatal("large-object output not supported in chosen format");
@@ -1228,9 +1227,9 @@ StartBlob(Archive *AHX, Oid oid)
/* Called by a dumper to signal end of a BLOB */
int
-EndBlob(Archive *AHX, Oid oid)
+EndBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->EndBlobPtr)
AH->EndBlobPtr(AH, AH->currToc, oid);
@@ -1358,9 +1357,9 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
***********/
void
-SortTocFromFile(Archive *AHX)
+SortTocFromFile(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
FILE *fh;
StringInfoData linebuf;
@@ -1439,14 +1438,14 @@ SortTocFromFile(Archive *AHX)
/* Public */
void
-archputs(const char *s, Archive *AH)
+archputs(const char *s, Archive *A)
{
- WriteData(AH, s, strlen(s));
+ WriteData(A, s, strlen(s));
}
/* Public */
int
-archprintf(Archive *AH, const char *fmt,...)
+archprintf(Archive *A, const char *fmt,...)
{
int save_errno = errno;
char *p;
@@ -1474,7 +1473,7 @@ archprintf(Archive *AH, const char *fmt,...)
len = cnt;
}
- WriteData(AH, p, cnt);
+ WriteData(A, p, cnt);
free(p);
return (int) cnt;
}
@@ -1652,10 +1651,10 @@ dump_lo_buf(ArchiveHandle *AH)
{
PQExpBuffer buf = createPQExpBuffer();
- appendByteaLiteralAHX(buf,
- (const unsigned char *) AH->lo_buf,
- AH->lo_buf_used,
- AH);
+ appendByteaLiteralAH(buf,
+ (const unsigned char *) AH->lo_buf,
+ AH->lo_buf_used,
+ AH);
/* Hack: turn off writingBlob so ahwrite doesn't recurse to here */
AH->writingBlob = 0;
@@ -3125,7 +3124,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
* SQL requires a string literal here. Might as well be correct.
*/
if (user && *user)
- appendStringLiteralAHX(cmd, user, AH);
+ appendStringLiteralAH(cmd, user, AH);
else
appendPQExpBufferStr(cmd, "DEFAULT");
appendPQExpBufferChar(cmd, ';');
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 084cd87e8..a106513a3 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -404,7 +404,7 @@ struct _tocEntry
};
extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
-extern void on_exit_close_archive(Archive *AHX);
+extern void on_exit_close_archive(Archive *A);
extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
@@ -428,7 +428,7 @@ typedef struct _archiveOpts
} ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */
-extern TocEntry *ArchiveEntry(Archive *AHX, CatalogId catalogId,
+extern TocEntry *ArchiveEntry(Archive *A, CatalogId catalogId,
DumpId dumpId, ArchiveOpts *opts);
extern void WriteHead(ArchiveHandle *AH);
@@ -444,10 +444,10 @@ extern int TocIDRequired(ArchiveHandle *AH, DumpId id);
TocEntry *getTocEntryByDumpId(ArchiveHandle *AH, DumpId id);
extern bool checkSeek(FILE *fp);
-#define appendStringLiteralAHX(buf,str,AH) \
+#define appendStringLiteralAH(buf,str,AH) \
appendStringLiteral(buf, str, (AH)->public.encoding, (AH)->public.std_strings)
-#define appendByteaLiteralAHX(buf,str,len,AH) \
+#define appendByteaLiteralAH(buf,str,len,AH) \
appendByteaLiteral(buf, str, len, (AH)->public.std_strings)
/*
@@ -457,7 +457,7 @@ extern bool checkSeek(FILE *fp);
extern size_t WriteInt(ArchiveHandle *AH, int i);
extern int ReadInt(ArchiveHandle *AH);
extern char *ReadStr(ArchiveHandle *AH);
-extern size_t WriteStr(ArchiveHandle *AH, const char *s);
+extern size_t WriteStr(ArchiveHandle *AH, const char *c);
int ReadOffset(ArchiveHandle *, pgoff_t *);
size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 1023fea01..a0a55a1ed 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -40,7 +40,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 28baa68fd..6485b1ee1 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -98,20 +98,20 @@ ReconnectToServer(ArchiveHandle *AH, const char *dbname)
/*
* Make, or remake, a database connection with the given parameters.
*
- * The resulting connection handle is stored in AHX->connection.
+ * The resulting connection handle is stored in AH->connection.
*
* An interactive password prompt is automatically issued if required.
- * We store the results of that in AHX->savedPassword.
+ * We store the results of that in AH->savedPassword.
* Note: it's not really all that sensible to use a single-entry password
* cache if the username keeps changing. In current usage, however, the
* username never does change, so one savedPassword is sufficient.
*/
void
-ConnectDatabase(Archive *AHX,
+ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
trivalue prompt_password;
char *password;
bool new_pass;
@@ -222,9 +222,9 @@ ConnectDatabase(Archive *AHX,
* have one running.
*/
void
-DisconnectDatabase(Archive *AHX)
+DisconnectDatabase(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
char errbuf[1];
if (!AH->connection)
@@ -251,9 +251,9 @@ DisconnectDatabase(Archive *AHX)
}
PGconn *
-GetConnection(Archive *AHX)
+GetConnection(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
return AH->connection;
}
@@ -275,9 +275,9 @@ die_on_query_failure(ArchiveHandle *AH, const char *query)
}
void
-ExecuteSqlStatement(Archive *AHX, const char *query)
+ExecuteSqlStatement(Archive *A, const char *query)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -287,9 +287,9 @@ ExecuteSqlStatement(Archive *AHX, const char *query)
}
PGresult *
-ExecuteSqlQuery(Archive *AHX, const char *query, ExecStatusType status)
+ExecuteSqlQuery(Archive *A, const char *query, ExecStatusType status)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -442,9 +442,9 @@ ExecuteSimpleCommands(ArchiveHandle *AH, const char *buf, size_t bufLen)
* Implement ahwrite() for direct-to-DB restore
*/
int
-ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen)
+ExecuteSqlCommandBuf(Archive *A, const char *buf, size_t bufLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->outputKind == OUTPUT_COPYDATA)
{
@@ -497,9 +497,9 @@ ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen)
* Terminate a COPY operation during direct-to-DB restore
*/
void
-EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
+EndDBCopyMode(Archive *A, const char *tocEntryTag)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->pgCopyIn)
{
@@ -526,17 +526,17 @@ EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
}
void
-StartTransaction(Archive *AHX)
+StartTransaction(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
ExecuteSqlCommand(AH, "BEGIN", "could not start database transaction");
}
void
-CommitTransaction(Archive *AHX)
+CommitTransaction(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
ExecuteSqlCommand(AH, "COMMIT", "could not commit database transaction");
}
diff --git a/src/bin/pg_dump/pg_backup_db.h b/src/bin/pg_dump/pg_backup_db.h
index 8888dd34b..b96e2594e 100644
--- a/src/bin/pg_dump/pg_backup_db.h
+++ b/src/bin/pg_dump/pg_backup_db.h
@@ -11,16 +11,16 @@
#include "pg_backup.h"
-extern int ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen);
+extern int ExecuteSqlCommandBuf(Archive *A, const char *buf, size_t bufLen);
-extern void ExecuteSqlStatement(Archive *AHX, const char *query);
-extern PGresult *ExecuteSqlQuery(Archive *AHX, const char *query,
+extern void ExecuteSqlStatement(Archive *A, const char *query);
+extern PGresult *ExecuteSqlQuery(Archive *A, const char *query,
ExecStatusType status);
extern PGresult *ExecuteSqlQueryForSingleRow(Archive *fout, const char *query);
-extern void EndDBCopyMode(Archive *AHX, const char *tocEntryTag);
+extern void EndDBCopyMode(Archive *A, const char *tocEntryTag);
-extern void StartTransaction(Archive *AHX);
-extern void CommitTransaction(Archive *AHX);
+extern void StartTransaction(Archive *A);
+extern void CommitTransaction(Archive *A);
#endif
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 3f46f7988..798182b6f 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -67,7 +67,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c
index 541306d99..7eda176bb 100644
--- a/src/bin/pg_dump/pg_backup_null.c
+++ b/src/bin/pg_dump/pg_backup_null.c
@@ -99,10 +99,10 @@ _WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen)
{
PQExpBuffer buf = createPQExpBuffer();
- appendByteaLiteralAHX(buf,
- (const unsigned char *) data,
- dLen,
- AH);
+ appendByteaLiteralAH(buf,
+ (const unsigned char *) data,
+ dLen,
+ AH);
ahprintf(AH, "SELECT pg_catalog.lowrite(0, %s);\n", buf->data);
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 7960b81c0..402b93c61 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -46,7 +46,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
@@ -97,7 +97,7 @@ typedef struct
static void _LoadBlobs(ArchiveHandle *AH);
static TAR_MEMBER *tarOpen(ArchiveHandle *AH, const char *filename, char mode);
-static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
+static void tarClose(ArchiveHandle *AH, TAR_MEMBER *th);
#ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 67b6d9079..e4013fd0d 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -159,7 +159,7 @@ static int nseclabels = 0;
(obj)->dobj.name)
static void help(const char *progname);
-static void setup_connection(Archive *AH,
+static void setup_connection(Archive *A,
const char *dumpencoding, const char *dumpsnapshot,
char *use_role);
static ArchiveFormat parseArchiveFormat(const char *format, ArchiveMode *mode);
@@ -221,7 +221,7 @@ static void dumpFunc(Archive *fout, const FuncInfo *finfo);
static void dumpCast(Archive *fout, const CastInfo *cast);
static void dumpTransform(Archive *fout, const TransformInfo *transform);
static void dumpOpr(Archive *fout, const OprInfo *oprinfo);
-static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *oprinfo);
+static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *aminfo);
static void dumpOpclass(Archive *fout, const OpclassInfo *opcinfo);
static void dumpOpfamily(Archive *fout, const OpfamilyInfo *opfinfo);
static void dumpCollation(Archive *fout, const CollInfo *collinfo);
@@ -232,7 +232,7 @@ static void dumpTrigger(Archive *fout, const TriggerInfo *tginfo);
static void dumpEventTrigger(Archive *fout, const EventTriggerInfo *evtinfo);
static void dumpTable(Archive *fout, const TableInfo *tbinfo);
static void dumpTableSchema(Archive *fout, const TableInfo *tbinfo);
-static void dumpTableAttach(Archive *fout, const TableAttachInfo *tbinfo);
+static void dumpTableAttach(Archive *fout, const TableAttachInfo *attachinfo);
static void dumpAttrDef(Archive *fout, const AttrDefInfo *adinfo);
static void dumpSequence(Archive *fout, const TableInfo *tbinfo);
static void dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo);
@@ -287,12 +287,12 @@ static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
static void dumpPublicationTable(Archive *fout, const PublicationRelInfo *pubrinfo);
static void dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo);
-static void dumpDatabase(Archive *AH);
+static void dumpDatabase(Archive *fout);
static void dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
const char *dbname, Oid dboid);
-static void dumpEncoding(Archive *AH);
-static void dumpStdStrings(Archive *AH);
-static void dumpSearchPath(Archive *AH);
+static void dumpEncoding(Archive *A);
+static void dumpStdStrings(Archive *A);
+static void dumpSearchPath(Archive *A);
static void binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
PQExpBuffer upgrade_buffer,
Oid pg_type_oid,
@@ -315,7 +315,7 @@ static bool nonemptyReloptions(const char *reloptions);
static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
const char *prefix, Archive *fout);
static char *get_synchronized_snapshot(Archive *fout);
-static void setupDumpWorker(Archive *AHX);
+static void setupDumpWorker(Archive *A);
static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
@@ -1069,14 +1069,14 @@ help(const char *progname)
}
static void
-setup_connection(Archive *AH, const char *dumpencoding,
+setup_connection(Archive *A, const char *dumpencoding,
const char *dumpsnapshot, char *use_role)
{
- DumpOptions *dopt = AH->dopt;
- PGconn *conn = GetConnection(AH);
+ DumpOptions *dopt = A->dopt;
+ PGconn *conn = GetConnection(A);
const char *std_strings;
- PQclear(ExecuteSqlQueryForSingleRow(AH, ALWAYS_SECURE_SEARCH_PATH_SQL));
+ PQclear(ExecuteSqlQueryForSingleRow(A, ALWAYS_SECURE_SEARCH_PATH_SQL));
/*
* Set the client encoding if requested.
@@ -1092,18 +1092,18 @@ setup_connection(Archive *AH, const char *dumpencoding,
* Get the active encoding and the standard_conforming_strings setting, so
* we know how to escape strings.
*/
- AH->encoding = PQclientEncoding(conn);
+ A->encoding = PQclientEncoding(conn);
std_strings = PQparameterStatus(conn, "standard_conforming_strings");
- AH->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
+ A->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
/*
* Set the role if requested. In a parallel dump worker, we'll be passed
- * use_role == NULL, but AH->use_role is already set (if user specified it
+ * use_role == NULL, but A->use_role is already set (if user specified it
* originally) and we should use that.
*/
- if (!use_role && AH->use_role)
- use_role = AH->use_role;
+ if (!use_role && A->use_role)
+ use_role = A->use_role;
/* Set the role if requested */
if (use_role)
@@ -1111,19 +1111,19 @@ setup_connection(Archive *AH, const char *dumpencoding,
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query, "SET ROLE %s", fmtId(use_role));
- ExecuteSqlStatement(AH, query->data);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
/* save it for possible later use by parallel workers */
- if (!AH->use_role)
- AH->use_role = pg_strdup(use_role);
+ if (!A->use_role)
+ A->use_role = pg_strdup(use_role);
}
/* Set the datestyle to ISO to ensure the dump's portability */
- ExecuteSqlStatement(AH, "SET DATESTYLE = ISO");
+ ExecuteSqlStatement(A, "SET DATESTYLE = ISO");
/* Likewise, avoid using sql_standard intervalstyle */
- ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
+ ExecuteSqlStatement(A, "SET INTERVALSTYLE = POSTGRES");
/*
* Use an explicitly specified extra_float_digits if it has been provided.
@@ -1136,54 +1136,54 @@ setup_connection(Archive *AH, const char *dumpencoding,
appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits);
- ExecuteSqlStatement(AH, q->data);
+ ExecuteSqlStatement(A, q->data);
destroyPQExpBuffer(q);
}
else
- ExecuteSqlStatement(AH, "SET extra_float_digits TO 3");
+ ExecuteSqlStatement(A, "SET extra_float_digits TO 3");
/*
* Disable synchronized scanning, to prevent unpredictable changes in row
* ordering across a dump and reload.
*/
- ExecuteSqlStatement(AH, "SET synchronize_seqscans TO off");
+ ExecuteSqlStatement(A, "SET synchronize_seqscans TO off");
/*
* Disable timeouts if supported.
*/
- ExecuteSqlStatement(AH, "SET statement_timeout = 0");
- if (AH->remoteVersion >= 90300)
- ExecuteSqlStatement(AH, "SET lock_timeout = 0");
- if (AH->remoteVersion >= 90600)
- ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
+ ExecuteSqlStatement(A, "SET statement_timeout = 0");
+ if (A->remoteVersion >= 90300)
+ ExecuteSqlStatement(A, "SET lock_timeout = 0");
+ if (A->remoteVersion >= 90600)
+ ExecuteSqlStatement(A, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.
*/
if (quote_all_identifiers)
- ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ ExecuteSqlStatement(A, "SET quote_all_identifiers = true");
/*
* Adjust row-security mode, if supported.
*/
- if (AH->remoteVersion >= 90500)
+ if (A->remoteVersion >= 90500)
{
if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security = on");
+ ExecuteSqlStatement(A, "SET row_security = on");
else
- ExecuteSqlStatement(AH, "SET row_security = off");
+ ExecuteSqlStatement(A, "SET row_security = off");
}
/*
* Initialize prepared-query state to "nothing prepared". We do this here
* so that a parallel dump worker will have its own state.
*/
- AH->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
+ A->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
- ExecuteSqlStatement(AH, "BEGIN");
+ ExecuteSqlStatement(A, "BEGIN");
/*
* To support the combination of serializable_deferrable with the jobs
@@ -1193,52 +1193,52 @@ setup_connection(Archive *AH, const char *dumpencoding,
* REPEATABLE READ transaction provides the appropriate integrity
* guarantees. This is a kluge, but safe for back-patching.
*/
- if (dopt->serializable_deferrable && AH->sync_snapshot_id == NULL)
- ExecuteSqlStatement(AH,
+ if (dopt->serializable_deferrable && A->sync_snapshot_id == NULL)
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
- ExecuteSqlStatement(AH,
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ, READ ONLY");
/*
* If user specified a snapshot to use, select that. In a parallel dump
- * worker, we'll be passed dumpsnapshot == NULL, but AH->sync_snapshot_id
+ * worker, we'll be passed dumpsnapshot == NULL, but A->sync_snapshot_id
* is already set (if the server can handle it) and we should use that.
*/
if (dumpsnapshot)
- AH->sync_snapshot_id = pg_strdup(dumpsnapshot);
+ A->sync_snapshot_id = pg_strdup(dumpsnapshot);
- if (AH->sync_snapshot_id)
+ if (A->sync_snapshot_id)
{
PQExpBuffer query = createPQExpBuffer();
appendPQExpBufferStr(query, "SET TRANSACTION SNAPSHOT ");
- appendStringLiteralConn(query, AH->sync_snapshot_id, conn);
- ExecuteSqlStatement(AH, query->data);
+ appendStringLiteralConn(query, A->sync_snapshot_id, conn);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
}
- else if (AH->numWorkers > 1)
+ else if (A->numWorkers > 1)
{
- if (AH->isStandby && AH->remoteVersion < 100000)
+ if (A->isStandby && A->remoteVersion < 100000)
pg_fatal("parallel dumps from standby servers are not supported by this server version");
- AH->sync_snapshot_id = get_synchronized_snapshot(AH);
+ A->sync_snapshot_id = get_synchronized_snapshot(A);
}
}
/* Set up connection for a parallel worker process */
static void
-setupDumpWorker(Archive *AH)
+setupDumpWorker(Archive *A)
{
/*
* We want to re-select all the same values the leader connection is
* using. We'll have inherited directly-usable values in
- * AH->sync_snapshot_id and AH->use_role, but we need to translate the
+ * A->sync_snapshot_id and A->use_role, but we need to translate the
* inherited encoding value back to a string to pass to setup_connection.
*/
- setup_connection(AH,
- pg_encoding_to_char(AH->encoding),
+ setup_connection(A,
+ pg_encoding_to_char(A->encoding),
NULL,
NULL);
}
@@ -2320,9 +2320,9 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
default:
/* All other types are printed as string literals. */
resetPQExpBuffer(q);
- appendStringLiteralAH(q,
- PQgetvalue(res, tuple, field),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, tuple, field),
+ fout);
archputs(q->data, fout);
break;
}
@@ -2920,7 +2920,7 @@ dumpDatabase(Archive *fout)
if (strlen(encoding) > 0)
{
appendPQExpBufferStr(creaQry, " ENCODING = ");
- appendStringLiteralAH(creaQry, encoding, fout);
+ appendStringLiteralArchive(creaQry, encoding, fout);
}
appendPQExpBufferStr(creaQry, " LOCALE_PROVIDER = ");
@@ -2935,25 +2935,25 @@ dumpDatabase(Archive *fout)
if (strlen(collate) > 0 && strcmp(collate, ctype) == 0)
{
appendPQExpBufferStr(creaQry, " LOCALE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
else
{
if (strlen(collate) > 0)
{
appendPQExpBufferStr(creaQry, " LC_COLLATE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
if (strlen(ctype) > 0)
{
appendPQExpBufferStr(creaQry, " LC_CTYPE = ");
- appendStringLiteralAH(creaQry, ctype, fout);
+ appendStringLiteralArchive(creaQry, ctype, fout);
}
}
if (iculocale)
{
appendPQExpBufferStr(creaQry, " ICU_LOCALE = ");
- appendStringLiteralAH(creaQry, iculocale, fout);
+ appendStringLiteralArchive(creaQry, iculocale, fout);
}
/*
@@ -2965,9 +2965,9 @@ dumpDatabase(Archive *fout)
if (!PQgetisnull(res, 0, i_datcollversion))
{
appendPQExpBufferStr(creaQry, " COLLATION_VERSION = ");
- appendStringLiteralAH(creaQry,
- PQgetvalue(res, 0, i_datcollversion),
- fout);
+ appendStringLiteralArchive(creaQry,
+ PQgetvalue(res, 0, i_datcollversion),
+ fout);
}
}
@@ -3021,7 +3021,7 @@ dumpDatabase(Archive *fout)
* database.
*/
appendPQExpBuffer(dbQry, "COMMENT ON DATABASE %s IS ", qdatname);
- appendStringLiteralAH(dbQry, comment, fout);
+ appendStringLiteralArchive(dbQry, comment, fout);
appendPQExpBufferStr(dbQry, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -3100,7 +3100,7 @@ dumpDatabase(Archive *fout)
*/
appendPQExpBufferStr(delQry, "UPDATE pg_catalog.pg_database "
"SET datistemplate = false WHERE datname = ");
- appendStringLiteralAH(delQry, datname, fout);
+ appendStringLiteralArchive(delQry, datname, fout);
appendPQExpBufferStr(delQry, ";\n");
}
@@ -3118,7 +3118,7 @@ dumpDatabase(Archive *fout)
"SET datfrozenxid = '%u', datminmxid = '%u'\n"
"WHERE datname = ",
frozenxid, minmxid);
- appendStringLiteralAH(creaQry, datname, fout);
+ appendStringLiteralArchive(creaQry, datname, fout);
appendPQExpBufferStr(creaQry, ";\n");
}
@@ -3270,18 +3270,18 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
* dumpEncoding: put the correct encoding into the archive
*/
static void
-dumpEncoding(Archive *AH)
+dumpEncoding(Archive *A)
{
- const char *encname = pg_encoding_to_char(AH->encoding);
+ const char *encname = pg_encoding_to_char(A->encoding);
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving encoding = %s", encname);
appendPQExpBufferStr(qry, "SET client_encoding = ");
- appendStringLiteralAH(qry, encname, AH);
+ appendStringLiteralArchive(qry, encname, A);
appendPQExpBufferStr(qry, ";\n");
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "ENCODING",
.description = "ENCODING",
.section = SECTION_PRE_DATA,
@@ -3295,9 +3295,9 @@ dumpEncoding(Archive *AH)
* dumpStdStrings: put the correct escape string behavior into the archive
*/
static void
-dumpStdStrings(Archive *AH)
+dumpStdStrings(Archive *A)
{
- const char *stdstrings = AH->std_strings ? "on" : "off";
+ const char *stdstrings = A->std_strings ? "on" : "off";
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving standard_conforming_strings = %s",
@@ -3306,7 +3306,7 @@ dumpStdStrings(Archive *AH)
appendPQExpBuffer(qry, "SET standard_conforming_strings = '%s';\n",
stdstrings);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "STDSTRINGS",
.description = "STDSTRINGS",
.section = SECTION_PRE_DATA,
@@ -3319,7 +3319,7 @@ dumpStdStrings(Archive *AH)
* dumpSearchPath: record the active search_path in the archive
*/
static void
-dumpSearchPath(Archive *AH)
+dumpSearchPath(Archive *A)
{
PQExpBuffer qry = createPQExpBuffer();
PQExpBuffer path = createPQExpBuffer();
@@ -3335,7 +3335,7 @@ dumpSearchPath(Archive *AH)
* listing schemas that may appear in search_path but not actually exist,
* which seems like a prudent exclusion.
*/
- res = ExecuteSqlQueryForSingleRow(AH,
+ res = ExecuteSqlQueryForSingleRow(A,
"SELECT pg_catalog.current_schemas(false)");
if (!parsePGArray(PQgetvalue(res, 0, 0), &schemanames, &nschemanames))
@@ -3355,19 +3355,19 @@ dumpSearchPath(Archive *AH)
}
appendPQExpBufferStr(qry, "SELECT pg_catalog.set_config('search_path', ");
- appendStringLiteralAH(qry, path->data, AH);
+ appendStringLiteralArchive(qry, path->data, A);
appendPQExpBufferStr(qry, ", false);\n");
pg_log_info("saving search_path = %s", path->data);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "SEARCHPATH",
.description = "SEARCHPATH",
.section = SECTION_PRE_DATA,
.createStmt = qry->data));
- /* Also save it in AH->searchpath, in case we're doing plain text dump */
- AH->searchpath = pg_strdup(qry->data);
+ /* Also save it in A->searchpath, in case we're doing plain text dump */
+ A->searchpath = pg_strdup(qry->data);
free(schemanames);
PQclear(res);
@@ -4593,7 +4593,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, "CREATE SUBSCRIPTION %s CONNECTION ",
qsubname);
- appendStringLiteralAH(query, subinfo->subconninfo, fout);
+ appendStringLiteralArchive(query, subinfo->subconninfo, fout);
/* Build list of quoted publications and append them to query. */
if (!parsePGArray(subinfo->subpublications, &pubnames, &npubnames))
@@ -4610,7 +4610,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, " PUBLICATION %s WITH (connect = false, slot_name = ", publications->data);
if (subinfo->subslotname)
- appendStringLiteralAH(query, subinfo->subslotname, fout);
+ appendStringLiteralArchive(query, subinfo->subslotname, fout);
else
appendPQExpBufferStr(query, "NONE");
@@ -9506,7 +9506,7 @@ dumpCommentExtended(Archive *fout, const char *type,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, comments->descr, fout);
+ appendStringLiteralArchive(query, comments->descr, fout);
appendPQExpBufferStr(query, ";\n");
appendPQExpBuffer(tag, "%s %s", type, name);
@@ -9596,7 +9596,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
resetPQExpBuffer(query);
appendPQExpBuffer(query, "COMMENT ON %s %s IS ", reltypename,
fmtQualifiedDumpable(tbinfo));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -9621,7 +9621,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
fmtQualifiedDumpable(tbinfo));
appendPQExpBuffer(query, "%s IS ",
fmtId(tbinfo->attnames[objsubid - 1]));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -10131,12 +10131,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_create_empty_extension(");
- appendStringLiteralAH(q, extinfo->dobj.name, fout);
+ appendStringLiteralArchive(q, extinfo->dobj.name, fout);
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, extinfo->namespace, fout);
+ appendStringLiteralArchive(q, extinfo->namespace, fout);
appendPQExpBufferStr(q, ", ");
appendPQExpBuffer(q, "%s, ", extinfo->relocatable ? "true" : "false");
- appendStringLiteralAH(q, extinfo->extversion, fout);
+ appendStringLiteralArchive(q, extinfo->extversion, fout);
appendPQExpBufferStr(q, ", ");
/*
@@ -10145,12 +10145,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
* preserved in binary upgrade.
*/
if (strlen(extinfo->extconfig) > 2)
- appendStringLiteralAH(q, extinfo->extconfig, fout);
+ appendStringLiteralArchive(q, extinfo->extconfig, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
if (strlen(extinfo->extcondition) > 2)
- appendStringLiteralAH(q, extinfo->extcondition, fout);
+ appendStringLiteralArchive(q, extinfo->extcondition, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
@@ -10165,7 +10165,7 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
{
if (n++ > 0)
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, extobj->name, fout);
+ appendStringLiteralArchive(q, extobj->name, fout);
}
}
appendPQExpBufferStr(q, "]::pg_catalog.text[]");
@@ -10300,7 +10300,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
if (i > 0)
appendPQExpBufferChar(q, ',');
appendPQExpBufferStr(q, "\n ");
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
}
}
@@ -10323,7 +10323,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
"SELECT pg_catalog.binary_upgrade_set_next_pg_enum_oid('%u'::pg_catalog.oid);\n",
enum_oid);
appendPQExpBuffer(q, "ALTER TYPE %s ADD VALUE ", qualtypname);
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
appendPQExpBufferStr(q, ";\n\n");
}
}
@@ -10748,7 +10748,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, ",\n DEFAULT = ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -10764,7 +10764,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (strcmp(typcategory, "U") != 0)
{
appendPQExpBufferStr(q, ",\n CATEGORY = ");
- appendStringLiteralAH(q, typcategory, fout);
+ appendStringLiteralArchive(q, typcategory, fout);
}
if (strcmp(typispreferred, "t") == 0)
@@ -10773,7 +10773,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (typdelim && strcmp(typdelim, ",") != 0)
{
appendPQExpBufferStr(q, ",\n DELIMITER = ");
- appendStringLiteralAH(q, typdelim, fout);
+ appendStringLiteralArchive(q, typdelim, fout);
}
if (*typalign == TYPALIGN_CHAR)
@@ -10931,7 +10931,7 @@ dumpDomain(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, " DEFAULT ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -11151,9 +11151,9 @@ dumpCompositeType(Archive *fout, const TypeInfo *tyinfo)
"SET attlen = %s, "
"attalign = '%s', attbyval = false\n"
"WHERE attname = ", attlen, attalign);
- appendStringLiteralAH(dropped, attname, fout);
+ appendStringLiteralArchive(dropped, attname, fout);
appendPQExpBufferStr(dropped, "\n AND attrelid = ");
- appendStringLiteralAH(dropped, qualtypname, fout);
+ appendStringLiteralArchive(dropped, qualtypname, fout);
appendPQExpBufferStr(dropped, "::pg_catalog.regclass;\n");
appendPQExpBuffer(dropped, "ALTER TYPE %s ",
@@ -11283,7 +11283,7 @@ dumpCompositeTypeColComments(Archive *fout, const TypeInfo *tyinfo,
appendPQExpBuffer(query, "COMMENT ON COLUMN %s.",
fmtQualifiedDumpable(tyinfo));
appendPQExpBuffer(query, "%s IS ", fmtId(attname));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -11700,7 +11700,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
else if (probin[0] != '\0')
{
appendPQExpBufferStr(asPart, "AS ");
- appendStringLiteralAH(asPart, probin, fout);
+ appendStringLiteralArchive(asPart, probin, fout);
if (prosrc[0] != '\0')
{
appendPQExpBufferStr(asPart, ", ");
@@ -11711,7 +11711,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
*/
if (dopt->disable_dollar_quoting ||
(strchr(prosrc, '\'') == NULL && strchr(prosrc, '\\') == NULL))
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11721,7 +11721,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
appendPQExpBufferStr(asPart, "AS ");
/* with no bin, dollar quote src unconditionally if allowed */
if (dopt->disable_dollar_quoting)
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11892,13 +11892,13 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
{
if (nameptr != namelist)
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, *nameptr, fout);
+ appendStringLiteralArchive(q, *nameptr, fout);
}
}
pg_free(namelist);
}
else
- appendStringLiteralAH(q, pos, fout);
+ appendStringLiteralArchive(q, pos, fout);
}
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
@@ -13181,7 +13181,7 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (colliculocale != NULL)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, colliculocale, fout);
+ appendStringLiteralArchive(q, colliculocale, fout);
}
else
{
@@ -13191,14 +13191,14 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (strcmp(collcollate, collctype) == 0)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
}
else
{
appendPQExpBufferStr(q, ", lc_collate = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
appendPQExpBufferStr(q, ", lc_ctype = ");
- appendStringLiteralAH(q, collctype, fout);
+ appendStringLiteralArchive(q, collctype, fout);
}
}
@@ -13214,9 +13214,9 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (!PQgetisnull(res, 0, i_collversion))
{
appendPQExpBufferStr(q, ", version = ");
- appendStringLiteralAH(q,
- PQgetvalue(res, 0, i_collversion),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, 0, i_collversion),
+ fout);
}
}
@@ -13310,9 +13310,9 @@ dumpConversion(Archive *fout, const ConvInfo *convinfo)
appendPQExpBuffer(q, "CREATE %sCONVERSION %s FOR ",
(condefault) ? "DEFAULT " : "",
fmtQualifiedDumpable(convinfo));
- appendStringLiteralAH(q, conforencoding, fout);
+ appendStringLiteralArchive(q, conforencoding, fout);
appendPQExpBufferStr(q, " TO ");
- appendStringLiteralAH(q, contoencoding, fout);
+ appendStringLiteralArchive(q, contoencoding, fout);
/* regproc output is already sufficiently quoted */
appendPQExpBuffer(q, " FROM %s;\n", conproc);
@@ -13567,7 +13567,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_agginitval))
{
appendPQExpBufferStr(details, ",\n INITCOND = ");
- appendStringLiteralAH(details, agginitval, fout);
+ appendStringLiteralArchive(details, agginitval, fout);
}
if (strcmp(aggfinalfn, "-") != 0)
@@ -13623,7 +13623,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_aggminitval))
{
appendPQExpBufferStr(details, ",\n MINITCOND = ");
- appendStringLiteralAH(details, aggminitval, fout);
+ appendStringLiteralArchive(details, aggminitval, fout);
}
if (strcmp(aggmfinalfn, "-") != 0)
@@ -14168,12 +14168,12 @@ dumpForeignServer(Archive *fout, const ForeignServerInfo *srvinfo)
if (srvinfo->srvtype && strlen(srvinfo->srvtype) > 0)
{
appendPQExpBufferStr(q, " TYPE ");
- appendStringLiteralAH(q, srvinfo->srvtype, fout);
+ appendStringLiteralArchive(q, srvinfo->srvtype, fout);
}
if (srvinfo->srvversion && strlen(srvinfo->srvversion) > 0)
{
appendPQExpBufferStr(q, " VERSION ");
- appendStringLiteralAH(q, srvinfo->srvversion, fout);
+ appendStringLiteralArchive(q, srvinfo->srvversion, fout);
}
appendPQExpBufferStr(q, " FOREIGN DATA WRAPPER ");
@@ -14589,7 +14589,7 @@ dumpSecLabel(Archive *fout, const char *type, const char *name,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, labels[i].label, fout);
+ appendStringLiteralArchive(query, labels[i].label, fout);
appendPQExpBufferStr(query, ";\n");
}
@@ -14672,7 +14672,7 @@ dumpTableSecLabel(Archive *fout, const TableInfo *tbinfo, const char *reltypenam
}
appendPQExpBuffer(query, "SECURITY LABEL FOR %s ON %s IS ",
fmtId(provider), target->data);
- appendStringLiteralAH(query, label, fout);
+ appendStringLiteralArchive(query, label, fout);
appendPQExpBufferStr(query, ";\n");
}
if (query->len > 0)
@@ -15488,11 +15488,11 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "\n-- set missing value.\n");
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_set_missing_value(");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass,");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attmissingval[j], fout);
appendPQExpBufferStr(q, ");\n\n");
}
}
@@ -15535,9 +15535,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"WHERE attname = ",
tbinfo->attlen[j],
tbinfo->attalign[j]);
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->relkind == RELKIND_RELATION ||
@@ -15556,9 +15556,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_attribute\n"
"SET attislocal = false\n"
"WHERE attname = ");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
}
@@ -15584,9 +15584,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_constraint\n"
"SET conislocal = false\n"
"WHERE contype = 'c' AND conname = ");
- appendStringLiteralAH(q, constr->dobj.name, fout);
+ appendStringLiteralArchive(q, constr->dobj.name, fout);
appendPQExpBufferStr(q, "\n AND conrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -15629,7 +15629,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"SET relfrozenxid = '%u', relminmxid = '%u'\n"
"WHERE oid = ",
tbinfo->frozenxid, tbinfo->minmxid);
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->toast_oid)
@@ -15661,7 +15661,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_class\n"
"SET relispopulated = 't'\n"
"WHERE oid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -16910,7 +16910,7 @@ dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo)
resetPQExpBuffer(query);
appendPQExpBufferStr(query, "SELECT pg_catalog.setval(");
- appendStringLiteralAH(query, fmtQualifiedDumpable(tbinfo), fout);
+ appendStringLiteralArchive(query, fmtQualifiedDumpable(tbinfo), fout);
appendPQExpBuffer(query, ", %s, %s);\n",
last, (called ? "true" : "false"));
@@ -17072,7 +17072,7 @@ dumpTrigger(Archive *fout, const TriggerInfo *tginfo)
if (findx > 0)
appendPQExpBufferStr(query, ", ");
- appendStringLiteralAH(query, p, fout);
+ appendStringLiteralArchive(query, p, fout);
p += tlen + 1;
}
free(tgargs);
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 69ee939d4..427f5d45f 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -705,8 +705,8 @@ extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
extern TypeInfo *getTypes(Archive *fout, int *numTypes);
extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
-extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
-extern OprInfo *getOperators(Archive *fout, int *numOperators);
+extern AggInfo *getAggregates(Archive *fout, int *numAggs);
+extern OprInfo *getOperators(Archive *fout, int *numOprs);
extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
@@ -723,7 +723,7 @@ extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
-extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
+extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 69ae027bd..083012ca3 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -72,8 +72,10 @@ static void buildShSecLabels(PGconn *conn,
const char *catalog_name, Oid objectId,
const char *objtype, const char *objname,
PQExpBuffer buffer);
-static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
- const char *pguser, trivalue prompt_password, bool fail_on_error);
+static PGconn *connectDatabase(const char *dbname,
+ const char *connection_string, const char *pghost,
+ const char *pgport, const char *pguser,
+ trivalue prompt_password, bool fail_on_error);
static char *constructConnStr(const char **keywords, const char **values);
static PGresult *executeQuery(PGconn *conn, const char *query);
static void executeCommand(PGconn *conn, const char *query);
--
2.34.1
On Mon, Sep 19, 2022 at 11:36 PM Peter Geoghegan <pg@bowt.ie> wrote:
Attached revision v4 fixes those pg_dump patch items.
It also breaks out the ecpg changes into their own patch.
I pushed much of this just now. All that remains to bring the entire
codebase into compliance is the ecpg patch and the pg_dump patch.
Those two areas are relatively tricky. But it's now unlikely that I'll
need to push a commit that makes relatively many CF patches stop
applying against HEAD -- that part is over.
Once we're done with ecpg and pg_dump, we can talk about the actual
practicalities of formally adopting a project policy on consistent
parameter names. I mostly use clang-tidy via my editor's support for
the clangd language server -- clang-tidy is primarily a linter, so it
isn't necessarily run in bulk all that often. I'll need to come up
with instructions for running clang-tidy from the command line that
are easy to follow.
I've found that the run_clang_tidy script (AKA run-clang-tidy.py)
works, but the whole experience feels hobbled together. I think that
we really need something like a build target for this -- something
comparable to what we do to support GCOV. That would also allow us to
use additional clang-tidy checks, which might be useful. We might even
find it useful to come up with some novel check of our own. Apparently
it's not all that difficult to write one from scratch, to implement
custom rules. There are already custom rules for big open source
projects such as the Linux Kernel, Chromium, and LLVM itself.
--
Peter Geoghegan
On Tue, Sep 20, 2022 at 1:51 PM Peter Geoghegan <pg@bowt.ie> wrote:
I pushed much of this just now. All that remains to bring the entire
codebase into compliance is the ecpg patch and the pg_dump patch.
Those two areas are relatively tricky. But it's now unlikely that I'll
need to push a commit that makes relatively many CF patches stop
applying against HEAD -- that part is over.
Attached revision shows where I'm at with this. Would be nice to get
it all out of the way before too long.
Turns out that we'll need a new patch for contrib, which was missed
before now due to an issue with how I build a compilation database
using bear [1]https://github.com/rizsotto/Bear -- Peter Geoghegan. The new patch for contrib isn't very different to the
other patches, though. The most notable changes are in pgcrypto and
oid2name. Fairly minor stuff, overall.
[1]: https://github.com/rizsotto/Bear -- Peter Geoghegan
--
Peter Geoghegan
Attachments:
v5-0004-Harmonize-parameter-names-in-contrib-code.patchapplication/octet-stream; name=v5-0004-Harmonize-parameter-names-in-contrib-code.patchDownload
From a9a6836d4e806aae86441016d2e2f67af71775ca Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Wed, 21 Sep 2022 14:51:29 -0700
Subject: [PATCH v5 4/4] Harmonize parameter names in contrib code.
---
contrib/amcheck/verify_nbtree.c | 2 +-
contrib/cube/cube.c | 2 +-
contrib/dblink/dblink.c | 2 +-
contrib/fuzzystrmatch/dmetaphone.c | 2 +-
contrib/intarray/_int.h | 2 +-
contrib/intarray/_int_selfuncs.c | 4 ++--
contrib/intarray/_int_tool.c | 4 ++--
contrib/ltree/ltree.h | 2 +-
contrib/oid2name/oid2name.c | 14 ++++++------
contrib/pgcrypto/mbuf.h | 18 +++++++--------
contrib/pgcrypto/pgcrypto.c | 3 ++-
contrib/pgcrypto/pgp.h | 32 +++++++++++++--------------
contrib/pgcrypto/px-crypt.h | 6 ++---
contrib/pgcrypto/px.h | 2 +-
contrib/postgres_fdw/deparse.c | 2 +-
contrib/postgres_fdw/postgres_fdw.c | 2 +-
contrib/postgres_fdw/postgres_fdw.h | 2 +-
contrib/seg/seg.c | 2 +-
contrib/seg/segdata.h | 2 +-
contrib/tablefunc/tablefunc.c | 6 ++---
contrib/test_decoding/test_decoding.c | 6 ++---
21 files changed, 59 insertions(+), 58 deletions(-)
diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c
index 798adc5bc..9021d156e 100644
--- a/contrib/amcheck/verify_nbtree.c
+++ b/contrib/amcheck/verify_nbtree.c
@@ -159,7 +159,7 @@ static void bt_child_highkey_check(BtreeCheckState *state,
Page loaded_child,
uint32 target_level);
static void bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
- BlockNumber targetblock, Page target);
+ BlockNumber blkno, Page page);
static void bt_tuple_present_callback(Relation index, ItemPointer tid,
Datum *values, bool *isnull,
bool tupleIsAlive, void *checkstate);
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c
index 6e01800a4..01c6a9c55 100644
--- a/contrib/cube/cube.c
+++ b/contrib/cube/cube.c
@@ -96,7 +96,7 @@ int32 cube_cmp_v0(NDBOX *a, NDBOX *b);
bool cube_contains_v0(NDBOX *a, NDBOX *b);
bool cube_overlap_v0(NDBOX *a, NDBOX *b);
NDBOX *cube_union_v0(NDBOX *a, NDBOX *b);
-void rt_cube_size(NDBOX *a, double *sz);
+void rt_cube_size(NDBOX *a, double *size);
NDBOX *g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep);
bool g_cube_leaf_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 41cf45e87..9eef417c4 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -114,7 +114,7 @@ static void dblink_security_check(PGconn *conn, remoteConn *rconn);
static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
bool fail, const char *fmt,...) pg_attribute_printf(5, 6);
static char *get_connect_string(const char *servername);
-static char *escape_param_str(const char *from);
+static char *escape_param_str(const char *str);
static void validate_pkattnums(Relation rel,
int2vector *pkattnums_arg, int32 pknumatts_arg,
int **pkattnums, int *pknumatts);
diff --git a/contrib/fuzzystrmatch/dmetaphone.c b/contrib/fuzzystrmatch/dmetaphone.c
index 6f4d2b730..f8f2c2b44 100644
--- a/contrib/fuzzystrmatch/dmetaphone.c
+++ b/contrib/fuzzystrmatch/dmetaphone.c
@@ -117,7 +117,7 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
#include <ctype.h>
/* prototype for the main function we got from the perl module */
-static void DoubleMetaphone(char *, char **);
+static void DoubleMetaphone(char *str, char **codes);
#ifndef DMETAPHONE_MAIN
diff --git a/contrib/intarray/_int.h b/contrib/intarray/_int.h
index 304c29525..a52ec38ba 100644
--- a/contrib/intarray/_int.h
+++ b/contrib/intarray/_int.h
@@ -114,7 +114,7 @@ ArrayType *new_intArrayType(int num);
ArrayType *copy_intArrayType(ArrayType *a);
ArrayType *resize_intArrayType(ArrayType *a, int num);
int internal_size(int *a, int len);
-ArrayType *_int_unique(ArrayType *a);
+ArrayType *_int_unique(ArrayType *r);
int32 intarray_match_first(ArrayType *a, int32 elem);
ArrayType *intarray_add_elem(ArrayType *a, int32 elem);
ArrayType *intarray_concat_arrays(ArrayType *a, ArrayType *b);
diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c
index 3d8ff6781..6d5f6cc70 100644
--- a/contrib/intarray/_int_selfuncs.c
+++ b/contrib/intarray/_int_selfuncs.c
@@ -34,8 +34,8 @@ PG_FUNCTION_INFO_V1(_int_contained_joinsel);
PG_FUNCTION_INFO_V1(_int_matchsel);
-static Selectivity int_query_opr_selec(ITEM *item, Datum *values, float4 *freqs,
- int nmncelems, float4 minfreq);
+static Selectivity int_query_opr_selec(ITEM *item, Datum *mcelems, float4 *mcefreqs,
+ int nmcelems, float4 minfreq);
static int compare_val_int4(const void *a, const void *b);
/*
diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c
index 8ed4d63fc..5ab6eb81e 100644
--- a/contrib/intarray/_int_tool.c
+++ b/contrib/intarray/_int_tool.c
@@ -382,14 +382,14 @@ intarray_concat_arrays(ArrayType *a, ArrayType *b)
}
ArrayType *
-int_to_intset(int32 n)
+int_to_intset(int32 elem)
{
ArrayType *result;
int32 *aa;
result = new_intArrayType(1);
aa = ARRPTR(result);
- aa[0] = n;
+ aa[0] = elem;
return result;
}
diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h
index 3dd99ca68..40aed0ca0 100644
--- a/contrib/ltree/ltree.h
+++ b/contrib/ltree/ltree.h
@@ -206,7 +206,7 @@ bool ltree_execute(ITEM *curitem, void *checkval,
int ltree_compare(const ltree *a, const ltree *b);
bool inner_isparent(const ltree *c, const ltree *p);
-bool compare_subnode(ltree_level *t, char *q, int len,
+bool compare_subnode(ltree_level *t, char *qn, int len,
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
ltree *lca_inner(ltree **a, int len);
int ltree_strncasecmp(const char *a, const char *b, size_t s);
diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index 32d544483..4edf02d9c 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -48,15 +48,15 @@ struct options
/* function prototypes */
static void help(const char *progname);
-void get_opts(int, char **, struct options *);
+void get_opts(int argc, char **argv, struct options *my_opts);
void add_one_elt(char *eltname, eary *eary);
char *get_comma_elts(eary *eary);
-PGconn *sql_conn(struct options *);
-int sql_exec(PGconn *, const char *sql, bool quiet);
-void sql_exec_dumpalldbs(PGconn *, struct options *);
-void sql_exec_dumpalltables(PGconn *, struct options *);
-void sql_exec_searchtables(PGconn *, struct options *);
-void sql_exec_dumpalltbspc(PGconn *, struct options *);
+PGconn *sql_conn(struct options *my_opts);
+int sql_exec(PGconn *conn, const char *todo, bool quiet);
+void sql_exec_dumpalldbs(PGconn *conn, struct options *opts);
+void sql_exec_dumpalltables(PGconn *conn, struct options *opts);
+void sql_exec_searchtables(PGconn *conn, struct options *opts);
+void sql_exec_dumpalltbspc(PGconn *conn, struct options *opts);
/* function to parse command line options and check for some usage errors. */
void
diff --git a/contrib/pgcrypto/mbuf.h b/contrib/pgcrypto/mbuf.h
index adb18430b..97873c931 100644
--- a/contrib/pgcrypto/mbuf.h
+++ b/contrib/pgcrypto/mbuf.h
@@ -82,33 +82,33 @@ int mbuf_avail(MBuf *mbuf);
int mbuf_size(MBuf *mbuf);
int mbuf_grab(MBuf *mbuf, int len, uint8 **data_p);
int mbuf_steal_data(MBuf *mbuf, uint8 **data_p);
-int mbuf_append(MBuf *dst, const uint8 *buf, int cnt);
+int mbuf_append(MBuf *dst, const uint8 *buf, int len);
int mbuf_free(MBuf *mbuf);
/*
* Push filter
*/
-int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
- PushFilter *next);
+int pushf_create(PushFilter **mp_p, const PushFilterOps *op,
+ void *init_arg, PushFilter *next);
int pushf_write(PushFilter *mp, const uint8 *data, int len);
void pushf_free_all(PushFilter *mp);
void pushf_free(PushFilter *mp);
int pushf_flush(PushFilter *mp);
-int pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
+int pushf_create_mbuf_writer(PushFilter **res, MBuf *dst);
/*
* Pull filter
*/
-int pullf_create(PullFilter **res, const PullFilterOps *ops,
+int pullf_create(PullFilter **pf_p, const PullFilterOps *op,
void *init_arg, PullFilter *src);
-int pullf_read(PullFilter *mp, int len, uint8 **data_p);
-int pullf_read_max(PullFilter *mp, int len,
+int pullf_read(PullFilter *pf, int len, uint8 **data_p);
+int pullf_read_max(PullFilter *pf, int len,
uint8 **data_p, uint8 *tmpbuf);
-void pullf_free(PullFilter *mp);
+void pullf_free(PullFilter *pf);
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst);
-int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
+int pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src);
#define GETBYTE(pf, dst) \
do { \
diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c
index f0ac62504..8f882f4c6 100644
--- a/contrib/pgcrypto/pgcrypto.c
+++ b/contrib/pgcrypto/pgcrypto.c
@@ -45,7 +45,8 @@ PG_MODULE_MAGIC;
/* private stuff */
typedef int (*PFN) (const char *name, void **res);
-static void *find_provider(text *name, PFN pf, const char *desc, int silent);
+static void *find_provider(text *name, PFN provider_lookup, const char *desc,
+ int silent);
/* SQL function: hash(bytea, text) returns bytea */
PG_FUNCTION_INFO_V1(pg_digest);
diff --git a/contrib/pgcrypto/pgp.h b/contrib/pgcrypto/pgp.h
index 805f01af5..cb8b32aba 100644
--- a/contrib/pgcrypto/pgp.h
+++ b/contrib/pgcrypto/pgp.h
@@ -236,9 +236,9 @@ struct PGP_PubKey
int can_encrypt;
};
-int pgp_init(PGP_Context **ctx);
+int pgp_init(PGP_Context **ctx_p);
int pgp_encrypt(PGP_Context *ctx, MBuf *src, MBuf *dst);
-int pgp_decrypt(PGP_Context *ctx, MBuf *src, MBuf *dst);
+int pgp_decrypt(PGP_Context *ctx, MBuf *msrc, MBuf *mdst);
int pgp_free(PGP_Context *ctx);
int pgp_get_digest_code(const char *name);
@@ -246,7 +246,7 @@ int pgp_get_cipher_code(const char *name);
const char *pgp_get_digest_name(int code);
int pgp_set_cipher_algo(PGP_Context *ctx, const char *name);
-int pgp_set_s2k_mode(PGP_Context *ctx, int type);
+int pgp_set_s2k_mode(PGP_Context *ctx, int mode);
int pgp_set_s2k_count(PGP_Context *ctx, int count);
int pgp_set_s2k_cipher_algo(PGP_Context *ctx, const char *name);
int pgp_set_s2k_digest_algo(PGP_Context *ctx, const char *name);
@@ -259,22 +259,22 @@ int pgp_set_text_mode(PGP_Context *ctx, int mode);
int pgp_set_unicode_mode(PGP_Context *ctx, int mode);
int pgp_get_unicode_mode(PGP_Context *ctx);
-int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int klen);
+int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int len);
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt,
- const uint8 *key, int klen, int pubtype);
+ const uint8 *key, int key_len, int pubtype);
int pgp_get_keyid(MBuf *pgp_data, char *dst);
/* internal functions */
-int pgp_load_digest(int c, PX_MD **res);
-int pgp_load_cipher(int c, PX_Cipher **res);
-int pgp_get_cipher_key_size(int c);
-int pgp_get_cipher_block_size(int c);
+int pgp_load_digest(int code, PX_MD **res);
+int pgp_load_cipher(int code, PX_Cipher **res);
+int pgp_get_cipher_key_size(int code);
+int pgp_get_cipher_block_size(int code);
int pgp_s2k_fill(PGP_S2K *s2k, int mode, int digest_algo, int count);
int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k);
-int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int klen);
+int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int key_len);
typedef struct PGP_CFB PGP_CFB;
int pgp_cfb_create(PGP_CFB **ctx_p, int algo,
@@ -316,11 +316,11 @@ int pgp_mpi_write(PushFilter *dst, PGP_MPI *n);
int pgp_mpi_hash(PX_MD *md, PGP_MPI *n);
unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n);
-int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m,
- PGP_MPI **c1, PGP_MPI **c2);
-int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2,
- PGP_MPI **m);
-int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *m, PGP_MPI **c);
-int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *c, PGP_MPI **m);
+int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m,
+ PGP_MPI **c1_p, PGP_MPI **c2_p);
+int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2,
+ PGP_MPI **msg_p);
+int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p);
+int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p);
extern struct PullFilterOps pgp_decrypt_filter;
diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h
index 08001a81f..54de80696 100644
--- a/contrib/pgcrypto/px-crypt.h
+++ b/contrib/pgcrypto/px-crypt.h
@@ -48,8 +48,8 @@
/*
* main interface
*/
-char *px_crypt(const char *psw, const char *salt, char *buf, unsigned buflen);
-int px_gen_salt(const char *salt_type, char *dst, int rounds);
+char *px_crypt(const char *psw, const char *salt, char *buf, unsigned len);
+int px_gen_salt(const char *salt_type, char *buf, int rounds);
/*
* internal functions
@@ -77,6 +77,6 @@ char *px_crypt_des(const char *key, const char *setting);
/* crypt-md5.c */
char *px_crypt_md5(const char *pw, const char *salt,
- char *dst, unsigned dstlen);
+ char *passwd, unsigned dstlen);
#endif /* _PX_CRYPT_H */
diff --git a/contrib/pgcrypto/px.h b/contrib/pgcrypto/px.h
index 4ef40f3f1..471bb4ec7 100644
--- a/contrib/pgcrypto/px.h
+++ b/contrib/pgcrypto/px.h
@@ -176,7 +176,7 @@ int px_find_combo(const char *name, PX_Combo **res);
void px_THROW_ERROR(int err) pg_attribute_noreturn();
const char *px_strerror(int err);
-const char *px_resolve_alias(const PX_Alias *aliases, const char *name);
+const char *px_resolve_alias(const PX_Alias *list, const char *name);
void px_set_debug_handler(void (*handler) (const char *));
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index a9766f973..09f37fb77 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -149,7 +149,7 @@ static void deparseReturningList(StringInfo buf, RangeTblEntry *rte,
static void deparseColumnRef(StringInfo buf, int varno, int varattno,
RangeTblEntry *rte, bool qualify_col);
static void deparseRelation(StringInfo buf, Relation rel);
-static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
+static void deparseExpr(Expr *node, deparse_expr_cxt *context);
static void deparseVar(Var *node, deparse_expr_cxt *context);
static void deparseConst(Const *node, deparse_expr_cxt *context, int showtype);
static void deparseParam(Param *node, deparse_expr_cxt *context);
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index b76818f7f..dd858aba0 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -457,7 +457,7 @@ static PgFdwModifyState *create_foreign_modify(EState *estate,
Plan *subplan,
char *query,
List *target_attrs,
- int len,
+ int values_end,
bool has_returning,
List *retrieved_attrs);
static TupleTableSlot **execute_foreign_modify(EState *estate,
diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h
index 21f2b20ce..a11d45bed 100644
--- a/contrib/postgres_fdw/postgres_fdw.h
+++ b/contrib/postgres_fdw/postgres_fdw.h
@@ -226,7 +226,7 @@ extern EquivalenceMember *find_em_for_rel_target(PlannerInfo *root,
RelOptInfo *rel);
extern List *build_tlist_to_deparse(RelOptInfo *foreignrel);
extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root,
- RelOptInfo *foreignrel, List *tlist,
+ RelOptInfo *rel, List *tlist,
List *remote_conds, List *pathkeys,
bool has_final_sort, bool has_limit,
bool is_subquery,
diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c
index 4a8e2be32..cb677e0ae 100644
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -92,7 +92,7 @@ PG_FUNCTION_INFO_V1(seg_different);
/*
** Auxiliary functions
*/
-static int restore(char *s, float val, int n);
+static int restore(char *result, float val, int n);
/*****************************************************************************
diff --git a/contrib/seg/segdata.h b/contrib/seg/segdata.h
index 9488bf3a8..f4eafc865 100644
--- a/contrib/seg/segdata.h
+++ b/contrib/seg/segdata.h
@@ -12,7 +12,7 @@ typedef struct SEG
} SEG;
/* in seg.c */
-extern int significant_digits(const char *str);
+extern int significant_digits(const char *s);
/* in segscan.l */
extern int seg_yylex(void);
diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c
index e308228bd..b967e6d4b 100644
--- a/contrib/tablefunc/tablefunc.c
+++ b/contrib/tablefunc/tablefunc.c
@@ -51,9 +51,9 @@ static Tuplestorestate *get_crosstab_tuplestore(char *sql,
HTAB *crosstab_hash,
TupleDesc tupdesc,
bool randomAccess);
-static void validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool show_serial);
-static bool compatCrosstabTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
-static void compatConnectbyTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
+static void validateConnectbyTupleDesc(TupleDesc td, bool show_branch, bool show_serial);
+static bool compatCrosstabTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc);
+static void compatConnectbyTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc);
static void get_normal_pair(float8 *x1, float8 *x2);
static Tuplestorestate *connectby(char *relname,
char *key_fld,
diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c
index 3f90ffa32..e0fd6f176 100644
--- a/contrib/test_decoding/test_decoding.c
+++ b/contrib/test_decoding/test_decoding.c
@@ -60,7 +60,7 @@ static void pg_output_begin(LogicalDecodingContext *ctx,
static void pg_decode_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pg_decode_change(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, Relation rel,
+ ReorderBufferTXN *txn, Relation relation,
ReorderBufferChange *change);
static void pg_decode_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
@@ -69,7 +69,7 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx,
static bool pg_decode_filter(LogicalDecodingContext *ctx,
RepOriginId origin_id);
static void pg_decode_message(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, XLogRecPtr message_lsn,
+ ReorderBufferTXN *txn, XLogRecPtr lsn,
bool transactional, const char *prefix,
Size sz, const char *message);
static bool pg_decode_filter_prepare(LogicalDecodingContext *ctx,
@@ -109,7 +109,7 @@ static void pg_decode_stream_change(LogicalDecodingContext *ctx,
Relation relation,
ReorderBufferChange *change);
static void pg_decode_stream_message(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, XLogRecPtr message_lsn,
+ ReorderBufferTXN *txn, XLogRecPtr lsn,
bool transactional, const char *prefix,
Size sz, const char *message);
static void pg_decode_stream_truncate(LogicalDecodingContext *ctx,
--
2.34.1
v5-0001-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchapplication/octet-stream; name=v5-0001-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchDownload
From 08665d2b4b7ab432bf14b487217642225fab07b9 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Wed, 21 Sep 2022 14:51:29 -0700
Subject: [PATCH v5 1/4] Harmonize parameter names in pg_dump/pg_dumpall.
Make sure that function declarations use names that exactly match the
corresponding names from function definitions. Having parameter names
that are reliably consistent in this way will make it easier to reason
about groups of related C functions from the same translation unit as a
module. It will also make certain refactoring tasks easier.
Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy. Later commits will do the
same for other parts of the codebase.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
---
src/bin/pg_dump/common.c | 2 +-
src/bin/pg_dump/parallel.c | 14 +-
src/bin/pg_dump/pg_backup.h | 36 ++--
src/bin/pg_dump/pg_backup_archiver.c | 75 ++++----
src/bin/pg_dump/pg_backup_archiver.h | 10 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_db.c | 40 ++--
src/bin/pg_dump/pg_backup_db.h | 12 +-
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_null.c | 8 +-
src/bin/pg_dump/pg_backup_tar.c | 4 +-
src/bin/pg_dump/pg_dump.c | 262 +++++++++++++-------------
src/bin/pg_dump/pg_dump.h | 6 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
14 files changed, 240 insertions(+), 239 deletions(-)
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 395f817fa..44fa52cc5 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -79,7 +79,7 @@ typedef struct _catalogIdMapEntry
static catalogid_hash *catalogIdHash = NULL;
-static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables,
+static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables);
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c8a70d9bc..ba6df9e0c 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -146,7 +146,7 @@ static int pgpipe(int handles[2]);
typedef struct ShutdownInformation
{
ParallelState *pstate;
- Archive *AHX;
+ Archive *A;
} ShutdownInformation;
static ShutdownInformation shutdown_info;
@@ -325,9 +325,9 @@ getThreadLocalPQExpBuffer(void)
* as soon as they've created the ArchiveHandle.
*/
void
-on_exit_close_archive(Archive *AHX)
+on_exit_close_archive(Archive *A)
{
- shutdown_info.AHX = AHX;
+ shutdown_info.A = A;
on_exit_nicely(archive_close_connection, &shutdown_info);
}
@@ -353,8 +353,8 @@ archive_close_connection(int code, void *arg)
*/
ShutdownWorkersHard(si->pstate);
- if (si->AHX)
- DisconnectDatabase(si->AHX);
+ if (si->A)
+ DisconnectDatabase(si->A);
}
else
{
@@ -378,8 +378,8 @@ archive_close_connection(int code, void *arg)
else
{
/* Non-parallel operation: just kill the leader DB connection */
- if (si->AHX)
- DisconnectDatabase(si->AHX);
+ if (si->A)
+ DisconnectDatabase(si->A);
}
}
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fcc5f6bd0..9dc441902 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -270,33 +270,33 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods.
*/
-typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+typedef int (*DataDumperPtr) (Archive *A, const void *userArg);
-typedef void (*SetupWorkerPtrType) (Archive *AH);
+typedef void (*SetupWorkerPtrType) (Archive *A);
/*
* Main archiver interface.
*/
-extern void ConnectDatabase(Archive *AHX,
+extern void ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect);
-extern void DisconnectDatabase(Archive *AHX);
-extern PGconn *GetConnection(Archive *AHX);
+extern void DisconnectDatabase(Archive *A);
+extern PGconn *GetConnection(Archive *A);
/* Called to write *data* to the archive */
-extern void WriteData(Archive *AH, const void *data, size_t dLen);
+extern void WriteData(Archive *A, const void *data, size_t dLen);
-extern int StartBlob(Archive *AH, Oid oid);
-extern int EndBlob(Archive *AH, Oid oid);
+extern int StartBlob(Archive *A, Oid oid);
+extern int EndBlob(Archive *A, Oid oid);
-extern void CloseArchive(Archive *AH);
+extern void CloseArchive(Archive *A);
-extern void SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt);
+extern void SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt);
-extern void ProcessArchiveRestoreOptions(Archive *AH);
+extern void ProcessArchiveRestoreOptions(Archive *A);
-extern void RestoreArchive(Archive *AH);
+extern void RestoreArchive(Archive *A);
/* Open an existing archive */
extern Archive *OpenArchive(const char *FileSpec, const ArchiveFormat fmt);
@@ -307,7 +307,7 @@ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt,
SetupWorkerPtrType setupDumpWorker);
/* The --list option */
-extern void PrintTOCSummary(Archive *AH);
+extern void PrintTOCSummary(Archive *A);
extern RestoreOptions *NewRestoreOptions(void);
@@ -316,13 +316,13 @@ extern void InitDumpOptions(DumpOptions *opts);
extern DumpOptions *dumpOptionsFromRestoreOptions(RestoreOptions *ropt);
/* Rearrange and filter TOC entries */
-extern void SortTocFromFile(Archive *AHX);
+extern void SortTocFromFile(Archive *A);
/* Convenience functions used only when writing DATA */
-extern void archputs(const char *s, Archive *AH);
-extern int archprintf(Archive *AH, const char *fmt,...) pg_attribute_printf(2, 3);
+extern void archputs(const char *s, Archive *A);
+extern int archprintf(Archive *A, const char *fmt,...) pg_attribute_printf(2, 3);
-#define appendStringLiteralAH(buf,str,AH) \
- appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings)
+#define appendStringLiteralArchive(buf,str,A) \
+ appendStringLiteral(buf, str, (A)->encoding, (A)->std_strings)
#endif /* PG_BACKUP_H */
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 233198afc..e459f2755 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -227,9 +227,9 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt)
* setup doesn't need to know anything much, so it's defined here.
*/
static void
-setupRestoreWorker(Archive *AHX)
+setupRestoreWorker(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ReopenPtr(AH);
}
@@ -261,10 +261,10 @@ OpenArchive(const char *FileSpec, const ArchiveFormat fmt)
/* Public */
void
-CloseArchive(Archive *AHX)
+CloseArchive(Archive *A)
{
int res = 0;
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ClosePtr(AH);
@@ -281,22 +281,22 @@ CloseArchive(Archive *AHX)
/* Public */
void
-SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt)
+SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt)
{
/* Caller can omit dump options, in which case we synthesize them */
if (dopt == NULL && ropt != NULL)
dopt = dumpOptionsFromRestoreOptions(ropt);
/* Save options for later access */
- AH->dopt = dopt;
- AH->ropt = ropt;
+ A->dopt = dopt;
+ A->ropt = ropt;
}
/* Public */
void
-ProcessArchiveRestoreOptions(Archive *AHX)
+ProcessArchiveRestoreOptions(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -349,9 +349,9 @@ ProcessArchiveRestoreOptions(Archive *AHX)
/* Public */
void
-RestoreArchive(Archive *AHX)
+RestoreArchive(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
bool parallel_mode;
TocEntry *te;
@@ -415,10 +415,10 @@ RestoreArchive(Archive *AHX)
* restore; allow the attempt regardless of the version of the restore
* target.
*/
- AHX->minRemoteVersion = 0;
- AHX->maxRemoteVersion = 9999999;
+ A->minRemoteVersion = 0;
+ A->maxRemoteVersion = 9999999;
- ConnectDatabase(AHX, &ropt->cparams, false);
+ ConnectDatabase(A, &ropt->cparams, false);
/*
* If we're talking to the DB directly, don't send comments since they
@@ -479,7 +479,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- StartTransaction(AHX);
+ StartTransaction(A);
else
ahprintf(AH, "BEGIN;\n\n");
}
@@ -724,7 +724,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- CommitTransaction(AHX);
+ CommitTransaction(A);
else
ahprintf(AH, "COMMIT;\n\n");
}
@@ -1031,9 +1031,9 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te)
/* Public */
void
-WriteData(Archive *AHX, const void *data, size_t dLen)
+WriteData(Archive *A, const void *data, size_t dLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->currToc)
pg_fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
@@ -1052,10 +1052,9 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
/* Public */
TocEntry *
-ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
- ArchiveOpts *opts)
+ArchiveEntry(Archive *A, CatalogId catalogId, DumpId dumpId, ArchiveOpts *opts)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
TocEntry *newToc;
newToc = (TocEntry *) pg_malloc0(sizeof(TocEntry));
@@ -1110,9 +1109,9 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
/* Public */
void
-PrintTOCSummary(Archive *AHX)
+PrintTOCSummary(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -1214,9 +1213,9 @@ PrintTOCSummary(Archive *AHX)
/* Called by a dumper to signal start of a BLOB */
int
-StartBlob(Archive *AHX, Oid oid)
+StartBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->StartBlobPtr)
pg_fatal("large-object output not supported in chosen format");
@@ -1228,9 +1227,9 @@ StartBlob(Archive *AHX, Oid oid)
/* Called by a dumper to signal end of a BLOB */
int
-EndBlob(Archive *AHX, Oid oid)
+EndBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->EndBlobPtr)
AH->EndBlobPtr(AH, AH->currToc, oid);
@@ -1358,9 +1357,9 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
***********/
void
-SortTocFromFile(Archive *AHX)
+SortTocFromFile(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
FILE *fh;
StringInfoData linebuf;
@@ -1439,14 +1438,14 @@ SortTocFromFile(Archive *AHX)
/* Public */
void
-archputs(const char *s, Archive *AH)
+archputs(const char *s, Archive *A)
{
- WriteData(AH, s, strlen(s));
+ WriteData(A, s, strlen(s));
}
/* Public */
int
-archprintf(Archive *AH, const char *fmt,...)
+archprintf(Archive *A, const char *fmt,...)
{
int save_errno = errno;
char *p;
@@ -1474,7 +1473,7 @@ archprintf(Archive *AH, const char *fmt,...)
len = cnt;
}
- WriteData(AH, p, cnt);
+ WriteData(A, p, cnt);
free(p);
return (int) cnt;
}
@@ -1652,10 +1651,10 @@ dump_lo_buf(ArchiveHandle *AH)
{
PQExpBuffer buf = createPQExpBuffer();
- appendByteaLiteralAHX(buf,
- (const unsigned char *) AH->lo_buf,
- AH->lo_buf_used,
- AH);
+ appendByteaLiteralAH(buf,
+ (const unsigned char *) AH->lo_buf,
+ AH->lo_buf_used,
+ AH);
/* Hack: turn off writingBlob so ahwrite doesn't recurse to here */
AH->writingBlob = 0;
@@ -3125,7 +3124,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
* SQL requires a string literal here. Might as well be correct.
*/
if (user && *user)
- appendStringLiteralAHX(cmd, user, AH);
+ appendStringLiteralAH(cmd, user, AH);
else
appendPQExpBufferStr(cmd, "DEFAULT");
appendPQExpBufferChar(cmd, ';');
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 084cd87e8..a106513a3 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -404,7 +404,7 @@ struct _tocEntry
};
extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
-extern void on_exit_close_archive(Archive *AHX);
+extern void on_exit_close_archive(Archive *A);
extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
@@ -428,7 +428,7 @@ typedef struct _archiveOpts
} ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */
-extern TocEntry *ArchiveEntry(Archive *AHX, CatalogId catalogId,
+extern TocEntry *ArchiveEntry(Archive *A, CatalogId catalogId,
DumpId dumpId, ArchiveOpts *opts);
extern void WriteHead(ArchiveHandle *AH);
@@ -444,10 +444,10 @@ extern int TocIDRequired(ArchiveHandle *AH, DumpId id);
TocEntry *getTocEntryByDumpId(ArchiveHandle *AH, DumpId id);
extern bool checkSeek(FILE *fp);
-#define appendStringLiteralAHX(buf,str,AH) \
+#define appendStringLiteralAH(buf,str,AH) \
appendStringLiteral(buf, str, (AH)->public.encoding, (AH)->public.std_strings)
-#define appendByteaLiteralAHX(buf,str,len,AH) \
+#define appendByteaLiteralAH(buf,str,len,AH) \
appendByteaLiteral(buf, str, len, (AH)->public.std_strings)
/*
@@ -457,7 +457,7 @@ extern bool checkSeek(FILE *fp);
extern size_t WriteInt(ArchiveHandle *AH, int i);
extern int ReadInt(ArchiveHandle *AH);
extern char *ReadStr(ArchiveHandle *AH);
-extern size_t WriteStr(ArchiveHandle *AH, const char *s);
+extern size_t WriteStr(ArchiveHandle *AH, const char *c);
int ReadOffset(ArchiveHandle *, pgoff_t *);
size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 1023fea01..a0a55a1ed 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -40,7 +40,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 28baa68fd..6485b1ee1 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -98,20 +98,20 @@ ReconnectToServer(ArchiveHandle *AH, const char *dbname)
/*
* Make, or remake, a database connection with the given parameters.
*
- * The resulting connection handle is stored in AHX->connection.
+ * The resulting connection handle is stored in AH->connection.
*
* An interactive password prompt is automatically issued if required.
- * We store the results of that in AHX->savedPassword.
+ * We store the results of that in AH->savedPassword.
* Note: it's not really all that sensible to use a single-entry password
* cache if the username keeps changing. In current usage, however, the
* username never does change, so one savedPassword is sufficient.
*/
void
-ConnectDatabase(Archive *AHX,
+ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
trivalue prompt_password;
char *password;
bool new_pass;
@@ -222,9 +222,9 @@ ConnectDatabase(Archive *AHX,
* have one running.
*/
void
-DisconnectDatabase(Archive *AHX)
+DisconnectDatabase(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
char errbuf[1];
if (!AH->connection)
@@ -251,9 +251,9 @@ DisconnectDatabase(Archive *AHX)
}
PGconn *
-GetConnection(Archive *AHX)
+GetConnection(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
return AH->connection;
}
@@ -275,9 +275,9 @@ die_on_query_failure(ArchiveHandle *AH, const char *query)
}
void
-ExecuteSqlStatement(Archive *AHX, const char *query)
+ExecuteSqlStatement(Archive *A, const char *query)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -287,9 +287,9 @@ ExecuteSqlStatement(Archive *AHX, const char *query)
}
PGresult *
-ExecuteSqlQuery(Archive *AHX, const char *query, ExecStatusType status)
+ExecuteSqlQuery(Archive *A, const char *query, ExecStatusType status)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -442,9 +442,9 @@ ExecuteSimpleCommands(ArchiveHandle *AH, const char *buf, size_t bufLen)
* Implement ahwrite() for direct-to-DB restore
*/
int
-ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen)
+ExecuteSqlCommandBuf(Archive *A, const char *buf, size_t bufLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->outputKind == OUTPUT_COPYDATA)
{
@@ -497,9 +497,9 @@ ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen)
* Terminate a COPY operation during direct-to-DB restore
*/
void
-EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
+EndDBCopyMode(Archive *A, const char *tocEntryTag)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->pgCopyIn)
{
@@ -526,17 +526,17 @@ EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
}
void
-StartTransaction(Archive *AHX)
+StartTransaction(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
ExecuteSqlCommand(AH, "BEGIN", "could not start database transaction");
}
void
-CommitTransaction(Archive *AHX)
+CommitTransaction(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
ExecuteSqlCommand(AH, "COMMIT", "could not commit database transaction");
}
diff --git a/src/bin/pg_dump/pg_backup_db.h b/src/bin/pg_dump/pg_backup_db.h
index 8888dd34b..b96e2594e 100644
--- a/src/bin/pg_dump/pg_backup_db.h
+++ b/src/bin/pg_dump/pg_backup_db.h
@@ -11,16 +11,16 @@
#include "pg_backup.h"
-extern int ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen);
+extern int ExecuteSqlCommandBuf(Archive *A, const char *buf, size_t bufLen);
-extern void ExecuteSqlStatement(Archive *AHX, const char *query);
-extern PGresult *ExecuteSqlQuery(Archive *AHX, const char *query,
+extern void ExecuteSqlStatement(Archive *A, const char *query);
+extern PGresult *ExecuteSqlQuery(Archive *A, const char *query,
ExecStatusType status);
extern PGresult *ExecuteSqlQueryForSingleRow(Archive *fout, const char *query);
-extern void EndDBCopyMode(Archive *AHX, const char *tocEntryTag);
+extern void EndDBCopyMode(Archive *A, const char *tocEntryTag);
-extern void StartTransaction(Archive *AHX);
-extern void CommitTransaction(Archive *AHX);
+extern void StartTransaction(Archive *A);
+extern void CommitTransaction(Archive *A);
#endif
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 3f46f7988..798182b6f 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -67,7 +67,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c
index 541306d99..7eda176bb 100644
--- a/src/bin/pg_dump/pg_backup_null.c
+++ b/src/bin/pg_dump/pg_backup_null.c
@@ -99,10 +99,10 @@ _WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen)
{
PQExpBuffer buf = createPQExpBuffer();
- appendByteaLiteralAHX(buf,
- (const unsigned char *) data,
- dLen,
- AH);
+ appendByteaLiteralAH(buf,
+ (const unsigned char *) data,
+ dLen,
+ AH);
ahprintf(AH, "SELECT pg_catalog.lowrite(0, %s);\n", buf->data);
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 7960b81c0..402b93c61 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -46,7 +46,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
@@ -97,7 +97,7 @@ typedef struct
static void _LoadBlobs(ArchiveHandle *AH);
static TAR_MEMBER *tarOpen(ArchiveHandle *AH, const char *filename, char mode);
-static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
+static void tarClose(ArchiveHandle *AH, TAR_MEMBER *th);
#ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 67b6d9079..e4013fd0d 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -159,7 +159,7 @@ static int nseclabels = 0;
(obj)->dobj.name)
static void help(const char *progname);
-static void setup_connection(Archive *AH,
+static void setup_connection(Archive *A,
const char *dumpencoding, const char *dumpsnapshot,
char *use_role);
static ArchiveFormat parseArchiveFormat(const char *format, ArchiveMode *mode);
@@ -221,7 +221,7 @@ static void dumpFunc(Archive *fout, const FuncInfo *finfo);
static void dumpCast(Archive *fout, const CastInfo *cast);
static void dumpTransform(Archive *fout, const TransformInfo *transform);
static void dumpOpr(Archive *fout, const OprInfo *oprinfo);
-static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *oprinfo);
+static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *aminfo);
static void dumpOpclass(Archive *fout, const OpclassInfo *opcinfo);
static void dumpOpfamily(Archive *fout, const OpfamilyInfo *opfinfo);
static void dumpCollation(Archive *fout, const CollInfo *collinfo);
@@ -232,7 +232,7 @@ static void dumpTrigger(Archive *fout, const TriggerInfo *tginfo);
static void dumpEventTrigger(Archive *fout, const EventTriggerInfo *evtinfo);
static void dumpTable(Archive *fout, const TableInfo *tbinfo);
static void dumpTableSchema(Archive *fout, const TableInfo *tbinfo);
-static void dumpTableAttach(Archive *fout, const TableAttachInfo *tbinfo);
+static void dumpTableAttach(Archive *fout, const TableAttachInfo *attachinfo);
static void dumpAttrDef(Archive *fout, const AttrDefInfo *adinfo);
static void dumpSequence(Archive *fout, const TableInfo *tbinfo);
static void dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo);
@@ -287,12 +287,12 @@ static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
static void dumpPublicationTable(Archive *fout, const PublicationRelInfo *pubrinfo);
static void dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo);
-static void dumpDatabase(Archive *AH);
+static void dumpDatabase(Archive *fout);
static void dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
const char *dbname, Oid dboid);
-static void dumpEncoding(Archive *AH);
-static void dumpStdStrings(Archive *AH);
-static void dumpSearchPath(Archive *AH);
+static void dumpEncoding(Archive *A);
+static void dumpStdStrings(Archive *A);
+static void dumpSearchPath(Archive *A);
static void binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
PQExpBuffer upgrade_buffer,
Oid pg_type_oid,
@@ -315,7 +315,7 @@ static bool nonemptyReloptions(const char *reloptions);
static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
const char *prefix, Archive *fout);
static char *get_synchronized_snapshot(Archive *fout);
-static void setupDumpWorker(Archive *AHX);
+static void setupDumpWorker(Archive *A);
static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
@@ -1069,14 +1069,14 @@ help(const char *progname)
}
static void
-setup_connection(Archive *AH, const char *dumpencoding,
+setup_connection(Archive *A, const char *dumpencoding,
const char *dumpsnapshot, char *use_role)
{
- DumpOptions *dopt = AH->dopt;
- PGconn *conn = GetConnection(AH);
+ DumpOptions *dopt = A->dopt;
+ PGconn *conn = GetConnection(A);
const char *std_strings;
- PQclear(ExecuteSqlQueryForSingleRow(AH, ALWAYS_SECURE_SEARCH_PATH_SQL));
+ PQclear(ExecuteSqlQueryForSingleRow(A, ALWAYS_SECURE_SEARCH_PATH_SQL));
/*
* Set the client encoding if requested.
@@ -1092,18 +1092,18 @@ setup_connection(Archive *AH, const char *dumpencoding,
* Get the active encoding and the standard_conforming_strings setting, so
* we know how to escape strings.
*/
- AH->encoding = PQclientEncoding(conn);
+ A->encoding = PQclientEncoding(conn);
std_strings = PQparameterStatus(conn, "standard_conforming_strings");
- AH->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
+ A->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
/*
* Set the role if requested. In a parallel dump worker, we'll be passed
- * use_role == NULL, but AH->use_role is already set (if user specified it
+ * use_role == NULL, but A->use_role is already set (if user specified it
* originally) and we should use that.
*/
- if (!use_role && AH->use_role)
- use_role = AH->use_role;
+ if (!use_role && A->use_role)
+ use_role = A->use_role;
/* Set the role if requested */
if (use_role)
@@ -1111,19 +1111,19 @@ setup_connection(Archive *AH, const char *dumpencoding,
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query, "SET ROLE %s", fmtId(use_role));
- ExecuteSqlStatement(AH, query->data);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
/* save it for possible later use by parallel workers */
- if (!AH->use_role)
- AH->use_role = pg_strdup(use_role);
+ if (!A->use_role)
+ A->use_role = pg_strdup(use_role);
}
/* Set the datestyle to ISO to ensure the dump's portability */
- ExecuteSqlStatement(AH, "SET DATESTYLE = ISO");
+ ExecuteSqlStatement(A, "SET DATESTYLE = ISO");
/* Likewise, avoid using sql_standard intervalstyle */
- ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
+ ExecuteSqlStatement(A, "SET INTERVALSTYLE = POSTGRES");
/*
* Use an explicitly specified extra_float_digits if it has been provided.
@@ -1136,54 +1136,54 @@ setup_connection(Archive *AH, const char *dumpencoding,
appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits);
- ExecuteSqlStatement(AH, q->data);
+ ExecuteSqlStatement(A, q->data);
destroyPQExpBuffer(q);
}
else
- ExecuteSqlStatement(AH, "SET extra_float_digits TO 3");
+ ExecuteSqlStatement(A, "SET extra_float_digits TO 3");
/*
* Disable synchronized scanning, to prevent unpredictable changes in row
* ordering across a dump and reload.
*/
- ExecuteSqlStatement(AH, "SET synchronize_seqscans TO off");
+ ExecuteSqlStatement(A, "SET synchronize_seqscans TO off");
/*
* Disable timeouts if supported.
*/
- ExecuteSqlStatement(AH, "SET statement_timeout = 0");
- if (AH->remoteVersion >= 90300)
- ExecuteSqlStatement(AH, "SET lock_timeout = 0");
- if (AH->remoteVersion >= 90600)
- ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
+ ExecuteSqlStatement(A, "SET statement_timeout = 0");
+ if (A->remoteVersion >= 90300)
+ ExecuteSqlStatement(A, "SET lock_timeout = 0");
+ if (A->remoteVersion >= 90600)
+ ExecuteSqlStatement(A, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.
*/
if (quote_all_identifiers)
- ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ ExecuteSqlStatement(A, "SET quote_all_identifiers = true");
/*
* Adjust row-security mode, if supported.
*/
- if (AH->remoteVersion >= 90500)
+ if (A->remoteVersion >= 90500)
{
if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security = on");
+ ExecuteSqlStatement(A, "SET row_security = on");
else
- ExecuteSqlStatement(AH, "SET row_security = off");
+ ExecuteSqlStatement(A, "SET row_security = off");
}
/*
* Initialize prepared-query state to "nothing prepared". We do this here
* so that a parallel dump worker will have its own state.
*/
- AH->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
+ A->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
- ExecuteSqlStatement(AH, "BEGIN");
+ ExecuteSqlStatement(A, "BEGIN");
/*
* To support the combination of serializable_deferrable with the jobs
@@ -1193,52 +1193,52 @@ setup_connection(Archive *AH, const char *dumpencoding,
* REPEATABLE READ transaction provides the appropriate integrity
* guarantees. This is a kluge, but safe for back-patching.
*/
- if (dopt->serializable_deferrable && AH->sync_snapshot_id == NULL)
- ExecuteSqlStatement(AH,
+ if (dopt->serializable_deferrable && A->sync_snapshot_id == NULL)
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
- ExecuteSqlStatement(AH,
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ, READ ONLY");
/*
* If user specified a snapshot to use, select that. In a parallel dump
- * worker, we'll be passed dumpsnapshot == NULL, but AH->sync_snapshot_id
+ * worker, we'll be passed dumpsnapshot == NULL, but A->sync_snapshot_id
* is already set (if the server can handle it) and we should use that.
*/
if (dumpsnapshot)
- AH->sync_snapshot_id = pg_strdup(dumpsnapshot);
+ A->sync_snapshot_id = pg_strdup(dumpsnapshot);
- if (AH->sync_snapshot_id)
+ if (A->sync_snapshot_id)
{
PQExpBuffer query = createPQExpBuffer();
appendPQExpBufferStr(query, "SET TRANSACTION SNAPSHOT ");
- appendStringLiteralConn(query, AH->sync_snapshot_id, conn);
- ExecuteSqlStatement(AH, query->data);
+ appendStringLiteralConn(query, A->sync_snapshot_id, conn);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
}
- else if (AH->numWorkers > 1)
+ else if (A->numWorkers > 1)
{
- if (AH->isStandby && AH->remoteVersion < 100000)
+ if (A->isStandby && A->remoteVersion < 100000)
pg_fatal("parallel dumps from standby servers are not supported by this server version");
- AH->sync_snapshot_id = get_synchronized_snapshot(AH);
+ A->sync_snapshot_id = get_synchronized_snapshot(A);
}
}
/* Set up connection for a parallel worker process */
static void
-setupDumpWorker(Archive *AH)
+setupDumpWorker(Archive *A)
{
/*
* We want to re-select all the same values the leader connection is
* using. We'll have inherited directly-usable values in
- * AH->sync_snapshot_id and AH->use_role, but we need to translate the
+ * A->sync_snapshot_id and A->use_role, but we need to translate the
* inherited encoding value back to a string to pass to setup_connection.
*/
- setup_connection(AH,
- pg_encoding_to_char(AH->encoding),
+ setup_connection(A,
+ pg_encoding_to_char(A->encoding),
NULL,
NULL);
}
@@ -2320,9 +2320,9 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
default:
/* All other types are printed as string literals. */
resetPQExpBuffer(q);
- appendStringLiteralAH(q,
- PQgetvalue(res, tuple, field),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, tuple, field),
+ fout);
archputs(q->data, fout);
break;
}
@@ -2920,7 +2920,7 @@ dumpDatabase(Archive *fout)
if (strlen(encoding) > 0)
{
appendPQExpBufferStr(creaQry, " ENCODING = ");
- appendStringLiteralAH(creaQry, encoding, fout);
+ appendStringLiteralArchive(creaQry, encoding, fout);
}
appendPQExpBufferStr(creaQry, " LOCALE_PROVIDER = ");
@@ -2935,25 +2935,25 @@ dumpDatabase(Archive *fout)
if (strlen(collate) > 0 && strcmp(collate, ctype) == 0)
{
appendPQExpBufferStr(creaQry, " LOCALE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
else
{
if (strlen(collate) > 0)
{
appendPQExpBufferStr(creaQry, " LC_COLLATE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
if (strlen(ctype) > 0)
{
appendPQExpBufferStr(creaQry, " LC_CTYPE = ");
- appendStringLiteralAH(creaQry, ctype, fout);
+ appendStringLiteralArchive(creaQry, ctype, fout);
}
}
if (iculocale)
{
appendPQExpBufferStr(creaQry, " ICU_LOCALE = ");
- appendStringLiteralAH(creaQry, iculocale, fout);
+ appendStringLiteralArchive(creaQry, iculocale, fout);
}
/*
@@ -2965,9 +2965,9 @@ dumpDatabase(Archive *fout)
if (!PQgetisnull(res, 0, i_datcollversion))
{
appendPQExpBufferStr(creaQry, " COLLATION_VERSION = ");
- appendStringLiteralAH(creaQry,
- PQgetvalue(res, 0, i_datcollversion),
- fout);
+ appendStringLiteralArchive(creaQry,
+ PQgetvalue(res, 0, i_datcollversion),
+ fout);
}
}
@@ -3021,7 +3021,7 @@ dumpDatabase(Archive *fout)
* database.
*/
appendPQExpBuffer(dbQry, "COMMENT ON DATABASE %s IS ", qdatname);
- appendStringLiteralAH(dbQry, comment, fout);
+ appendStringLiteralArchive(dbQry, comment, fout);
appendPQExpBufferStr(dbQry, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -3100,7 +3100,7 @@ dumpDatabase(Archive *fout)
*/
appendPQExpBufferStr(delQry, "UPDATE pg_catalog.pg_database "
"SET datistemplate = false WHERE datname = ");
- appendStringLiteralAH(delQry, datname, fout);
+ appendStringLiteralArchive(delQry, datname, fout);
appendPQExpBufferStr(delQry, ";\n");
}
@@ -3118,7 +3118,7 @@ dumpDatabase(Archive *fout)
"SET datfrozenxid = '%u', datminmxid = '%u'\n"
"WHERE datname = ",
frozenxid, minmxid);
- appendStringLiteralAH(creaQry, datname, fout);
+ appendStringLiteralArchive(creaQry, datname, fout);
appendPQExpBufferStr(creaQry, ";\n");
}
@@ -3270,18 +3270,18 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
* dumpEncoding: put the correct encoding into the archive
*/
static void
-dumpEncoding(Archive *AH)
+dumpEncoding(Archive *A)
{
- const char *encname = pg_encoding_to_char(AH->encoding);
+ const char *encname = pg_encoding_to_char(A->encoding);
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving encoding = %s", encname);
appendPQExpBufferStr(qry, "SET client_encoding = ");
- appendStringLiteralAH(qry, encname, AH);
+ appendStringLiteralArchive(qry, encname, A);
appendPQExpBufferStr(qry, ";\n");
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "ENCODING",
.description = "ENCODING",
.section = SECTION_PRE_DATA,
@@ -3295,9 +3295,9 @@ dumpEncoding(Archive *AH)
* dumpStdStrings: put the correct escape string behavior into the archive
*/
static void
-dumpStdStrings(Archive *AH)
+dumpStdStrings(Archive *A)
{
- const char *stdstrings = AH->std_strings ? "on" : "off";
+ const char *stdstrings = A->std_strings ? "on" : "off";
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving standard_conforming_strings = %s",
@@ -3306,7 +3306,7 @@ dumpStdStrings(Archive *AH)
appendPQExpBuffer(qry, "SET standard_conforming_strings = '%s';\n",
stdstrings);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "STDSTRINGS",
.description = "STDSTRINGS",
.section = SECTION_PRE_DATA,
@@ -3319,7 +3319,7 @@ dumpStdStrings(Archive *AH)
* dumpSearchPath: record the active search_path in the archive
*/
static void
-dumpSearchPath(Archive *AH)
+dumpSearchPath(Archive *A)
{
PQExpBuffer qry = createPQExpBuffer();
PQExpBuffer path = createPQExpBuffer();
@@ -3335,7 +3335,7 @@ dumpSearchPath(Archive *AH)
* listing schemas that may appear in search_path but not actually exist,
* which seems like a prudent exclusion.
*/
- res = ExecuteSqlQueryForSingleRow(AH,
+ res = ExecuteSqlQueryForSingleRow(A,
"SELECT pg_catalog.current_schemas(false)");
if (!parsePGArray(PQgetvalue(res, 0, 0), &schemanames, &nschemanames))
@@ -3355,19 +3355,19 @@ dumpSearchPath(Archive *AH)
}
appendPQExpBufferStr(qry, "SELECT pg_catalog.set_config('search_path', ");
- appendStringLiteralAH(qry, path->data, AH);
+ appendStringLiteralArchive(qry, path->data, A);
appendPQExpBufferStr(qry, ", false);\n");
pg_log_info("saving search_path = %s", path->data);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "SEARCHPATH",
.description = "SEARCHPATH",
.section = SECTION_PRE_DATA,
.createStmt = qry->data));
- /* Also save it in AH->searchpath, in case we're doing plain text dump */
- AH->searchpath = pg_strdup(qry->data);
+ /* Also save it in A->searchpath, in case we're doing plain text dump */
+ A->searchpath = pg_strdup(qry->data);
free(schemanames);
PQclear(res);
@@ -4593,7 +4593,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, "CREATE SUBSCRIPTION %s CONNECTION ",
qsubname);
- appendStringLiteralAH(query, subinfo->subconninfo, fout);
+ appendStringLiteralArchive(query, subinfo->subconninfo, fout);
/* Build list of quoted publications and append them to query. */
if (!parsePGArray(subinfo->subpublications, &pubnames, &npubnames))
@@ -4610,7 +4610,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, " PUBLICATION %s WITH (connect = false, slot_name = ", publications->data);
if (subinfo->subslotname)
- appendStringLiteralAH(query, subinfo->subslotname, fout);
+ appendStringLiteralArchive(query, subinfo->subslotname, fout);
else
appendPQExpBufferStr(query, "NONE");
@@ -9506,7 +9506,7 @@ dumpCommentExtended(Archive *fout, const char *type,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, comments->descr, fout);
+ appendStringLiteralArchive(query, comments->descr, fout);
appendPQExpBufferStr(query, ";\n");
appendPQExpBuffer(tag, "%s %s", type, name);
@@ -9596,7 +9596,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
resetPQExpBuffer(query);
appendPQExpBuffer(query, "COMMENT ON %s %s IS ", reltypename,
fmtQualifiedDumpable(tbinfo));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -9621,7 +9621,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
fmtQualifiedDumpable(tbinfo));
appendPQExpBuffer(query, "%s IS ",
fmtId(tbinfo->attnames[objsubid - 1]));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -10131,12 +10131,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_create_empty_extension(");
- appendStringLiteralAH(q, extinfo->dobj.name, fout);
+ appendStringLiteralArchive(q, extinfo->dobj.name, fout);
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, extinfo->namespace, fout);
+ appendStringLiteralArchive(q, extinfo->namespace, fout);
appendPQExpBufferStr(q, ", ");
appendPQExpBuffer(q, "%s, ", extinfo->relocatable ? "true" : "false");
- appendStringLiteralAH(q, extinfo->extversion, fout);
+ appendStringLiteralArchive(q, extinfo->extversion, fout);
appendPQExpBufferStr(q, ", ");
/*
@@ -10145,12 +10145,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
* preserved in binary upgrade.
*/
if (strlen(extinfo->extconfig) > 2)
- appendStringLiteralAH(q, extinfo->extconfig, fout);
+ appendStringLiteralArchive(q, extinfo->extconfig, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
if (strlen(extinfo->extcondition) > 2)
- appendStringLiteralAH(q, extinfo->extcondition, fout);
+ appendStringLiteralArchive(q, extinfo->extcondition, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
@@ -10165,7 +10165,7 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
{
if (n++ > 0)
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, extobj->name, fout);
+ appendStringLiteralArchive(q, extobj->name, fout);
}
}
appendPQExpBufferStr(q, "]::pg_catalog.text[]");
@@ -10300,7 +10300,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
if (i > 0)
appendPQExpBufferChar(q, ',');
appendPQExpBufferStr(q, "\n ");
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
}
}
@@ -10323,7 +10323,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
"SELECT pg_catalog.binary_upgrade_set_next_pg_enum_oid('%u'::pg_catalog.oid);\n",
enum_oid);
appendPQExpBuffer(q, "ALTER TYPE %s ADD VALUE ", qualtypname);
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
appendPQExpBufferStr(q, ";\n\n");
}
}
@@ -10748,7 +10748,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, ",\n DEFAULT = ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -10764,7 +10764,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (strcmp(typcategory, "U") != 0)
{
appendPQExpBufferStr(q, ",\n CATEGORY = ");
- appendStringLiteralAH(q, typcategory, fout);
+ appendStringLiteralArchive(q, typcategory, fout);
}
if (strcmp(typispreferred, "t") == 0)
@@ -10773,7 +10773,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (typdelim && strcmp(typdelim, ",") != 0)
{
appendPQExpBufferStr(q, ",\n DELIMITER = ");
- appendStringLiteralAH(q, typdelim, fout);
+ appendStringLiteralArchive(q, typdelim, fout);
}
if (*typalign == TYPALIGN_CHAR)
@@ -10931,7 +10931,7 @@ dumpDomain(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, " DEFAULT ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -11151,9 +11151,9 @@ dumpCompositeType(Archive *fout, const TypeInfo *tyinfo)
"SET attlen = %s, "
"attalign = '%s', attbyval = false\n"
"WHERE attname = ", attlen, attalign);
- appendStringLiteralAH(dropped, attname, fout);
+ appendStringLiteralArchive(dropped, attname, fout);
appendPQExpBufferStr(dropped, "\n AND attrelid = ");
- appendStringLiteralAH(dropped, qualtypname, fout);
+ appendStringLiteralArchive(dropped, qualtypname, fout);
appendPQExpBufferStr(dropped, "::pg_catalog.regclass;\n");
appendPQExpBuffer(dropped, "ALTER TYPE %s ",
@@ -11283,7 +11283,7 @@ dumpCompositeTypeColComments(Archive *fout, const TypeInfo *tyinfo,
appendPQExpBuffer(query, "COMMENT ON COLUMN %s.",
fmtQualifiedDumpable(tyinfo));
appendPQExpBuffer(query, "%s IS ", fmtId(attname));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -11700,7 +11700,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
else if (probin[0] != '\0')
{
appendPQExpBufferStr(asPart, "AS ");
- appendStringLiteralAH(asPart, probin, fout);
+ appendStringLiteralArchive(asPart, probin, fout);
if (prosrc[0] != '\0')
{
appendPQExpBufferStr(asPart, ", ");
@@ -11711,7 +11711,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
*/
if (dopt->disable_dollar_quoting ||
(strchr(prosrc, '\'') == NULL && strchr(prosrc, '\\') == NULL))
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11721,7 +11721,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
appendPQExpBufferStr(asPart, "AS ");
/* with no bin, dollar quote src unconditionally if allowed */
if (dopt->disable_dollar_quoting)
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11892,13 +11892,13 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
{
if (nameptr != namelist)
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, *nameptr, fout);
+ appendStringLiteralArchive(q, *nameptr, fout);
}
}
pg_free(namelist);
}
else
- appendStringLiteralAH(q, pos, fout);
+ appendStringLiteralArchive(q, pos, fout);
}
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
@@ -13181,7 +13181,7 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (colliculocale != NULL)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, colliculocale, fout);
+ appendStringLiteralArchive(q, colliculocale, fout);
}
else
{
@@ -13191,14 +13191,14 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (strcmp(collcollate, collctype) == 0)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
}
else
{
appendPQExpBufferStr(q, ", lc_collate = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
appendPQExpBufferStr(q, ", lc_ctype = ");
- appendStringLiteralAH(q, collctype, fout);
+ appendStringLiteralArchive(q, collctype, fout);
}
}
@@ -13214,9 +13214,9 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (!PQgetisnull(res, 0, i_collversion))
{
appendPQExpBufferStr(q, ", version = ");
- appendStringLiteralAH(q,
- PQgetvalue(res, 0, i_collversion),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, 0, i_collversion),
+ fout);
}
}
@@ -13310,9 +13310,9 @@ dumpConversion(Archive *fout, const ConvInfo *convinfo)
appendPQExpBuffer(q, "CREATE %sCONVERSION %s FOR ",
(condefault) ? "DEFAULT " : "",
fmtQualifiedDumpable(convinfo));
- appendStringLiteralAH(q, conforencoding, fout);
+ appendStringLiteralArchive(q, conforencoding, fout);
appendPQExpBufferStr(q, " TO ");
- appendStringLiteralAH(q, contoencoding, fout);
+ appendStringLiteralArchive(q, contoencoding, fout);
/* regproc output is already sufficiently quoted */
appendPQExpBuffer(q, " FROM %s;\n", conproc);
@@ -13567,7 +13567,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_agginitval))
{
appendPQExpBufferStr(details, ",\n INITCOND = ");
- appendStringLiteralAH(details, agginitval, fout);
+ appendStringLiteralArchive(details, agginitval, fout);
}
if (strcmp(aggfinalfn, "-") != 0)
@@ -13623,7 +13623,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_aggminitval))
{
appendPQExpBufferStr(details, ",\n MINITCOND = ");
- appendStringLiteralAH(details, aggminitval, fout);
+ appendStringLiteralArchive(details, aggminitval, fout);
}
if (strcmp(aggmfinalfn, "-") != 0)
@@ -14168,12 +14168,12 @@ dumpForeignServer(Archive *fout, const ForeignServerInfo *srvinfo)
if (srvinfo->srvtype && strlen(srvinfo->srvtype) > 0)
{
appendPQExpBufferStr(q, " TYPE ");
- appendStringLiteralAH(q, srvinfo->srvtype, fout);
+ appendStringLiteralArchive(q, srvinfo->srvtype, fout);
}
if (srvinfo->srvversion && strlen(srvinfo->srvversion) > 0)
{
appendPQExpBufferStr(q, " VERSION ");
- appendStringLiteralAH(q, srvinfo->srvversion, fout);
+ appendStringLiteralArchive(q, srvinfo->srvversion, fout);
}
appendPQExpBufferStr(q, " FOREIGN DATA WRAPPER ");
@@ -14589,7 +14589,7 @@ dumpSecLabel(Archive *fout, const char *type, const char *name,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, labels[i].label, fout);
+ appendStringLiteralArchive(query, labels[i].label, fout);
appendPQExpBufferStr(query, ";\n");
}
@@ -14672,7 +14672,7 @@ dumpTableSecLabel(Archive *fout, const TableInfo *tbinfo, const char *reltypenam
}
appendPQExpBuffer(query, "SECURITY LABEL FOR %s ON %s IS ",
fmtId(provider), target->data);
- appendStringLiteralAH(query, label, fout);
+ appendStringLiteralArchive(query, label, fout);
appendPQExpBufferStr(query, ";\n");
}
if (query->len > 0)
@@ -15488,11 +15488,11 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "\n-- set missing value.\n");
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_set_missing_value(");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass,");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attmissingval[j], fout);
appendPQExpBufferStr(q, ");\n\n");
}
}
@@ -15535,9 +15535,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"WHERE attname = ",
tbinfo->attlen[j],
tbinfo->attalign[j]);
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->relkind == RELKIND_RELATION ||
@@ -15556,9 +15556,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_attribute\n"
"SET attislocal = false\n"
"WHERE attname = ");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
}
@@ -15584,9 +15584,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_constraint\n"
"SET conislocal = false\n"
"WHERE contype = 'c' AND conname = ");
- appendStringLiteralAH(q, constr->dobj.name, fout);
+ appendStringLiteralArchive(q, constr->dobj.name, fout);
appendPQExpBufferStr(q, "\n AND conrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -15629,7 +15629,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"SET relfrozenxid = '%u', relminmxid = '%u'\n"
"WHERE oid = ",
tbinfo->frozenxid, tbinfo->minmxid);
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->toast_oid)
@@ -15661,7 +15661,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_class\n"
"SET relispopulated = 't'\n"
"WHERE oid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -16910,7 +16910,7 @@ dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo)
resetPQExpBuffer(query);
appendPQExpBufferStr(query, "SELECT pg_catalog.setval(");
- appendStringLiteralAH(query, fmtQualifiedDumpable(tbinfo), fout);
+ appendStringLiteralArchive(query, fmtQualifiedDumpable(tbinfo), fout);
appendPQExpBuffer(query, ", %s, %s);\n",
last, (called ? "true" : "false"));
@@ -17072,7 +17072,7 @@ dumpTrigger(Archive *fout, const TriggerInfo *tginfo)
if (findx > 0)
appendPQExpBufferStr(query, ", ");
- appendStringLiteralAH(query, p, fout);
+ appendStringLiteralArchive(query, p, fout);
p += tlen + 1;
}
free(tgargs);
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 69ee939d4..427f5d45f 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -705,8 +705,8 @@ extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
extern TypeInfo *getTypes(Archive *fout, int *numTypes);
extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
-extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
-extern OprInfo *getOperators(Archive *fout, int *numOperators);
+extern AggInfo *getAggregates(Archive *fout, int *numAggs);
+extern OprInfo *getOperators(Archive *fout, int *numOprs);
extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
@@ -723,7 +723,7 @@ extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
-extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
+extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 69ae027bd..083012ca3 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -72,8 +72,10 @@ static void buildShSecLabels(PGconn *conn,
const char *catalog_name, Oid objectId,
const char *objtype, const char *objname,
PQExpBuffer buffer);
-static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
- const char *pguser, trivalue prompt_password, bool fail_on_error);
+static PGconn *connectDatabase(const char *dbname,
+ const char *connection_string, const char *pghost,
+ const char *pgport, const char *pguser,
+ trivalue prompt_password, bool fail_on_error);
static char *constructConnStr(const char **keywords, const char **values);
static PGresult *executeQuery(PGconn *conn, const char *query);
static void executeCommand(PGconn *conn, const char *query);
--
2.34.1
v5-0003-Harmonize-more-lexer-function-parameter-names.patchapplication/octet-stream; name=v5-0003-Harmonize-more-lexer-function-parameter-names.patchDownload
From e95c284e257c33e5b5fee2220595b8f6883f93d0 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Wed, 21 Sep 2022 18:47:52 -0700
Subject: [PATCH v5 3/4] Harmonize more lexer function parameter names.
Make sure that function declarations use names that exactly match the
corresponding names from function definitions for several "lexer
adjacent" backend functions.
These functions were missed by recent commits because they were obscured
by clang-tidy warnings about functions whose signature is directly under
the control of the lexer (flex seems to always generate function
declarations with unnamed parameters).
Oversight in commit aab06442.
Author: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
---
src/include/bootstrap/bootstrap.h | 2 +-
src/include/parser/scanner.h | 2 +-
src/include/replication/walsender_private.h | 2 +-
src/backend/utils/adt/jsonpath_scan.l | 2 +-
src/bin/pgbench/pgbench.h | 6 +++---
src/test/isolation/isolationtester.h | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h
index 89f5b01b3..c825adc40 100644
--- a/src/include/bootstrap/bootstrap.h
+++ b/src/include/bootstrap/bootstrap.h
@@ -57,6 +57,6 @@ extern void boot_get_type_io_data(Oid typid,
extern int boot_yyparse(void);
extern int boot_yylex(void);
-extern void boot_yyerror(const char *str) pg_attribute_noreturn();
+extern void boot_yyerror(const char *message) pg_attribute_noreturn();
#endif /* BOOTSTRAP_H */
diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h
index 084348151..e775d96c7 100644
--- a/src/include/parser/scanner.h
+++ b/src/include/parser/scanner.h
@@ -138,7 +138,7 @@ extern core_yyscan_t scanner_init(const char *str,
const ScanKeywordList *keywordlist,
const uint16 *keyword_tokens);
extern void scanner_finish(core_yyscan_t yyscanner);
-extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp,
+extern int core_yylex(core_YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
core_yyscan_t yyscanner);
extern int scanner_errposition(int location, core_yyscan_t yyscanner);
extern void setup_scanner_errposition_callback(ScannerCallbackState *scbstate,
diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h
index cb4da76a8..7897c7458 100644
--- a/src/include/replication/walsender_private.h
+++ b/src/include/replication/walsender_private.h
@@ -118,7 +118,7 @@ extern void WalSndSetState(WalSndState state);
*/
extern int replication_yyparse(void);
extern int replication_yylex(void);
-extern void replication_yyerror(const char *str) pg_attribute_noreturn();
+extern void replication_yyerror(const char *message) pg_attribute_noreturn();
extern void replication_scanner_init(const char *str);
extern void replication_scanner_finish(void);
extern bool replication_scanner_is_replication_command(void);
diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l
index ea824bae7..948f379e7 100644
--- a/src/backend/utils/adt/jsonpath_scan.l
+++ b/src/backend/utils/adt/jsonpath_scan.l
@@ -37,7 +37,7 @@ static char *scanbuf;
static int scanbuflen;
static void addstring(bool init, char *s, int l);
-static void addchar(bool init, char s);
+static void addchar(bool init, char c);
static enum yytokentype checkKeyword(void);
static void parseUnicode(char *s, int l);
static void parseHexChar(char *s);
diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h
index 40903bc16..a8a0dcaa3 100644
--- a/src/bin/pgbench/pgbench.h
+++ b/src/bin/pgbench/pgbench.h
@@ -141,9 +141,9 @@ struct PgBenchExprList
extern PgBenchExpr *expr_parse_result;
extern int expr_yyparse(yyscan_t yyscanner);
-extern int expr_yylex(union YYSTYPE *lvalp, yyscan_t yyscanner);
-extern void expr_yyerror(yyscan_t yyscanner, const char *str) pg_attribute_noreturn();
-extern void expr_yyerror_more(yyscan_t yyscanner, const char *str,
+extern int expr_yylex(union YYSTYPE *yylval_param, yyscan_t yyscanner);
+extern void expr_yyerror(yyscan_t yyscanner, const char *message) pg_attribute_noreturn();
+extern void expr_yyerror_more(yyscan_t yyscanner, const char *message,
const char *more) pg_attribute_noreturn();
extern bool expr_lex_one_word(PsqlScanState state, PQExpBuffer word_buf,
int *offset);
diff --git a/src/test/isolation/isolationtester.h b/src/test/isolation/isolationtester.h
index e00bc6b81..77134b03b 100644
--- a/src/test/isolation/isolationtester.h
+++ b/src/test/isolation/isolationtester.h
@@ -88,6 +88,6 @@ extern TestSpec parseresult;
extern int spec_yyparse(void);
extern int spec_yylex(void);
-extern void spec_yyerror(const char *str);
+extern void spec_yyerror(const char *message);
#endif /* ISOLATIONTESTER_H */
--
2.34.1
v5-0002-Harmonize-parameter-names-in-ecpg-code.patchapplication/octet-stream; name=v5-0002-Harmonize-parameter-names-in-ecpg-code.patchDownload
From 23896ca55c6ef1e0f4026ca57cb6872b9890ec85 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Wed, 21 Sep 2022 14:51:29 -0700
Subject: [PATCH v5 2/4] Harmonize parameter names in ecpg code.
---
src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 78 +++++++++++-------
src/interfaces/ecpg/include/ecpg_informix.h | 82 +++++++++----------
src/interfaces/ecpg/include/ecpglib.h | 50 +++++------
src/interfaces/ecpg/include/pgtypes_date.h | 20 ++---
.../ecpg/include/pgtypes_interval.h | 8 +-
src/interfaces/ecpg/include/pgtypes_numeric.h | 36 ++++----
.../ecpg/include/pgtypes_timestamp.h | 12 +--
src/interfaces/ecpg/pgtypeslib/dt.h | 22 ++---
.../ecpg/pgtypeslib/pgtypeslib_extern.h | 8 +-
src/interfaces/ecpg/preproc/c_keywords.c | 8 +-
src/interfaces/ecpg/preproc/ecpg.header | 2 +-
src/interfaces/ecpg/preproc/output.c | 2 +-
src/interfaces/ecpg/preproc/pgc.l | 2 +-
src/interfaces/ecpg/preproc/preproc_extern.h | 63 ++++++++------
src/interfaces/ecpg/preproc/type.c | 2 +-
src/interfaces/ecpg/preproc/type.h | 24 +++---
.../ecpg/test/expected/preproc-outofscope.c | 36 ++++----
src/interfaces/ecpg/test/expected/sql-sqlda.c | 36 ++++----
18 files changed, 261 insertions(+), 230 deletions(-)
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
index c438cfb82..298386cb7 100644
--- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
+++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
@@ -172,52 +172,70 @@ bool ecpg_get_data(const PGresult *, int, int, int, enum ECPGttype type,
#ifdef ENABLE_THREAD_SAFETY
void ecpg_pthreads_init(void);
#endif
-struct connection *ecpg_get_connection(const char *);
-char *ecpg_alloc(long, int);
-char *ecpg_auto_alloc(long, int);
-char *ecpg_realloc(void *, long, int);
-void ecpg_free(void *);
-bool ecpg_init(const struct connection *, const char *, const int);
-char *ecpg_strdup(const char *, int);
-const char *ecpg_type_name(enum ECPGttype);
-int ecpg_dynamic_type(Oid);
-int sqlda_dynamic_type(Oid, enum COMPAT_MODE);
+struct connection *ecpg_get_connection(const char *connection_name);
+char *ecpg_alloc(long size, int lineno);
+char *ecpg_auto_alloc(long size, int lineno);
+char *ecpg_realloc(void *ptr, long size, int lineno);
+void ecpg_free(void *ptr);
+bool ecpg_init(const struct connection *con,
+ const char *connection_name,
+ const int lineno);
+char *ecpg_strdup(const char *string, int lineno);
+const char *ecpg_type_name(enum ECPGttype typ);
+int ecpg_dynamic_type(Oid type);
+int sqlda_dynamic_type(Oid type, enum COMPAT_MODE compat);
void ecpg_clear_auto_mem(void);
struct descriptor *ecpg_find_desc(int line, const char *name);
-struct prepared_statement *ecpg_find_prepared_statement(const char *,
- struct connection *, struct prepared_statement **);
+struct prepared_statement *ecpg_find_prepared_statement(const char *name,
+ struct connection *con,
+ struct prepared_statement **prev_);
bool ecpg_store_result(const PGresult *results, int act_field,
const struct statement *stmt, struct variable *var);
-bool ecpg_store_input(const int, const bool, const struct variable *, char **, bool);
+bool ecpg_store_input(const int lineno, const bool force_indicator,
+ const struct variable *var,
+ char **tobeinserted_p, bool quote);
void ecpg_free_params(struct statement *stmt, bool print);
-bool ecpg_do_prologue(int, const int, const int, const char *, const bool,
- enum ECPG_statement_type, const char *, va_list,
- struct statement **);
-bool ecpg_build_params(struct statement *);
+bool ecpg_do_prologue(int lineno, const int compat,
+ const int force_indicator, const char *connection_name,
+ const bool questionmarks, enum ECPG_statement_type statement_type,
+ const char *query, va_list args,
+ struct statement **stmt_out);
+bool ecpg_build_params(struct statement *stmt);
bool ecpg_autostart_transaction(struct statement *stmt);
bool ecpg_execute(struct statement *stmt);
-bool ecpg_process_output(struct statement *, bool);
-void ecpg_do_epilogue(struct statement *);
-bool ecpg_do(const int, const int, const int, const char *, const bool,
- const int, const char *, va_list);
+bool ecpg_process_output(struct statement *stmt, bool clear_result);
+void ecpg_do_epilogue(struct statement *stmt);
+bool ecpg_do(const int lineno, const int compat,
+ const int force_indicator, const char *connection_name,
+ const bool questionmarks, const int st, const char *query,
+ va_list args);
-bool ecpg_check_PQresult(PGresult *, int, PGconn *, enum COMPAT_MODE);
+bool ecpg_check_PQresult(PGresult *results, int lineno,
+ PGconn *connection, enum COMPAT_MODE compat);
void ecpg_raise(int line, int code, const char *sqlstate, const char *str);
void ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat);
-char *ecpg_prepared(const char *, struct connection *);
-bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *conn);
+char *ecpg_prepared(const char *name, struct connection *con);
+bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *con);
void ecpg_log(const char *format,...) pg_attribute_printf(1, 2);
-bool ecpg_auto_prepare(int, const char *, const int, char **, const char *);
-bool ecpg_register_prepared_stmt(struct statement *);
+bool ecpg_auto_prepare(int lineno, const char *connection_name,
+ const int compat, char **name,
+ const char *query);
+bool ecpg_register_prepared_stmt(struct statement *stmt);
void ecpg_init_sqlca(struct sqlca_t *sqlca);
-struct sqlda_compat *ecpg_build_compat_sqlda(int, PGresult *, int, enum COMPAT_MODE);
-void ecpg_set_compat_sqlda(int, struct sqlda_compat **, const PGresult *, int, enum COMPAT_MODE);
-struct sqlda_struct *ecpg_build_native_sqlda(int, PGresult *, int, enum COMPAT_MODE);
-void ecpg_set_native_sqlda(int, struct sqlda_struct **, const PGresult *, int, enum COMPAT_MODE);
+struct sqlda_compat *ecpg_build_compat_sqlda(int line, PGresult *res, int row,
+ enum COMPAT_MODE compat);
+void ecpg_set_compat_sqlda(int lineno, struct sqlda_compat **_sqlda,
+ const PGresult *res, int row,
+ enum COMPAT_MODE compat);
+struct sqlda_struct *ecpg_build_native_sqlda(int line, PGresult *res, int row,
+ enum COMPAT_MODE compat);
+void ecpg_set_native_sqlda(int lineno, struct sqlda_struct **_sqlda,
+ const PGresult *res, int row,
+ enum COMPAT_MODE compat);
unsigned ecpg_hex_dec_len(unsigned srclen);
unsigned ecpg_hex_enc_len(unsigned srclen);
unsigned ecpg_hex_encode(const char *src, unsigned len, char *dst);
diff --git a/src/interfaces/ecpg/include/ecpg_informix.h b/src/interfaces/ecpg/include/ecpg_informix.h
index a5260a554..5d918c379 100644
--- a/src/interfaces/ecpg/include/ecpg_informix.h
+++ b/src/interfaces/ecpg/include/ecpg_informix.h
@@ -33,55 +33,55 @@ extern "C"
{
#endif
-extern int rdatestr(date, char *);
-extern void rtoday(date *);
-extern int rjulmdy(date, short *);
-extern int rdefmtdate(date *, const char *, const char *);
-extern int rfmtdate(date, const char *, char *);
-extern int rmdyjul(short *, date *);
-extern int rstrdate(const char *, date *);
-extern int rdayofweek(date);
+extern int rdatestr(date d, char *str);
+extern void rtoday(date * d);
+extern int rjulmdy(date d, short *mdy);
+extern int rdefmtdate(date * d, const char *fmt, const char *str);
+extern int rfmtdate(date d, const char *fmt, char *str);
+extern int rmdyjul(short *mdy, date * d);
+extern int rstrdate(const char *str, date * d);
+extern int rdayofweek(date d);
-extern int rfmtlong(long, const char *, char *);
-extern int rgetmsg(int, char *, int);
-extern int risnull(int, const char *);
-extern int rsetnull(int, char *);
-extern int rtypalign(int, int);
-extern int rtypmsize(int, int);
-extern int rtypwidth(int, int);
-extern void rupshift(char *);
+extern int rfmtlong(long lng_val, const char *fmt, char *outbuf);
+extern int rgetmsg(int msgnum, char *s, int maxsize);
+extern int risnull(int t, const char *ptr);
+extern int rsetnull(int t, char *ptr);
+extern int rtypalign(int offset, int type);
+extern int rtypmsize(int type, int len);
+extern int rtypwidth(int sqltype, int sqllen);
+extern void rupshift(char *str);
-extern int byleng(char *, int);
-extern void ldchar(char *, int, char *);
+extern int byleng(char *str, int len);
+extern void ldchar(char *src, int len, char *dest);
-extern void ECPG_informix_set_var(int, void *, int);
-extern void *ECPG_informix_get_var(int);
+extern void ECPG_informix_set_var(int number, void *pointer, int lineno);
+extern void *ECPG_informix_get_var(int number);
extern void ECPG_informix_reset_sqlca(void);
/* Informix defines these in decimal.h */
-int decadd(decimal *, decimal *, decimal *);
-int deccmp(decimal *, decimal *);
-void deccopy(decimal *, decimal *);
-int deccvasc(const char *, int, decimal *);
-int deccvdbl(double, decimal *);
-int deccvint(int, decimal *);
-int deccvlong(long, decimal *);
-int decdiv(decimal *, decimal *, decimal *);
-int decmul(decimal *, decimal *, decimal *);
-int decsub(decimal *, decimal *, decimal *);
-int dectoasc(decimal *, char *, int, int);
-int dectodbl(decimal *, double *);
-int dectoint(decimal *, int *);
-int dectolong(decimal *, long *);
+int decadd(decimal *arg1, decimal *arg2, decimal *sum);
+int deccmp(decimal *arg1, decimal *arg2);
+void deccopy(decimal *src, decimal *target);
+int deccvasc(const char *cp, int len, decimal *np);
+int deccvdbl(double dbl, decimal *np);
+int deccvint(int in, decimal *np);
+int deccvlong(long lng, decimal *np);
+int decdiv(decimal *n1, decimal *n2, decimal *result);
+int decmul(decimal *n1, decimal *n2, decimal *result);
+int decsub(decimal *n1, decimal *n2, decimal *result);
+int dectoasc(decimal *np, char *cp, int len, int right);
+int dectodbl(decimal *np, double *dblp);
+int dectoint(decimal *np, int *ip);
+int dectolong(decimal *np, long *lngp);
/* Informix defines these in datetime.h */
-extern void dtcurrent(timestamp *);
-extern int dtcvasc(char *, timestamp *);
-extern int dtsub(timestamp *, timestamp *, interval *);
-extern int dttoasc(timestamp *, char *);
-extern int dttofmtasc(timestamp *, char *, int, char *);
-extern int intoasc(interval *, char *);
-extern int dtcvfmtasc(char *, char *, timestamp *);
+extern void dtcurrent(timestamp * ts);
+extern int dtcvasc(char *str, timestamp * ts);
+extern int dtsub(timestamp * ts1, timestamp * ts2, interval * iv);
+extern int dttoasc(timestamp * ts, char *output);
+extern int dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr);
+extern int intoasc(interval * i, char *str);
+extern int dtcvfmtasc(char *inbuf, char *fmtstr, timestamp * dtvalue);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index 00240109a..f983a27f9 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -49,20 +49,20 @@ extern "C"
{
#endif
-void ECPGdebug(int, FILE *);
-bool ECPGstatus(int, const char *);
-bool ECPGsetcommit(int, const char *, const char *);
-bool ECPGsetconn(int, const char *);
-bool ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
-bool ECPGdo(const int, const int, const int, const char *, const bool, const int, const char *,...);
-bool ECPGtrans(int, const char *, const char *);
-bool ECPGdisconnect(int, const char *);
-bool ECPGprepare(int, const char *, const bool, const char *, const char *);
-bool ECPGdeallocate(int, int, const char *, const char *);
-bool ECPGdeallocate_all(int, int, const char *);
-char *ECPGprepared_statement(const char *, const char *, int);
-PGconn *ECPGget_PGconn(const char *);
-PGTransactionStatusType ECPGtransactionStatus(const char *);
+void ECPGdebug(int n, FILE *dbgs);
+bool ECPGstatus(int lineno, const char *connection_name);
+bool ECPGsetcommit(int lineno, const char *mode, const char *connection_name);
+bool ECPGsetconn(int lineno, const char *connection_name);
+bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit);
+bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...);
+bool ECPGtrans(int lineno, const char *connection_name, const char *transaction);
+bool ECPGdisconnect(int lineno, const char *connection_name);
+bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable);
+bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name);
+bool ECPGdeallocate_all(int lineno, int compat, const char *connection_name);
+char *ECPGprepared_statement(const char *connection_name, const char *name, int lineno);
+PGconn *ECPGget_PGconn(const char *connection_name);
+PGTransactionStatusType ECPGtransactionStatus(const char *connection_name);
/* print an error message */
void sqlprint(void);
@@ -74,19 +74,19 @@ void sqlprint(void);
/* dynamic SQL */
-bool ECPGdo_descriptor(int, const char *, const char *, const char *);
-bool ECPGdeallocate_desc(int, const char *);
-bool ECPGallocate_desc(int, const char *);
-bool ECPGget_desc_header(int, const char *, int *);
-bool ECPGget_desc(int, const char *, int,...);
-bool ECPGset_desc_header(int, const char *, int);
-bool ECPGset_desc(int, const char *, int,...);
+bool ECPGdo_descriptor(int line, const char *connection, const char *descriptor, const char *query);
+bool ECPGdeallocate_desc(int line, const char *name);
+bool ECPGallocate_desc(int line, const char *name);
+bool ECPGget_desc_header(int lineno, const char *desc_name, int *count);
+bool ECPGget_desc(int lineno, const char *desc_name, int index,...);
+bool ECPGset_desc_header(int lineno, const char *desc_name, int count);
+bool ECPGset_desc(int lineno, const char *desc_name, int index,...);
-void ECPGset_noind_null(enum ECPGttype, void *);
-bool ECPGis_noind_null(enum ECPGttype, const void *);
-bool ECPGdescribe(int, int, bool, const char *, const char *,...);
+void ECPGset_noind_null(enum ECPGttype type, void *ptr);
+bool ECPGis_noind_null(enum ECPGttype type, const void *ptr);
+bool ECPGdescribe(int line, int compat, bool input, const char *connection_name, const char *stmt_name,...);
-void ECPGset_var(int, void *, int);
+void ECPGset_var(int number, void *pointer, int lineno);
void *ECPGget_var(int number);
/* dynamic result allocation */
diff --git a/src/interfaces/ecpg/include/pgtypes_date.h b/src/interfaces/ecpg/include/pgtypes_date.h
index c66809746..5490cf821 100644
--- a/src/interfaces/ecpg/include/pgtypes_date.h
+++ b/src/interfaces/ecpg/include/pgtypes_date.h
@@ -14,16 +14,16 @@ extern "C"
#endif
extern date * PGTYPESdate_new(void);
-extern void PGTYPESdate_free(date *);
-extern date PGTYPESdate_from_asc(char *, char **);
-extern char *PGTYPESdate_to_asc(date);
-extern date PGTYPESdate_from_timestamp(timestamp);
-extern void PGTYPESdate_julmdy(date, int *);
-extern void PGTYPESdate_mdyjul(int *, date *);
-extern int PGTYPESdate_dayofweek(date);
-extern void PGTYPESdate_today(date *);
-extern int PGTYPESdate_defmt_asc(date *, const char *, const char *);
-extern int PGTYPESdate_fmt_asc(date, const char *, char *);
+extern void PGTYPESdate_free(date * d);
+extern date PGTYPESdate_from_asc(char *str, char **endptr);
+extern char *PGTYPESdate_to_asc(date dDate);
+extern date PGTYPESdate_from_timestamp(timestamp dt);
+extern void PGTYPESdate_julmdy(date jd, int *mdy);
+extern void PGTYPESdate_mdyjul(int *mdy, date * jdate);
+extern int PGTYPESdate_dayofweek(date dDate);
+extern void PGTYPESdate_today(date * d);
+extern int PGTYPESdate_defmt_asc(date * d, const char *fmt, const char *str);
+extern int PGTYPESdate_fmt_asc(date dDate, const char *fmtstring, char *outbuf);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_interval.h b/src/interfaces/ecpg/include/pgtypes_interval.h
index 3b17cd1d1..8471b609d 100644
--- a/src/interfaces/ecpg/include/pgtypes_interval.h
+++ b/src/interfaces/ecpg/include/pgtypes_interval.h
@@ -36,10 +36,10 @@ extern "C"
#endif
extern interval * PGTYPESinterval_new(void);
-extern void PGTYPESinterval_free(interval *);
-extern interval * PGTYPESinterval_from_asc(char *, char **);
-extern char *PGTYPESinterval_to_asc(interval *);
-extern int PGTYPESinterval_copy(interval *, interval *);
+extern void PGTYPESinterval_free(interval *intvl);
+extern interval * PGTYPESinterval_from_asc(char *str, char **endptr);
+extern char *PGTYPESinterval_to_asc(interval *span);
+extern int PGTYPESinterval_copy(interval *intvlsrc, interval *intvldest);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_numeric.h b/src/interfaces/ecpg/include/pgtypes_numeric.h
index 5c763a9eb..61506f44c 100644
--- a/src/interfaces/ecpg/include/pgtypes_numeric.h
+++ b/src/interfaces/ecpg/include/pgtypes_numeric.h
@@ -43,24 +43,24 @@ extern "C"
numeric *PGTYPESnumeric_new(void);
decimal *PGTYPESdecimal_new(void);
-void PGTYPESnumeric_free(numeric *);
-void PGTYPESdecimal_free(decimal *);
-numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(numeric *, int);
-int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_cmp(numeric *, numeric *);
-int PGTYPESnumeric_from_int(signed int, numeric *);
-int PGTYPESnumeric_from_long(signed long int, numeric *);
-int PGTYPESnumeric_copy(numeric *, numeric *);
-int PGTYPESnumeric_from_double(double, numeric *);
-int PGTYPESnumeric_to_double(numeric *, double *);
-int PGTYPESnumeric_to_int(numeric *, int *);
-int PGTYPESnumeric_to_long(numeric *, long *);
-int PGTYPESnumeric_to_decimal(numeric *, decimal *);
-int PGTYPESnumeric_from_decimal(decimal *, numeric *);
+void PGTYPESnumeric_free(numeric *var);
+void PGTYPESdecimal_free(decimal *var);
+numeric *PGTYPESnumeric_from_asc(char *str, char **endptr);
+char *PGTYPESnumeric_to_asc(numeric *num, int dscale);
+int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_cmp(numeric *var1, numeric *var2);
+int PGTYPESnumeric_from_int(signed int int_val, numeric *var);
+int PGTYPESnumeric_from_long(signed long int long_val, numeric *var);
+int PGTYPESnumeric_copy(numeric *src, numeric *dst);
+int PGTYPESnumeric_from_double(double d, numeric *dst);
+int PGTYPESnumeric_to_double(numeric *nv, double *dp);
+int PGTYPESnumeric_to_int(numeric *nv, int *ip);
+int PGTYPESnumeric_to_long(numeric *nv, long *lp);
+int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst);
+int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_timestamp.h b/src/interfaces/ecpg/include/pgtypes_timestamp.h
index 3e2983789..412ecc2d4 100644
--- a/src/interfaces/ecpg/include/pgtypes_timestamp.h
+++ b/src/interfaces/ecpg/include/pgtypes_timestamp.h
@@ -15,12 +15,12 @@ extern "C"
{
#endif
-extern timestamp PGTYPEStimestamp_from_asc(char *, char **);
-extern char *PGTYPEStimestamp_to_asc(timestamp);
-extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *);
-extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *);
-extern void PGTYPEStimestamp_current(timestamp *);
-extern int PGTYPEStimestamp_defmt_asc(const char *, const char *, timestamp *);
+extern timestamp PGTYPEStimestamp_from_asc(char *str, char **endptr);
+extern char *PGTYPEStimestamp_to_asc(timestamp tstamp);
+extern int PGTYPEStimestamp_sub(timestamp * ts1, timestamp * ts2, interval * iv);
+extern int PGTYPEStimestamp_fmt_asc(timestamp * ts, char *output, int str_len, const char *fmtstr);
+extern void PGTYPEStimestamp_current(timestamp * ts);
+extern int PGTYPEStimestamp_defmt_asc(const char *str, const char *fmt, timestamp * d);
extern int PGTYPEStimestamp_add_interval(timestamp * tin, interval * span, timestamp * tout);
extern int PGTYPEStimestamp_sub_interval(timestamp * tin, interval * span, timestamp * tout);
diff --git a/src/interfaces/ecpg/pgtypeslib/dt.h b/src/interfaces/ecpg/pgtypeslib/dt.h
index 893c9b619..1ec38791f 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt.h
+++ b/src/interfaces/ecpg/pgtypeslib/dt.h
@@ -311,22 +311,22 @@ do { \
#define TIMESTAMP_IS_NOEND(j) ((j) == DT_NOEND)
#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
-int DecodeInterval(char **, int *, int, int *, struct tm *, fsec_t *);
-int DecodeTime(char *, int *, struct tm *, fsec_t *);
+int DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec);
+int DecodeTime(char *str, int *tmask, struct tm *tm, fsec_t *fsec);
void EncodeDateTime(struct tm *tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str, bool EuroDates);
void EncodeInterval(struct tm *tm, fsec_t fsec, int style, char *str);
-int tm2timestamp(struct tm *, fsec_t, int *, timestamp *);
+int tm2timestamp(struct tm *tm, fsec_t fsec, int *tzp, timestamp *result);
int DecodeUnits(int field, char *lowtoken, int *val);
bool CheckDateTokenTables(void);
void EncodeDateOnly(struct tm *tm, int style, char *str, bool EuroDates);
-int GetEpochTime(struct tm *);
-int ParseDateTime(char *, char *, char **, int *, int *, char **);
-int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, bool);
-void j2date(int, int *, int *, int *);
-void GetCurrentDateTime(struct tm *);
-int date2j(int, int, int);
-void TrimTrailingZeros(char *);
-void dt2time(double, int *, int *, int *, fsec_t *);
+int GetEpochTime(struct tm *tm);
+int ParseDateTime(char *timestr, char *lowstr, char **field, int *ftype, int *numfields, char **endstr);
+int DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct tm *tm, fsec_t *fsec, bool EuroDates);
+void j2date(int jd, int *year, int *month, int *day);
+void GetCurrentDateTime(struct tm *tm);
+int date2j(int y, int m, int d);
+void TrimTrailingZeros(char *str);
+void dt2time(double jd, int *hour, int *min, int *sec, fsec_t *fsec);
int PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
int *year, int *month, int *day,
int *hour, int *minute, int *second,
diff --git a/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h b/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h
index 1012088b7..8e980966b 100644
--- a/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h
+++ b/src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h
@@ -33,9 +33,11 @@ union un_fmt_comb
int64 int64_val;
};
-int pgtypes_fmt_replace(union un_fmt_comb, int, char **, int *);
+int pgtypes_fmt_replace(union un_fmt_comb replace_val,
+ int replace_type, char **output,
+ int *pstr_len);
-char *pgtypes_alloc(long);
-char *pgtypes_strdup(const char *);
+char *pgtypes_alloc(long size);
+char *pgtypes_strdup(const char *str);
#endif /* _ECPG_PGTYPESLIB_EXTERN_H */
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c
index e51c03610..14f20e2d2 100644
--- a/src/interfaces/ecpg/preproc/c_keywords.c
+++ b/src/interfaces/ecpg/preproc/c_keywords.c
@@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = {
* ScanKeywordLookup(), except we want case-sensitive matching.
*/
int
-ScanCKeywordLookup(const char *str)
+ScanCKeywordLookup(const char *text)
{
size_t len;
int h;
@@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str)
* Reject immediately if too long to be any keyword. This saves useless
* hashing work on long strings.
*/
- len = strlen(str);
+ len = strlen(text);
if (len > ScanCKeywords.max_kw_len)
return -1;
@@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str)
* Compute the hash function. Since it's a perfect hash, we need only
* match to the specific keyword it identifies.
*/
- h = ScanCKeywords_hash_func(str, len);
+ h = ScanCKeywords_hash_func(text, len);
/* An out-of-range result implies no match */
if (h < 0 || h >= ScanCKeywords.num_keywords)
@@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str)
kw = GetScanKeyword(h, &ScanCKeywords);
- if (strcmp(kw, str) == 0)
+ if (strcmp(kw, text) == 0)
return ScanCKeywordTokens[h];
return -1;
diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header
index b8508a912..595028942 100644
--- a/src/interfaces/ecpg/preproc/ecpg.header
+++ b/src/interfaces/ecpg/preproc/ecpg.header
@@ -64,7 +64,7 @@ static struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, NULL, {NUL
static void vmmerror(int error_code, enum errortype type, const char *error, va_list ap) pg_attribute_printf(3, 0);
-static bool check_declared_list(const char*);
+static bool check_declared_list(const char *name);
/*
* Handle parsing errors and warnings
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index cf8aadd0b..6c0b8a27b 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -4,7 +4,7 @@
#include "preproc_extern.h"
-static void output_escaped_str(char *cmd, bool quoted);
+static void output_escaped_str(char *str, bool quoted);
void
output_line_number(void)
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index c344f8f30..c145c9698 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -56,7 +56,7 @@ static bool include_next;
#define startlit() (literalbuf[0] = '\0', literallen = 0)
static void addlit(char *ytext, int yleng);
-static void addlitchar(unsigned char);
+static void addlitchar(unsigned char ychar);
static int process_integer_literal(const char *token, YYSTYPE *lval);
static void parse_include(void);
static bool ecpg_isspace(char ch);
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 6be59b719..c5fd07fbd 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -65,41 +65,50 @@ extern const uint16 SQLScanKeywordTokens[];
extern const char *get_dtype(enum ECPGdtype);
extern void lex_init(void);
extern void output_line_number(void);
-extern void output_statement(char *, int, enum ECPG_statement_type);
-extern void output_prepare_statement(char *, char *);
-extern void output_deallocate_prepare_statement(char *);
-extern void output_simple_statement(char *, int);
+extern void output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st);
+extern void output_prepare_statement(char *name, char *stmt);
+extern void output_deallocate_prepare_statement(char *name);
+extern void output_simple_statement(char *stmt, int whenever_mode);
extern char *hashline_number(void);
extern int base_yyparse(void);
extern int base_yylex(void);
-extern void base_yyerror(const char *);
-extern void *mm_alloc(size_t);
-extern char *mm_strdup(const char *);
-extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
-extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
-extern void output_get_descr_header(char *);
-extern void output_get_descr(char *, char *);
-extern void output_set_descr_header(char *);
-extern void output_set_descr(char *, char *);
-extern void push_assignment(char *, enum ECPGdtype);
-extern struct variable *find_variable(char *);
-extern void whenever_action(int);
-extern void add_descriptor(char *, char *);
-extern void drop_descriptor(char *, char *);
-extern struct descriptor *lookup_descriptor(char *, char *);
+extern void base_yyerror(const char *error);
+extern void *mm_alloc(size_t size);
+extern char *mm_strdup(const char *string);
+extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
+extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
+extern void output_get_descr_header(char *desc_name);
+extern void output_get_descr(char *desc_name, char *index);
+extern void output_set_descr_header(char *desc_name);
+extern void output_set_descr(char *desc_name, char *index);
+extern void push_assignment(char *var, enum ECPGdtype value);
+extern struct variable *find_variable(char *name);
+extern void whenever_action(int mode);
+extern void add_descriptor(char *name, char *connection);
+extern void drop_descriptor(char *name, char *connection);
+extern struct descriptor *lookup_descriptor(char *name, char *connection);
extern struct variable *descriptor_variable(const char *name, int input);
extern struct variable *sqlda_variable(const char *name);
-extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
-extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
+extern void add_variable_to_head(struct arguments **list,
+ struct variable *var,
+ struct variable *ind);
+extern void add_variable_to_tail(struct arguments **list,
+ struct variable *var,
+ struct variable *ind);
extern void remove_variable_from_list(struct arguments **list, struct variable *var);
-extern void dump_variables(struct arguments *, int);
+extern void dump_variables(struct arguments *list, int mode);
extern struct typedefs *get_typedef(const char *name, bool noerror);
-extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool);
+extern void adjust_array(enum ECPGttype type_enum, char **dimension,
+ char **length, char *type_dimension,
+ char *type_index, int pointer_len,
+ bool type_definition);
extern void reset_variables(void);
-extern void check_indicator(struct ECPGtype *);
-extern void remove_typedefs(int);
-extern void remove_variables(int);
-extern struct variable *new_variable(const char *, struct ECPGtype *, int);
+extern void check_indicator(struct ECPGtype *var);
+extern void remove_typedefs(int brace_level);
+extern void remove_variables(int brace_level);
+extern struct variable *new_variable(const char *name,
+ struct ECPGtype *type,
+ int brace_level);
extern int ScanCKeywordLookup(const char *text);
extern int ScanECPGKeywordLookup(const char *text);
extern void parser_init(void);
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index d4b4da5ff..58119d110 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -233,7 +233,7 @@ get_type(enum ECPGttype type)
*/
static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize,
- char *arrsize, const char *size, const char *prefix, int);
+ char *arrsize, const char *size, const char *prefix, int counter);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize,
struct ECPGtype *type, struct ECPGtype *ind_type, const char *prefix, const char *ind_prefix);
diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h
index 08b739e5f..28edf0897 100644
--- a/src/interfaces/ecpg/preproc/type.h
+++ b/src/interfaces/ecpg/preproc/type.h
@@ -33,15 +33,15 @@ struct ECPGtype
};
/* Everything is malloced. */
-void ECPGmake_struct_member(const char *, struct ECPGtype *, struct ECPGstruct_member **);
-struct ECPGtype *ECPGmake_simple_type(enum ECPGttype, char *, int);
-struct ECPGtype *ECPGmake_array_type(struct ECPGtype *, char *);
-struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *, enum ECPGttype, char *, char *);
-struct ECPGstruct_member *ECPGstruct_member_dup(struct ECPGstruct_member *);
+void ECPGmake_struct_member(const char *name, struct ECPGtype *type, struct ECPGstruct_member **start);
+struct ECPGtype *ECPGmake_simple_type(enum ECPGttype type, char *size, int counter);
+struct ECPGtype *ECPGmake_array_type(struct ECPGtype *type, char *size);
+struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *rm, enum ECPGttype type, char *type_name, char *struct_sizeof);
+struct ECPGstruct_member *ECPGstruct_member_dup(struct ECPGstruct_member *rm);
/* Frees a type. */
-void ECPGfree_struct_member(struct ECPGstruct_member *);
-void ECPGfree_type(struct ECPGtype *);
+void ECPGfree_struct_member(struct ECPGstruct_member *rm);
+void ECPGfree_type(struct ECPGtype *type);
/* Dump a type.
The type is dumped as:
@@ -53,10 +53,12 @@ void ECPGfree_type(struct ECPGtype *);
size is the maxsize in case it is a varchar. Otherwise it is the size of
the variable (required to do array fetches of structs).
*/
-void ECPGdump_a_type(FILE *, const char *, struct ECPGtype *, const int,
- const char *, struct ECPGtype *, const int,
- const char *, const char *, char *,
- const char *, const char *);
+void ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype *type,
+ const int brace_level, const char *ind_name,
+ struct ECPGtype *ind_type, const int ind_brace_level,
+ const char *prefix, const char *ind_prefix,
+ char *arr_str_size, const char *struct_sizeof,
+ const char *ind_struct_sizeof);
/* A simple struct to keep a variable and its type. */
struct ECPGtemp_type
diff --git a/src/interfaces/ecpg/test/expected/preproc-outofscope.c b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
index 3a27c53e1..a040a6901 100644
--- a/src/interfaces/ecpg/test/expected/preproc-outofscope.c
+++ b/src/interfaces/ecpg/test/expected/preproc-outofscope.c
@@ -70,24 +70,24 @@ extern "C"
numeric *PGTYPESnumeric_new(void);
decimal *PGTYPESdecimal_new(void);
-void PGTYPESnumeric_free(numeric *);
-void PGTYPESdecimal_free(decimal *);
-numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(numeric *, int);
-int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_cmp(numeric *, numeric *);
-int PGTYPESnumeric_from_int(signed int, numeric *);
-int PGTYPESnumeric_from_long(signed long int, numeric *);
-int PGTYPESnumeric_copy(numeric *, numeric *);
-int PGTYPESnumeric_from_double(double, numeric *);
-int PGTYPESnumeric_to_double(numeric *, double *);
-int PGTYPESnumeric_to_int(numeric *, int *);
-int PGTYPESnumeric_to_long(numeric *, long *);
-int PGTYPESnumeric_to_decimal(numeric *, decimal *);
-int PGTYPESnumeric_from_decimal(decimal *, numeric *);
+void PGTYPESnumeric_free(numeric *var);
+void PGTYPESdecimal_free(decimal *var);
+numeric *PGTYPESnumeric_from_asc(char *str, char **endptr);
+char *PGTYPESnumeric_to_asc(numeric *num, int dscale);
+int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_cmp(numeric *var1, numeric *var2);
+int PGTYPESnumeric_from_int(signed int int_val, numeric *var);
+int PGTYPESnumeric_from_long(signed long int long_val, numeric *var);
+int PGTYPESnumeric_copy(numeric *src, numeric *dst);
+int PGTYPESnumeric_from_double(double d, numeric *dst);
+int PGTYPESnumeric_to_double(numeric *nv, double *dp);
+int PGTYPESnumeric_to_int(numeric *nv, int *ip);
+int PGTYPESnumeric_to_long(numeric *nv, long *lp);
+int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst);
+int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/test/expected/sql-sqlda.c b/src/interfaces/ecpg/test/expected/sql-sqlda.c
index d474bd38b..ee1a67427 100644
--- a/src/interfaces/ecpg/test/expected/sql-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/sql-sqlda.c
@@ -92,24 +92,24 @@ extern "C"
numeric *PGTYPESnumeric_new(void);
decimal *PGTYPESdecimal_new(void);
-void PGTYPESnumeric_free(numeric *);
-void PGTYPESdecimal_free(decimal *);
-numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(numeric *, int);
-int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
-int PGTYPESnumeric_cmp(numeric *, numeric *);
-int PGTYPESnumeric_from_int(signed int, numeric *);
-int PGTYPESnumeric_from_long(signed long int, numeric *);
-int PGTYPESnumeric_copy(numeric *, numeric *);
-int PGTYPESnumeric_from_double(double, numeric *);
-int PGTYPESnumeric_to_double(numeric *, double *);
-int PGTYPESnumeric_to_int(numeric *, int *);
-int PGTYPESnumeric_to_long(numeric *, long *);
-int PGTYPESnumeric_to_decimal(numeric *, decimal *);
-int PGTYPESnumeric_from_decimal(decimal *, numeric *);
+void PGTYPESnumeric_free(numeric *var);
+void PGTYPESdecimal_free(decimal *var);
+numeric *PGTYPESnumeric_from_asc(char *str, char **endptr);
+char *PGTYPESnumeric_to_asc(numeric *num, int dscale);
+int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result);
+int PGTYPESnumeric_cmp(numeric *var1, numeric *var2);
+int PGTYPESnumeric_from_int(signed int int_val, numeric *var);
+int PGTYPESnumeric_from_long(signed long int long_val, numeric *var);
+int PGTYPESnumeric_copy(numeric *src, numeric *dst);
+int PGTYPESnumeric_from_double(double d, numeric *dst);
+int PGTYPESnumeric_to_double(numeric *nv, double *dp);
+int PGTYPESnumeric_to_int(numeric *nv, int *ip);
+int PGTYPESnumeric_to_long(numeric *nv, long *lp);
+int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst);
+int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst);
#ifdef __cplusplus
}
--
2.34.1
On Wed, Sep 21, 2022 at 6:58 PM Peter Geoghegan <pg@bowt.ie> wrote:
Attached revision shows where I'm at with this. Would be nice to get
it all out of the way before too long.
Attached is v6, which now consists of only one single patch, which
fixes things up in pg_dump. (This is almost though not quite identical
to the same patch from v5.)
I would like to give another 24 hours for anybody to lodge final
objections to what I've done in this patch. It seems possible that
there will be concerns about how this might affect backpatching, or
something like that. This patch goes relatively far in the direction
of refactoring to make things consistent at the module level -- unlike
most of the patches, which largely consisted of mechanical adjustments
that were obviously correct, both locally and at the whole-module level.
BTW, I notice that meson seems to have built-in support for running
scan-build, a tool that performs static analysis using clang. I'm
pretty sure that it's possible to use scan-build to run clang-tidy
checks (though I've just been using run-clang-tidy myself). Perhaps it
would make sense to use meson's support for scan-build to make it easy
for everybody to run the clang-tidy checks locally.
--
Peter Geoghegan
Attachments:
v6-0001-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchapplication/x-patch; name=v6-0001-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patchDownload
From ae97a00cb4c69b3fd247bc6606509165912bee29 Mon Sep 17 00:00:00 2001
From: Peter Geoghegan <pg@bowt.ie>
Date: Wed, 21 Sep 2022 14:51:29 -0700
Subject: [PATCH v6] Harmonize parameter names in pg_dump/pg_dumpall.
Make sure that function declarations use names that exactly match the
corresponding names from function definitions. Having parameter names
that are reliably consistent in this way will make it easier to reason
about groups of related C functions from the same translation unit as a
module. It will also make certain refactoring tasks easier.
Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
---
src/bin/pg_dump/common.c | 2 +-
src/bin/pg_dump/parallel.c | 14 +-
src/bin/pg_dump/pg_backup.h | 36 ++--
src/bin/pg_dump/pg_backup_archiver.c | 74 +++----
src/bin/pg_dump/pg_backup_archiver.h | 10 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_db.c | 40 ++--
src/bin/pg_dump/pg_backup_db.h | 12 +-
src/bin/pg_dump/pg_backup_directory.c | 2 +-
src/bin/pg_dump/pg_backup_null.c | 8 +-
src/bin/pg_dump/pg_backup_tar.c | 4 +-
src/bin/pg_dump/pg_dump.c | 290 +++++++++++++-------------
src/bin/pg_dump/pg_dump.h | 6 +-
src/bin/pg_dump/pg_dumpall.c | 6 +-
14 files changed, 254 insertions(+), 252 deletions(-)
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 395f817fa..44fa52cc5 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -79,7 +79,7 @@ typedef struct _catalogIdMapEntry
static catalogid_hash *catalogIdHash = NULL;
-static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables,
+static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables);
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index c8a70d9bc..ba6df9e0c 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -146,7 +146,7 @@ static int pgpipe(int handles[2]);
typedef struct ShutdownInformation
{
ParallelState *pstate;
- Archive *AHX;
+ Archive *A;
} ShutdownInformation;
static ShutdownInformation shutdown_info;
@@ -325,9 +325,9 @@ getThreadLocalPQExpBuffer(void)
* as soon as they've created the ArchiveHandle.
*/
void
-on_exit_close_archive(Archive *AHX)
+on_exit_close_archive(Archive *A)
{
- shutdown_info.AHX = AHX;
+ shutdown_info.A = A;
on_exit_nicely(archive_close_connection, &shutdown_info);
}
@@ -353,8 +353,8 @@ archive_close_connection(int code, void *arg)
*/
ShutdownWorkersHard(si->pstate);
- if (si->AHX)
- DisconnectDatabase(si->AHX);
+ if (si->A)
+ DisconnectDatabase(si->A);
}
else
{
@@ -378,8 +378,8 @@ archive_close_connection(int code, void *arg)
else
{
/* Non-parallel operation: just kill the leader DB connection */
- if (si->AHX)
- DisconnectDatabase(si->AHX);
+ if (si->A)
+ DisconnectDatabase(si->A);
}
}
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fcc5f6bd0..9dc441902 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -270,33 +270,33 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods.
*/
-typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+typedef int (*DataDumperPtr) (Archive *A, const void *userArg);
-typedef void (*SetupWorkerPtrType) (Archive *AH);
+typedef void (*SetupWorkerPtrType) (Archive *A);
/*
* Main archiver interface.
*/
-extern void ConnectDatabase(Archive *AHX,
+extern void ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect);
-extern void DisconnectDatabase(Archive *AHX);
-extern PGconn *GetConnection(Archive *AHX);
+extern void DisconnectDatabase(Archive *A);
+extern PGconn *GetConnection(Archive *A);
/* Called to write *data* to the archive */
-extern void WriteData(Archive *AH, const void *data, size_t dLen);
+extern void WriteData(Archive *A, const void *data, size_t dLen);
-extern int StartBlob(Archive *AH, Oid oid);
-extern int EndBlob(Archive *AH, Oid oid);
+extern int StartBlob(Archive *A, Oid oid);
+extern int EndBlob(Archive *A, Oid oid);
-extern void CloseArchive(Archive *AH);
+extern void CloseArchive(Archive *A);
-extern void SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt);
+extern void SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt);
-extern void ProcessArchiveRestoreOptions(Archive *AH);
+extern void ProcessArchiveRestoreOptions(Archive *A);
-extern void RestoreArchive(Archive *AH);
+extern void RestoreArchive(Archive *A);
/* Open an existing archive */
extern Archive *OpenArchive(const char *FileSpec, const ArchiveFormat fmt);
@@ -307,7 +307,7 @@ extern Archive *CreateArchive(const char *FileSpec, const ArchiveFormat fmt,
SetupWorkerPtrType setupDumpWorker);
/* The --list option */
-extern void PrintTOCSummary(Archive *AH);
+extern void PrintTOCSummary(Archive *A);
extern RestoreOptions *NewRestoreOptions(void);
@@ -316,13 +316,13 @@ extern void InitDumpOptions(DumpOptions *opts);
extern DumpOptions *dumpOptionsFromRestoreOptions(RestoreOptions *ropt);
/* Rearrange and filter TOC entries */
-extern void SortTocFromFile(Archive *AHX);
+extern void SortTocFromFile(Archive *A);
/* Convenience functions used only when writing DATA */
-extern void archputs(const char *s, Archive *AH);
-extern int archprintf(Archive *AH, const char *fmt,...) pg_attribute_printf(2, 3);
+extern void archputs(const char *s, Archive *A);
+extern int archprintf(Archive *A, const char *fmt,...) pg_attribute_printf(2, 3);
-#define appendStringLiteralAH(buf,str,AH) \
- appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings)
+#define appendStringLiteralArchive(buf,str,A) \
+ appendStringLiteral(buf, str, (A)->encoding, (A)->std_strings)
#endif /* PG_BACKUP_H */
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 233198afc..c59eba6fd 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -227,9 +227,9 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt)
* setup doesn't need to know anything much, so it's defined here.
*/
static void
-setupRestoreWorker(Archive *AHX)
+setupRestoreWorker(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ReopenPtr(AH);
}
@@ -261,10 +261,10 @@ OpenArchive(const char *FileSpec, const ArchiveFormat fmt)
/* Public */
void
-CloseArchive(Archive *AHX)
+CloseArchive(Archive *A)
{
int res = 0;
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
AH->ClosePtr(AH);
@@ -281,22 +281,22 @@ CloseArchive(Archive *AHX)
/* Public */
void
-SetArchiveOptions(Archive *AH, DumpOptions *dopt, RestoreOptions *ropt)
+SetArchiveOptions(Archive *A, DumpOptions *dopt, RestoreOptions *ropt)
{
/* Caller can omit dump options, in which case we synthesize them */
if (dopt == NULL && ropt != NULL)
dopt = dumpOptionsFromRestoreOptions(ropt);
/* Save options for later access */
- AH->dopt = dopt;
- AH->ropt = ropt;
+ A->dopt = dopt;
+ A->ropt = ropt;
}
/* Public */
void
-ProcessArchiveRestoreOptions(Archive *AHX)
+ProcessArchiveRestoreOptions(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -349,9 +349,9 @@ ProcessArchiveRestoreOptions(Archive *AHX)
/* Public */
void
-RestoreArchive(Archive *AHX)
+RestoreArchive(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
bool parallel_mode;
TocEntry *te;
@@ -415,10 +415,10 @@ RestoreArchive(Archive *AHX)
* restore; allow the attempt regardless of the version of the restore
* target.
*/
- AHX->minRemoteVersion = 0;
- AHX->maxRemoteVersion = 9999999;
+ A->minRemoteVersion = 0;
+ A->maxRemoteVersion = 9999999;
- ConnectDatabase(AHX, &ropt->cparams, false);
+ ConnectDatabase(A, &ropt->cparams, false);
/*
* If we're talking to the DB directly, don't send comments since they
@@ -479,7 +479,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- StartTransaction(AHX);
+ StartTransaction(A);
else
ahprintf(AH, "BEGIN;\n\n");
}
@@ -724,7 +724,7 @@ RestoreArchive(Archive *AHX)
if (ropt->single_txn)
{
if (AH->connection)
- CommitTransaction(AHX);
+ CommitTransaction(A);
else
ahprintf(AH, "COMMIT;\n\n");
}
@@ -1031,9 +1031,9 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te)
/* Public */
void
-WriteData(Archive *AHX, const void *data, size_t dLen)
+WriteData(Archive *A, const void *data, size_t dLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->currToc)
pg_fatal("internal error -- WriteData cannot be called outside the context of a DataDumper routine");
@@ -1052,10 +1052,10 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
/* Public */
TocEntry *
-ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
+ArchiveEntry(Archive *A, CatalogId catalogId, DumpId dumpId,
ArchiveOpts *opts)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
TocEntry *newToc;
newToc = (TocEntry *) pg_malloc0(sizeof(TocEntry));
@@ -1110,9 +1110,9 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
/* Public */
void
-PrintTOCSummary(Archive *AHX)
+PrintTOCSummary(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
TocEntry *te;
teSection curSection;
@@ -1214,9 +1214,9 @@ PrintTOCSummary(Archive *AHX)
/* Called by a dumper to signal start of a BLOB */
int
-StartBlob(Archive *AHX, Oid oid)
+StartBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (!AH->StartBlobPtr)
pg_fatal("large-object output not supported in chosen format");
@@ -1228,9 +1228,9 @@ StartBlob(Archive *AHX, Oid oid)
/* Called by a dumper to signal end of a BLOB */
int
-EndBlob(Archive *AHX, Oid oid)
+EndBlob(Archive *A, Oid oid)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->EndBlobPtr)
AH->EndBlobPtr(AH, AH->currToc, oid);
@@ -1358,9 +1358,9 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
***********/
void
-SortTocFromFile(Archive *AHX)
+SortTocFromFile(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
RestoreOptions *ropt = AH->public.ropt;
FILE *fh;
StringInfoData linebuf;
@@ -1439,14 +1439,14 @@ SortTocFromFile(Archive *AHX)
/* Public */
void
-archputs(const char *s, Archive *AH)
+archputs(const char *s, Archive *A)
{
- WriteData(AH, s, strlen(s));
+ WriteData(A, s, strlen(s));
}
/* Public */
int
-archprintf(Archive *AH, const char *fmt,...)
+archprintf(Archive *A, const char *fmt,...)
{
int save_errno = errno;
char *p;
@@ -1474,7 +1474,7 @@ archprintf(Archive *AH, const char *fmt,...)
len = cnt;
}
- WriteData(AH, p, cnt);
+ WriteData(A, p, cnt);
free(p);
return (int) cnt;
}
@@ -1652,10 +1652,10 @@ dump_lo_buf(ArchiveHandle *AH)
{
PQExpBuffer buf = createPQExpBuffer();
- appendByteaLiteralAHX(buf,
- (const unsigned char *) AH->lo_buf,
- AH->lo_buf_used,
- AH);
+ appendByteaLiteralAH(buf,
+ (const unsigned char *) AH->lo_buf,
+ AH->lo_buf_used,
+ AH);
/* Hack: turn off writingBlob so ahwrite doesn't recurse to here */
AH->writingBlob = 0;
@@ -3125,7 +3125,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
* SQL requires a string literal here. Might as well be correct.
*/
if (user && *user)
- appendStringLiteralAHX(cmd, user, AH);
+ appendStringLiteralAH(cmd, user, AH);
else
appendPQExpBufferStr(cmd, "DEFAULT");
appendPQExpBufferChar(cmd, ';');
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 084cd87e8..a106513a3 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -404,7 +404,7 @@ struct _tocEntry
};
extern int parallel_restore(ArchiveHandle *AH, TocEntry *te);
-extern void on_exit_close_archive(Archive *AHX);
+extern void on_exit_close_archive(Archive *A);
extern void warn_or_exit_horribly(ArchiveHandle *AH, const char *fmt,...) pg_attribute_printf(2, 3);
@@ -428,7 +428,7 @@ typedef struct _archiveOpts
} ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */
-extern TocEntry *ArchiveEntry(Archive *AHX, CatalogId catalogId,
+extern TocEntry *ArchiveEntry(Archive *A, CatalogId catalogId,
DumpId dumpId, ArchiveOpts *opts);
extern void WriteHead(ArchiveHandle *AH);
@@ -444,10 +444,10 @@ extern int TocIDRequired(ArchiveHandle *AH, DumpId id);
TocEntry *getTocEntryByDumpId(ArchiveHandle *AH, DumpId id);
extern bool checkSeek(FILE *fp);
-#define appendStringLiteralAHX(buf,str,AH) \
+#define appendStringLiteralAH(buf,str,AH) \
appendStringLiteral(buf, str, (AH)->public.encoding, (AH)->public.std_strings)
-#define appendByteaLiteralAHX(buf,str,len,AH) \
+#define appendByteaLiteralAH(buf,str,len,AH) \
appendByteaLiteral(buf, str, len, (AH)->public.std_strings)
/*
@@ -457,7 +457,7 @@ extern bool checkSeek(FILE *fp);
extern size_t WriteInt(ArchiveHandle *AH, int i);
extern int ReadInt(ArchiveHandle *AH);
extern char *ReadStr(ArchiveHandle *AH);
-extern size_t WriteStr(ArchiveHandle *AH, const char *s);
+extern size_t WriteStr(ArchiveHandle *AH, const char *c);
int ReadOffset(ArchiveHandle *, pgoff_t *);
size_t WriteOffset(ArchiveHandle *, pgoff_t, int);
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 1023fea01..a0a55a1ed 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -40,7 +40,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 28baa68fd..6485b1ee1 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -98,20 +98,20 @@ ReconnectToServer(ArchiveHandle *AH, const char *dbname)
/*
* Make, or remake, a database connection with the given parameters.
*
- * The resulting connection handle is stored in AHX->connection.
+ * The resulting connection handle is stored in AH->connection.
*
* An interactive password prompt is automatically issued if required.
- * We store the results of that in AHX->savedPassword.
+ * We store the results of that in AH->savedPassword.
* Note: it's not really all that sensible to use a single-entry password
* cache if the username keeps changing. In current usage, however, the
* username never does change, so one savedPassword is sufficient.
*/
void
-ConnectDatabase(Archive *AHX,
+ConnectDatabase(Archive *A,
const ConnParams *cparams,
bool isReconnect)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
trivalue prompt_password;
char *password;
bool new_pass;
@@ -222,9 +222,9 @@ ConnectDatabase(Archive *AHX,
* have one running.
*/
void
-DisconnectDatabase(Archive *AHX)
+DisconnectDatabase(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
char errbuf[1];
if (!AH->connection)
@@ -251,9 +251,9 @@ DisconnectDatabase(Archive *AHX)
}
PGconn *
-GetConnection(Archive *AHX)
+GetConnection(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
return AH->connection;
}
@@ -275,9 +275,9 @@ die_on_query_failure(ArchiveHandle *AH, const char *query)
}
void
-ExecuteSqlStatement(Archive *AHX, const char *query)
+ExecuteSqlStatement(Archive *A, const char *query)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -287,9 +287,9 @@ ExecuteSqlStatement(Archive *AHX, const char *query)
}
PGresult *
-ExecuteSqlQuery(Archive *AHX, const char *query, ExecStatusType status)
+ExecuteSqlQuery(Archive *A, const char *query, ExecStatusType status)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
PGresult *res;
res = PQexec(AH->connection, query);
@@ -442,9 +442,9 @@ ExecuteSimpleCommands(ArchiveHandle *AH, const char *buf, size_t bufLen)
* Implement ahwrite() for direct-to-DB restore
*/
int
-ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen)
+ExecuteSqlCommandBuf(Archive *A, const char *buf, size_t bufLen)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->outputKind == OUTPUT_COPYDATA)
{
@@ -497,9 +497,9 @@ ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen)
* Terminate a COPY operation during direct-to-DB restore
*/
void
-EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
+EndDBCopyMode(Archive *A, const char *tocEntryTag)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
if (AH->pgCopyIn)
{
@@ -526,17 +526,17 @@ EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
}
void
-StartTransaction(Archive *AHX)
+StartTransaction(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
ExecuteSqlCommand(AH, "BEGIN", "could not start database transaction");
}
void
-CommitTransaction(Archive *AHX)
+CommitTransaction(Archive *A)
{
- ArchiveHandle *AH = (ArchiveHandle *) AHX;
+ ArchiveHandle *AH = (ArchiveHandle *) A;
ExecuteSqlCommand(AH, "COMMIT", "could not commit database transaction");
}
diff --git a/src/bin/pg_dump/pg_backup_db.h b/src/bin/pg_dump/pg_backup_db.h
index 8888dd34b..b96e2594e 100644
--- a/src/bin/pg_dump/pg_backup_db.h
+++ b/src/bin/pg_dump/pg_backup_db.h
@@ -11,16 +11,16 @@
#include "pg_backup.h"
-extern int ExecuteSqlCommandBuf(Archive *AHX, const char *buf, size_t bufLen);
+extern int ExecuteSqlCommandBuf(Archive *A, const char *buf, size_t bufLen);
-extern void ExecuteSqlStatement(Archive *AHX, const char *query);
-extern PGresult *ExecuteSqlQuery(Archive *AHX, const char *query,
+extern void ExecuteSqlStatement(Archive *A, const char *query);
+extern PGresult *ExecuteSqlQuery(Archive *A, const char *query,
ExecStatusType status);
extern PGresult *ExecuteSqlQueryForSingleRow(Archive *fout, const char *query);
-extern void EndDBCopyMode(Archive *AHX, const char *tocEntryTag);
+extern void EndDBCopyMode(Archive *A, const char *tocEntryTag);
-extern void StartTransaction(Archive *AHX);
-extern void CommitTransaction(Archive *AHX);
+extern void StartTransaction(Archive *A);
+extern void CommitTransaction(Archive *A);
#endif
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 3f46f7988..798182b6f 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -67,7 +67,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c
index 541306d99..7eda176bb 100644
--- a/src/bin/pg_dump/pg_backup_null.c
+++ b/src/bin/pg_dump/pg_backup_null.c
@@ -99,10 +99,10 @@ _WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen)
{
PQExpBuffer buf = createPQExpBuffer();
- appendByteaLiteralAHX(buf,
- (const unsigned char *) data,
- dLen,
- AH);
+ appendByteaLiteralAH(buf,
+ (const unsigned char *) data,
+ dLen,
+ AH);
ahprintf(AH, "SELECT pg_catalog.lowrite(0, %s);\n", buf->data);
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 7960b81c0..402b93c61 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -46,7 +46,7 @@ static void _StartData(ArchiveHandle *AH, TocEntry *te);
static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
-static int _ReadByte(ArchiveHandle *);
+static int _ReadByte(ArchiveHandle *AH);
static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _ReadBuf(ArchiveHandle *AH, void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
@@ -97,7 +97,7 @@ typedef struct
static void _LoadBlobs(ArchiveHandle *AH);
static TAR_MEMBER *tarOpen(ArchiveHandle *AH, const char *filename, char mode);
-static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
+static void tarClose(ArchiveHandle *AH, TAR_MEMBER *th);
#ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 65a5c5ec4..bcecf640c 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -159,7 +159,7 @@ static int nseclabels = 0;
(obj)->dobj.name)
static void help(const char *progname);
-static void setup_connection(Archive *AH,
+static void setup_connection(Archive *A,
const char *dumpencoding, const char *dumpsnapshot,
char *use_role);
static ArchiveFormat parseArchiveFormat(const char *format, ArchiveMode *mode);
@@ -221,7 +221,7 @@ static void dumpFunc(Archive *fout, const FuncInfo *finfo);
static void dumpCast(Archive *fout, const CastInfo *cast);
static void dumpTransform(Archive *fout, const TransformInfo *transform);
static void dumpOpr(Archive *fout, const OprInfo *oprinfo);
-static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *oprinfo);
+static void dumpAccessMethod(Archive *fout, const AccessMethodInfo *aminfo);
static void dumpOpclass(Archive *fout, const OpclassInfo *opcinfo);
static void dumpOpfamily(Archive *fout, const OpfamilyInfo *opfinfo);
static void dumpCollation(Archive *fout, const CollInfo *collinfo);
@@ -232,7 +232,7 @@ static void dumpTrigger(Archive *fout, const TriggerInfo *tginfo);
static void dumpEventTrigger(Archive *fout, const EventTriggerInfo *evtinfo);
static void dumpTable(Archive *fout, const TableInfo *tbinfo);
static void dumpTableSchema(Archive *fout, const TableInfo *tbinfo);
-static void dumpTableAttach(Archive *fout, const TableAttachInfo *tbinfo);
+static void dumpTableAttach(Archive *fout, const TableAttachInfo *attachinfo);
static void dumpAttrDef(Archive *fout, const AttrDefInfo *adinfo);
static void dumpSequence(Archive *fout, const TableInfo *tbinfo);
static void dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo);
@@ -287,12 +287,12 @@ static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
static void dumpPublicationTable(Archive *fout, const PublicationRelInfo *pubrinfo);
static void dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo);
-static void dumpDatabase(Archive *AH);
-static void dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
+static void dumpDatabase(Archive *fout);
+static void dumpDatabaseConfig(Archive *A, PQExpBuffer outbuf,
const char *dbname, Oid dboid);
-static void dumpEncoding(Archive *AH);
-static void dumpStdStrings(Archive *AH);
-static void dumpSearchPath(Archive *AH);
+static void dumpEncoding(Archive *A);
+static void dumpStdStrings(Archive *A);
+static void dumpSearchPath(Archive *A);
static void binary_upgrade_set_type_oids_by_type_oid(Archive *fout,
PQExpBuffer upgrade_buffer,
Oid pg_type_oid,
@@ -312,10 +312,10 @@ static void binary_upgrade_extension_member(PQExpBuffer upgrade_buffer,
static const char *getAttrName(int attrnum, const TableInfo *tblInfo);
static const char *fmtCopyColumnList(const TableInfo *ti, PQExpBuffer buffer);
static bool nonemptyReloptions(const char *reloptions);
-static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
- const char *prefix, Archive *fout);
+static void appendReloptionsArrayA(PQExpBuffer buffer, const char *reloptions,
+ const char *prefix, Archive *fout);
static char *get_synchronized_snapshot(Archive *fout);
-static void setupDumpWorker(Archive *AHX);
+static void setupDumpWorker(Archive *A);
static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
@@ -1069,14 +1069,14 @@ help(const char *progname)
}
static void
-setup_connection(Archive *AH, const char *dumpencoding,
+setup_connection(Archive *A, const char *dumpencoding,
const char *dumpsnapshot, char *use_role)
{
- DumpOptions *dopt = AH->dopt;
- PGconn *conn = GetConnection(AH);
+ DumpOptions *dopt = A->dopt;
+ PGconn *conn = GetConnection(A);
const char *std_strings;
- PQclear(ExecuteSqlQueryForSingleRow(AH, ALWAYS_SECURE_SEARCH_PATH_SQL));
+ PQclear(ExecuteSqlQueryForSingleRow(A, ALWAYS_SECURE_SEARCH_PATH_SQL));
/*
* Set the client encoding if requested.
@@ -1092,18 +1092,18 @@ setup_connection(Archive *AH, const char *dumpencoding,
* Get the active encoding and the standard_conforming_strings setting, so
* we know how to escape strings.
*/
- AH->encoding = PQclientEncoding(conn);
+ A->encoding = PQclientEncoding(conn);
std_strings = PQparameterStatus(conn, "standard_conforming_strings");
- AH->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
+ A->std_strings = (std_strings && strcmp(std_strings, "on") == 0);
/*
* Set the role if requested. In a parallel dump worker, we'll be passed
- * use_role == NULL, but AH->use_role is already set (if user specified it
+ * use_role == NULL, but A->use_role is already set (if user specified it
* originally) and we should use that.
*/
- if (!use_role && AH->use_role)
- use_role = AH->use_role;
+ if (!use_role && A->use_role)
+ use_role = A->use_role;
/* Set the role if requested */
if (use_role)
@@ -1111,19 +1111,19 @@ setup_connection(Archive *AH, const char *dumpencoding,
PQExpBuffer query = createPQExpBuffer();
appendPQExpBuffer(query, "SET ROLE %s", fmtId(use_role));
- ExecuteSqlStatement(AH, query->data);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
/* save it for possible later use by parallel workers */
- if (!AH->use_role)
- AH->use_role = pg_strdup(use_role);
+ if (!A->use_role)
+ A->use_role = pg_strdup(use_role);
}
/* Set the datestyle to ISO to ensure the dump's portability */
- ExecuteSqlStatement(AH, "SET DATESTYLE = ISO");
+ ExecuteSqlStatement(A, "SET DATESTYLE = ISO");
/* Likewise, avoid using sql_standard intervalstyle */
- ExecuteSqlStatement(AH, "SET INTERVALSTYLE = POSTGRES");
+ ExecuteSqlStatement(A, "SET INTERVALSTYLE = POSTGRES");
/*
* Use an explicitly specified extra_float_digits if it has been provided.
@@ -1136,54 +1136,54 @@ setup_connection(Archive *AH, const char *dumpencoding,
appendPQExpBuffer(q, "SET extra_float_digits TO %d",
extra_float_digits);
- ExecuteSqlStatement(AH, q->data);
+ ExecuteSqlStatement(A, q->data);
destroyPQExpBuffer(q);
}
else
- ExecuteSqlStatement(AH, "SET extra_float_digits TO 3");
+ ExecuteSqlStatement(A, "SET extra_float_digits TO 3");
/*
* Disable synchronized scanning, to prevent unpredictable changes in row
* ordering across a dump and reload.
*/
- ExecuteSqlStatement(AH, "SET synchronize_seqscans TO off");
+ ExecuteSqlStatement(A, "SET synchronize_seqscans TO off");
/*
* Disable timeouts if supported.
*/
- ExecuteSqlStatement(AH, "SET statement_timeout = 0");
- if (AH->remoteVersion >= 90300)
- ExecuteSqlStatement(AH, "SET lock_timeout = 0");
- if (AH->remoteVersion >= 90600)
- ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
+ ExecuteSqlStatement(A, "SET statement_timeout = 0");
+ if (A->remoteVersion >= 90300)
+ ExecuteSqlStatement(A, "SET lock_timeout = 0");
+ if (A->remoteVersion >= 90600)
+ ExecuteSqlStatement(A, "SET idle_in_transaction_session_timeout = 0");
/*
* Quote all identifiers, if requested.
*/
if (quote_all_identifiers)
- ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ ExecuteSqlStatement(A, "SET quote_all_identifiers = true");
/*
* Adjust row-security mode, if supported.
*/
- if (AH->remoteVersion >= 90500)
+ if (A->remoteVersion >= 90500)
{
if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security = on");
+ ExecuteSqlStatement(A, "SET row_security = on");
else
- ExecuteSqlStatement(AH, "SET row_security = off");
+ ExecuteSqlStatement(A, "SET row_security = off");
}
/*
* Initialize prepared-query state to "nothing prepared". We do this here
* so that a parallel dump worker will have its own state.
*/
- AH->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
+ A->is_prepared = (bool *) pg_malloc0(NUM_PREP_QUERIES * sizeof(bool));
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
- ExecuteSqlStatement(AH, "BEGIN");
+ ExecuteSqlStatement(A, "BEGIN");
/*
* To support the combination of serializable_deferrable with the jobs
@@ -1193,52 +1193,52 @@ setup_connection(Archive *AH, const char *dumpencoding,
* REPEATABLE READ transaction provides the appropriate integrity
* guarantees. This is a kluge, but safe for back-patching.
*/
- if (dopt->serializable_deferrable && AH->sync_snapshot_id == NULL)
- ExecuteSqlStatement(AH,
+ if (dopt->serializable_deferrable && A->sync_snapshot_id == NULL)
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"SERIALIZABLE, READ ONLY, DEFERRABLE");
else
- ExecuteSqlStatement(AH,
+ ExecuteSqlStatement(A,
"SET TRANSACTION ISOLATION LEVEL "
"REPEATABLE READ, READ ONLY");
/*
* If user specified a snapshot to use, select that. In a parallel dump
- * worker, we'll be passed dumpsnapshot == NULL, but AH->sync_snapshot_id
+ * worker, we'll be passed dumpsnapshot == NULL, but A->sync_snapshot_id
* is already set (if the server can handle it) and we should use that.
*/
if (dumpsnapshot)
- AH->sync_snapshot_id = pg_strdup(dumpsnapshot);
+ A->sync_snapshot_id = pg_strdup(dumpsnapshot);
- if (AH->sync_snapshot_id)
+ if (A->sync_snapshot_id)
{
PQExpBuffer query = createPQExpBuffer();
appendPQExpBufferStr(query, "SET TRANSACTION SNAPSHOT ");
- appendStringLiteralConn(query, AH->sync_snapshot_id, conn);
- ExecuteSqlStatement(AH, query->data);
+ appendStringLiteralConn(query, A->sync_snapshot_id, conn);
+ ExecuteSqlStatement(A, query->data);
destroyPQExpBuffer(query);
}
- else if (AH->numWorkers > 1)
+ else if (A->numWorkers > 1)
{
- if (AH->isStandby && AH->remoteVersion < 100000)
+ if (A->isStandby && A->remoteVersion < 100000)
pg_fatal("parallel dumps from standby servers are not supported by this server version");
- AH->sync_snapshot_id = get_synchronized_snapshot(AH);
+ A->sync_snapshot_id = get_synchronized_snapshot(A);
}
}
/* Set up connection for a parallel worker process */
static void
-setupDumpWorker(Archive *AH)
+setupDumpWorker(Archive *A)
{
/*
* We want to re-select all the same values the leader connection is
* using. We'll have inherited directly-usable values in
- * AH->sync_snapshot_id and AH->use_role, but we need to translate the
+ * A->sync_snapshot_id and A->use_role, but we need to translate the
* inherited encoding value back to a string to pass to setup_connection.
*/
- setup_connection(AH,
- pg_encoding_to_char(AH->encoding),
+ setup_connection(A,
+ pg_encoding_to_char(A->encoding),
NULL,
NULL);
}
@@ -2320,9 +2320,9 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
default:
/* All other types are printed as string literals. */
resetPQExpBuffer(q);
- appendStringLiteralAH(q,
- PQgetvalue(res, tuple, field),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, tuple, field),
+ fout);
archputs(q->data, fout);
break;
}
@@ -2920,7 +2920,7 @@ dumpDatabase(Archive *fout)
if (strlen(encoding) > 0)
{
appendPQExpBufferStr(creaQry, " ENCODING = ");
- appendStringLiteralAH(creaQry, encoding, fout);
+ appendStringLiteralArchive(creaQry, encoding, fout);
}
appendPQExpBufferStr(creaQry, " LOCALE_PROVIDER = ");
@@ -2935,25 +2935,25 @@ dumpDatabase(Archive *fout)
if (strlen(collate) > 0 && strcmp(collate, ctype) == 0)
{
appendPQExpBufferStr(creaQry, " LOCALE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
else
{
if (strlen(collate) > 0)
{
appendPQExpBufferStr(creaQry, " LC_COLLATE = ");
- appendStringLiteralAH(creaQry, collate, fout);
+ appendStringLiteralArchive(creaQry, collate, fout);
}
if (strlen(ctype) > 0)
{
appendPQExpBufferStr(creaQry, " LC_CTYPE = ");
- appendStringLiteralAH(creaQry, ctype, fout);
+ appendStringLiteralArchive(creaQry, ctype, fout);
}
}
if (iculocale)
{
appendPQExpBufferStr(creaQry, " ICU_LOCALE = ");
- appendStringLiteralAH(creaQry, iculocale, fout);
+ appendStringLiteralArchive(creaQry, iculocale, fout);
}
/*
@@ -2965,9 +2965,9 @@ dumpDatabase(Archive *fout)
if (!PQgetisnull(res, 0, i_datcollversion))
{
appendPQExpBufferStr(creaQry, " COLLATION_VERSION = ");
- appendStringLiteralAH(creaQry,
- PQgetvalue(res, 0, i_datcollversion),
- fout);
+ appendStringLiteralArchive(creaQry,
+ PQgetvalue(res, 0, i_datcollversion),
+ fout);
}
}
@@ -3021,7 +3021,7 @@ dumpDatabase(Archive *fout)
* database.
*/
appendPQExpBuffer(dbQry, "COMMENT ON DATABASE %s IS ", qdatname);
- appendStringLiteralAH(dbQry, comment, fout);
+ appendStringLiteralArchive(dbQry, comment, fout);
appendPQExpBufferStr(dbQry, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -3100,7 +3100,7 @@ dumpDatabase(Archive *fout)
*/
appendPQExpBufferStr(delQry, "UPDATE pg_catalog.pg_database "
"SET datistemplate = false WHERE datname = ");
- appendStringLiteralAH(delQry, datname, fout);
+ appendStringLiteralArchive(delQry, datname, fout);
appendPQExpBufferStr(delQry, ";\n");
}
@@ -3118,7 +3118,7 @@ dumpDatabase(Archive *fout)
"SET datfrozenxid = '%u', datminmxid = '%u'\n"
"WHERE datname = ",
frozenxid, minmxid);
- appendStringLiteralAH(creaQry, datname, fout);
+ appendStringLiteralArchive(creaQry, datname, fout);
appendPQExpBufferStr(creaQry, ";\n");
}
@@ -3226,10 +3226,10 @@ dumpDatabase(Archive *fout)
* for this database, and append them to outbuf.
*/
static void
-dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
+dumpDatabaseConfig(Archive *A, PQExpBuffer outbuf,
const char *dbname, Oid dboid)
{
- PGconn *conn = GetConnection(AH);
+ PGconn *conn = GetConnection(A);
PQExpBuffer buf = createPQExpBuffer();
PGresult *res;
@@ -3238,7 +3238,7 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
"WHERE setrole = 0 AND setdatabase = '%u'::oid",
dboid);
- res = ExecuteSqlQuery(AH, buf->data, PGRES_TUPLES_OK);
+ res = ExecuteSqlQuery(A, buf->data, PGRES_TUPLES_OK);
for (int i = 0; i < PQntuples(res); i++)
makeAlterConfigCommand(conn, PQgetvalue(res, i, 0),
@@ -3253,7 +3253,7 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
"WHERE setrole = r.oid AND setdatabase = '%u'::oid",
dboid);
- res = ExecuteSqlQuery(AH, buf->data, PGRES_TUPLES_OK);
+ res = ExecuteSqlQuery(A, buf->data, PGRES_TUPLES_OK);
for (int i = 0; i < PQntuples(res); i++)
makeAlterConfigCommand(conn, PQgetvalue(res, i, 1),
@@ -3270,18 +3270,18 @@ dumpDatabaseConfig(Archive *AH, PQExpBuffer outbuf,
* dumpEncoding: put the correct encoding into the archive
*/
static void
-dumpEncoding(Archive *AH)
+dumpEncoding(Archive *A)
{
- const char *encname = pg_encoding_to_char(AH->encoding);
+ const char *encname = pg_encoding_to_char(A->encoding);
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving encoding = %s", encname);
appendPQExpBufferStr(qry, "SET client_encoding = ");
- appendStringLiteralAH(qry, encname, AH);
+ appendStringLiteralArchive(qry, encname, A);
appendPQExpBufferStr(qry, ";\n");
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "ENCODING",
.description = "ENCODING",
.section = SECTION_PRE_DATA,
@@ -3295,9 +3295,9 @@ dumpEncoding(Archive *AH)
* dumpStdStrings: put the correct escape string behavior into the archive
*/
static void
-dumpStdStrings(Archive *AH)
+dumpStdStrings(Archive *A)
{
- const char *stdstrings = AH->std_strings ? "on" : "off";
+ const char *stdstrings = A->std_strings ? "on" : "off";
PQExpBuffer qry = createPQExpBuffer();
pg_log_info("saving standard_conforming_strings = %s",
@@ -3306,7 +3306,7 @@ dumpStdStrings(Archive *AH)
appendPQExpBuffer(qry, "SET standard_conforming_strings = '%s';\n",
stdstrings);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "STDSTRINGS",
.description = "STDSTRINGS",
.section = SECTION_PRE_DATA,
@@ -3319,7 +3319,7 @@ dumpStdStrings(Archive *AH)
* dumpSearchPath: record the active search_path in the archive
*/
static void
-dumpSearchPath(Archive *AH)
+dumpSearchPath(Archive *A)
{
PQExpBuffer qry = createPQExpBuffer();
PQExpBuffer path = createPQExpBuffer();
@@ -3335,7 +3335,7 @@ dumpSearchPath(Archive *AH)
* listing schemas that may appear in search_path but not actually exist,
* which seems like a prudent exclusion.
*/
- res = ExecuteSqlQueryForSingleRow(AH,
+ res = ExecuteSqlQueryForSingleRow(A,
"SELECT pg_catalog.current_schemas(false)");
if (!parsePGArray(PQgetvalue(res, 0, 0), &schemanames, &nschemanames))
@@ -3355,19 +3355,19 @@ dumpSearchPath(Archive *AH)
}
appendPQExpBufferStr(qry, "SELECT pg_catalog.set_config('search_path', ");
- appendStringLiteralAH(qry, path->data, AH);
+ appendStringLiteralArchive(qry, path->data, A);
appendPQExpBufferStr(qry, ", false);\n");
pg_log_info("saving search_path = %s", path->data);
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
+ ArchiveEntry(A, nilCatalogId, createDumpId(),
ARCHIVE_OPTS(.tag = "SEARCHPATH",
.description = "SEARCHPATH",
.section = SECTION_PRE_DATA,
.createStmt = qry->data));
- /* Also save it in AH->searchpath, in case we're doing plain text dump */
- AH->searchpath = pg_strdup(qry->data);
+ /* Also save it in A->searchpath, in case we're doing plain text dump */
+ A->searchpath = pg_strdup(qry->data);
free(schemanames);
PQclear(res);
@@ -4593,7 +4593,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, "CREATE SUBSCRIPTION %s CONNECTION ",
qsubname);
- appendStringLiteralAH(query, subinfo->subconninfo, fout);
+ appendStringLiteralArchive(query, subinfo->subconninfo, fout);
/* Build list of quoted publications and append them to query. */
if (!parsePGArray(subinfo->subpublications, &pubnames, &npubnames))
@@ -4610,7 +4610,7 @@ dumpSubscription(Archive *fout, const SubscriptionInfo *subinfo)
appendPQExpBuffer(query, " PUBLICATION %s WITH (connect = false, slot_name = ", publications->data);
if (subinfo->subslotname)
- appendStringLiteralAH(query, subinfo->subslotname, fout);
+ appendStringLiteralArchive(query, subinfo->subslotname, fout);
else
appendPQExpBufferStr(query, "NONE");
@@ -9506,7 +9506,7 @@ dumpCommentExtended(Archive *fout, const char *type,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, comments->descr, fout);
+ appendStringLiteralArchive(query, comments->descr, fout);
appendPQExpBufferStr(query, ";\n");
appendPQExpBuffer(tag, "%s %s", type, name);
@@ -9596,7 +9596,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
resetPQExpBuffer(query);
appendPQExpBuffer(query, "COMMENT ON %s %s IS ", reltypename,
fmtQualifiedDumpable(tbinfo));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -9621,7 +9621,7 @@ dumpTableComment(Archive *fout, const TableInfo *tbinfo,
fmtQualifiedDumpable(tbinfo));
appendPQExpBuffer(query, "%s IS ",
fmtId(tbinfo->attnames[objsubid - 1]));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -10131,12 +10131,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_create_empty_extension(");
- appendStringLiteralAH(q, extinfo->dobj.name, fout);
+ appendStringLiteralArchive(q, extinfo->dobj.name, fout);
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, extinfo->namespace, fout);
+ appendStringLiteralArchive(q, extinfo->namespace, fout);
appendPQExpBufferStr(q, ", ");
appendPQExpBuffer(q, "%s, ", extinfo->relocatable ? "true" : "false");
- appendStringLiteralAH(q, extinfo->extversion, fout);
+ appendStringLiteralArchive(q, extinfo->extversion, fout);
appendPQExpBufferStr(q, ", ");
/*
@@ -10145,12 +10145,12 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
* preserved in binary upgrade.
*/
if (strlen(extinfo->extconfig) > 2)
- appendStringLiteralAH(q, extinfo->extconfig, fout);
+ appendStringLiteralArchive(q, extinfo->extconfig, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
if (strlen(extinfo->extcondition) > 2)
- appendStringLiteralAH(q, extinfo->extcondition, fout);
+ appendStringLiteralArchive(q, extinfo->extcondition, fout);
else
appendPQExpBufferStr(q, "NULL");
appendPQExpBufferStr(q, ", ");
@@ -10165,7 +10165,7 @@ dumpExtension(Archive *fout, const ExtensionInfo *extinfo)
{
if (n++ > 0)
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, extobj->name, fout);
+ appendStringLiteralArchive(q, extobj->name, fout);
}
}
appendPQExpBufferStr(q, "]::pg_catalog.text[]");
@@ -10300,7 +10300,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
if (i > 0)
appendPQExpBufferChar(q, ',');
appendPQExpBufferStr(q, "\n ");
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
}
}
@@ -10323,7 +10323,7 @@ dumpEnumType(Archive *fout, const TypeInfo *tyinfo)
"SELECT pg_catalog.binary_upgrade_set_next_pg_enum_oid('%u'::pg_catalog.oid);\n",
enum_oid);
appendPQExpBuffer(q, "ALTER TYPE %s ADD VALUE ", qualtypname);
- appendStringLiteralAH(q, label, fout);
+ appendStringLiteralArchive(q, label, fout);
appendPQExpBufferStr(q, ";\n\n");
}
}
@@ -10748,7 +10748,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, ",\n DEFAULT = ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -10764,7 +10764,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (strcmp(typcategory, "U") != 0)
{
appendPQExpBufferStr(q, ",\n CATEGORY = ");
- appendStringLiteralAH(q, typcategory, fout);
+ appendStringLiteralArchive(q, typcategory, fout);
}
if (strcmp(typispreferred, "t") == 0)
@@ -10773,7 +10773,7 @@ dumpBaseType(Archive *fout, const TypeInfo *tyinfo)
if (typdelim && strcmp(typdelim, ",") != 0)
{
appendPQExpBufferStr(q, ",\n DELIMITER = ");
- appendStringLiteralAH(q, typdelim, fout);
+ appendStringLiteralArchive(q, typdelim, fout);
}
if (*typalign == TYPALIGN_CHAR)
@@ -10931,7 +10931,7 @@ dumpDomain(Archive *fout, const TypeInfo *tyinfo)
{
appendPQExpBufferStr(q, " DEFAULT ");
if (typdefault_is_literal)
- appendStringLiteralAH(q, typdefault, fout);
+ appendStringLiteralArchive(q, typdefault, fout);
else
appendPQExpBufferStr(q, typdefault);
}
@@ -11151,9 +11151,9 @@ dumpCompositeType(Archive *fout, const TypeInfo *tyinfo)
"SET attlen = %s, "
"attalign = '%s', attbyval = false\n"
"WHERE attname = ", attlen, attalign);
- appendStringLiteralAH(dropped, attname, fout);
+ appendStringLiteralArchive(dropped, attname, fout);
appendPQExpBufferStr(dropped, "\n AND attrelid = ");
- appendStringLiteralAH(dropped, qualtypname, fout);
+ appendStringLiteralArchive(dropped, qualtypname, fout);
appendPQExpBufferStr(dropped, "::pg_catalog.regclass;\n");
appendPQExpBuffer(dropped, "ALTER TYPE %s ",
@@ -11283,7 +11283,7 @@ dumpCompositeTypeColComments(Archive *fout, const TypeInfo *tyinfo,
appendPQExpBuffer(query, "COMMENT ON COLUMN %s.",
fmtQualifiedDumpable(tyinfo));
appendPQExpBuffer(query, "%s IS ", fmtId(attname));
- appendStringLiteralAH(query, descr, fout);
+ appendStringLiteralArchive(query, descr, fout);
appendPQExpBufferStr(query, ";\n");
ArchiveEntry(fout, nilCatalogId, createDumpId(),
@@ -11700,7 +11700,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
else if (probin[0] != '\0')
{
appendPQExpBufferStr(asPart, "AS ");
- appendStringLiteralAH(asPart, probin, fout);
+ appendStringLiteralArchive(asPart, probin, fout);
if (prosrc[0] != '\0')
{
appendPQExpBufferStr(asPart, ", ");
@@ -11711,7 +11711,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
*/
if (dopt->disable_dollar_quoting ||
(strchr(prosrc, '\'') == NULL && strchr(prosrc, '\\') == NULL))
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11721,7 +11721,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
appendPQExpBufferStr(asPart, "AS ");
/* with no bin, dollar quote src unconditionally if allowed */
if (dopt->disable_dollar_quoting)
- appendStringLiteralAH(asPart, prosrc, fout);
+ appendStringLiteralArchive(asPart, prosrc, fout);
else
appendStringLiteralDQ(asPart, prosrc, NULL);
}
@@ -11892,13 +11892,13 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
{
if (nameptr != namelist)
appendPQExpBufferStr(q, ", ");
- appendStringLiteralAH(q, *nameptr, fout);
+ appendStringLiteralArchive(q, *nameptr, fout);
}
}
pg_free(namelist);
}
else
- appendStringLiteralAH(q, pos, fout);
+ appendStringLiteralArchive(q, pos, fout);
}
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
@@ -13181,7 +13181,7 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (colliculocale != NULL)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, colliculocale, fout);
+ appendStringLiteralArchive(q, colliculocale, fout);
}
else
{
@@ -13191,14 +13191,14 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (strcmp(collcollate, collctype) == 0)
{
appendPQExpBufferStr(q, ", locale = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
}
else
{
appendPQExpBufferStr(q, ", lc_collate = ");
- appendStringLiteralAH(q, collcollate, fout);
+ appendStringLiteralArchive(q, collcollate, fout);
appendPQExpBufferStr(q, ", lc_ctype = ");
- appendStringLiteralAH(q, collctype, fout);
+ appendStringLiteralArchive(q, collctype, fout);
}
}
@@ -13214,9 +13214,9 @@ dumpCollation(Archive *fout, const CollInfo *collinfo)
if (!PQgetisnull(res, 0, i_collversion))
{
appendPQExpBufferStr(q, ", version = ");
- appendStringLiteralAH(q,
- PQgetvalue(res, 0, i_collversion),
- fout);
+ appendStringLiteralArchive(q,
+ PQgetvalue(res, 0, i_collversion),
+ fout);
}
}
@@ -13310,9 +13310,9 @@ dumpConversion(Archive *fout, const ConvInfo *convinfo)
appendPQExpBuffer(q, "CREATE %sCONVERSION %s FOR ",
(condefault) ? "DEFAULT " : "",
fmtQualifiedDumpable(convinfo));
- appendStringLiteralAH(q, conforencoding, fout);
+ appendStringLiteralArchive(q, conforencoding, fout);
appendPQExpBufferStr(q, " TO ");
- appendStringLiteralAH(q, contoencoding, fout);
+ appendStringLiteralArchive(q, contoencoding, fout);
/* regproc output is already sufficiently quoted */
appendPQExpBuffer(q, " FROM %s;\n", conproc);
@@ -13567,7 +13567,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_agginitval))
{
appendPQExpBufferStr(details, ",\n INITCOND = ");
- appendStringLiteralAH(details, agginitval, fout);
+ appendStringLiteralArchive(details, agginitval, fout);
}
if (strcmp(aggfinalfn, "-") != 0)
@@ -13623,7 +13623,7 @@ dumpAgg(Archive *fout, const AggInfo *agginfo)
if (!PQgetisnull(res, 0, i_aggminitval))
{
appendPQExpBufferStr(details, ",\n MINITCOND = ");
- appendStringLiteralAH(details, aggminitval, fout);
+ appendStringLiteralArchive(details, aggminitval, fout);
}
if (strcmp(aggmfinalfn, "-") != 0)
@@ -14168,12 +14168,12 @@ dumpForeignServer(Archive *fout, const ForeignServerInfo *srvinfo)
if (srvinfo->srvtype && strlen(srvinfo->srvtype) > 0)
{
appendPQExpBufferStr(q, " TYPE ");
- appendStringLiteralAH(q, srvinfo->srvtype, fout);
+ appendStringLiteralArchive(q, srvinfo->srvtype, fout);
}
if (srvinfo->srvversion && strlen(srvinfo->srvversion) > 0)
{
appendPQExpBufferStr(q, " VERSION ");
- appendStringLiteralAH(q, srvinfo->srvversion, fout);
+ appendStringLiteralArchive(q, srvinfo->srvversion, fout);
}
appendPQExpBufferStr(q, " FOREIGN DATA WRAPPER ");
@@ -14589,7 +14589,7 @@ dumpSecLabel(Archive *fout, const char *type, const char *name,
if (namespace && *namespace)
appendPQExpBuffer(query, "%s.", fmtId(namespace));
appendPQExpBuffer(query, "%s IS ", name);
- appendStringLiteralAH(query, labels[i].label, fout);
+ appendStringLiteralArchive(query, labels[i].label, fout);
appendPQExpBufferStr(query, ";\n");
}
@@ -14672,7 +14672,7 @@ dumpTableSecLabel(Archive *fout, const TableInfo *tbinfo, const char *reltypenam
}
appendPQExpBuffer(query, "SECURITY LABEL FOR %s ON %s IS ",
fmtId(provider), target->data);
- appendStringLiteralAH(query, label, fout);
+ appendStringLiteralArchive(query, label, fout);
appendPQExpBufferStr(query, ";\n");
}
if (query->len > 0)
@@ -15150,7 +15150,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
if (nonemptyReloptions(tbinfo->reloptions))
{
appendPQExpBufferStr(q, " WITH (");
- appendReloptionsArrayAH(q, tbinfo->reloptions, "", fout);
+ appendReloptionsArrayA(q, tbinfo->reloptions, "", fout);
appendPQExpBufferChar(q, ')');
}
result = createViewAsClause(fout, tbinfo);
@@ -15435,13 +15435,13 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
if (nonemptyReloptions(tbinfo->reloptions))
{
addcomma = true;
- appendReloptionsArrayAH(q, tbinfo->reloptions, "", fout);
+ appendReloptionsArrayA(q, tbinfo->reloptions, "", fout);
}
if (nonemptyReloptions(tbinfo->toast_reloptions))
{
if (addcomma)
appendPQExpBufferStr(q, ", ");
- appendReloptionsArrayAH(q, tbinfo->toast_reloptions, "toast.",
+ appendReloptionsArrayA(q, tbinfo->toast_reloptions, "toast.",
fout);
}
appendPQExpBufferChar(q, ')');
@@ -15488,11 +15488,11 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "\n-- set missing value.\n");
appendPQExpBufferStr(q,
"SELECT pg_catalog.binary_upgrade_set_missing_value(");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass,");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferChar(q, ',');
- appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attmissingval[j], fout);
appendPQExpBufferStr(q, ");\n\n");
}
}
@@ -15535,9 +15535,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"WHERE attname = ",
tbinfo->attlen[j],
tbinfo->attalign[j]);
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->relkind == RELKIND_RELATION ||
@@ -15556,9 +15556,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_attribute\n"
"SET attislocal = false\n"
"WHERE attname = ");
- appendStringLiteralAH(q, tbinfo->attnames[j], fout);
+ appendStringLiteralArchive(q, tbinfo->attnames[j], fout);
appendPQExpBufferStr(q, "\n AND attrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
}
@@ -15584,9 +15584,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_constraint\n"
"SET conislocal = false\n"
"WHERE contype = 'c' AND conname = ");
- appendStringLiteralAH(q, constr->dobj.name, fout);
+ appendStringLiteralArchive(q, constr->dobj.name, fout);
appendPQExpBufferStr(q, "\n AND conrelid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -15629,7 +15629,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
"SET relfrozenxid = '%u', relminmxid = '%u'\n"
"WHERE oid = ",
tbinfo->frozenxid, tbinfo->minmxid);
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
if (tbinfo->toast_oid)
@@ -15661,7 +15661,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
appendPQExpBufferStr(q, "UPDATE pg_catalog.pg_class\n"
"SET relispopulated = 't'\n"
"WHERE oid = ");
- appendStringLiteralAH(q, qualrelname, fout);
+ appendStringLiteralArchive(q, qualrelname, fout);
appendPQExpBufferStr(q, "::pg_catalog.regclass;\n");
}
@@ -16402,7 +16402,7 @@ dumpConstraint(Archive *fout, const ConstraintInfo *coninfo)
if (nonemptyReloptions(indxinfo->indreloptions))
{
appendPQExpBufferStr(q, " WITH (");
- appendReloptionsArrayAH(q, indxinfo->indreloptions, "", fout);
+ appendReloptionsArrayA(q, indxinfo->indreloptions, "", fout);
appendPQExpBufferChar(q, ')');
}
@@ -16910,7 +16910,7 @@ dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo)
resetPQExpBuffer(query);
appendPQExpBufferStr(query, "SELECT pg_catalog.setval(");
- appendStringLiteralAH(query, fmtQualifiedDumpable(tbinfo), fout);
+ appendStringLiteralArchive(query, fmtQualifiedDumpable(tbinfo), fout);
appendPQExpBuffer(query, ", %s, %s);\n",
last, (called ? "true" : "false"));
@@ -17072,7 +17072,7 @@ dumpTrigger(Archive *fout, const TriggerInfo *tginfo)
if (findx > 0)
appendPQExpBufferStr(query, ", ");
- appendStringLiteralAH(query, p, fout);
+ appendStringLiteralArchive(query, p, fout);
p += tlen + 1;
}
free(tgargs);
@@ -17312,7 +17312,7 @@ dumpRule(Archive *fout, const RuleInfo *rinfo)
if (nonemptyReloptions(tbinfo->reloptions))
{
appendPQExpBufferStr(cmd, " WITH (");
- appendReloptionsArrayAH(cmd, tbinfo->reloptions, "", fout);
+ appendReloptionsArrayA(cmd, tbinfo->reloptions, "", fout);
appendPQExpBufferChar(cmd, ')');
}
result = createViewAsClause(fout, tbinfo);
@@ -18187,8 +18187,8 @@ nonemptyReloptions(const char *reloptions)
* "prefix" is prepended to the option names; typically it's "" or "toast.".
*/
static void
-appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
- const char *prefix, Archive *fout)
+appendReloptionsArrayA(PQExpBuffer buffer, const char *reloptions,
+ const char *prefix, Archive *fout)
{
bool res;
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 69ee939d4..427f5d45f 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -705,8 +705,8 @@ extern NamespaceInfo *getNamespaces(Archive *fout, int *numNamespaces);
extern ExtensionInfo *getExtensions(Archive *fout, int *numExtensions);
extern TypeInfo *getTypes(Archive *fout, int *numTypes);
extern FuncInfo *getFuncs(Archive *fout, int *numFuncs);
-extern AggInfo *getAggregates(Archive *fout, int *numAggregates);
-extern OprInfo *getOperators(Archive *fout, int *numOperators);
+extern AggInfo *getAggregates(Archive *fout, int *numAggs);
+extern OprInfo *getOperators(Archive *fout, int *numOprs);
extern AccessMethodInfo *getAccessMethods(Archive *fout, int *numAccessMethods);
extern OpclassInfo *getOpclasses(Archive *fout, int *numOpclasses);
extern OpfamilyInfo *getOpfamilies(Archive *fout, int *numOpfamilies);
@@ -723,7 +723,7 @@ extern void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables);
extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
-extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
+extern void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 69ae027bd..083012ca3 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -72,8 +72,10 @@ static void buildShSecLabels(PGconn *conn,
const char *catalog_name, Oid objectId,
const char *objtype, const char *objname,
PQExpBuffer buffer);
-static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
- const char *pguser, trivalue prompt_password, bool fail_on_error);
+static PGconn *connectDatabase(const char *dbname,
+ const char *connection_string, const char *pghost,
+ const char *pgport, const char *pguser,
+ trivalue prompt_password, bool fail_on_error);
static char *constructConnStr(const char **keywords, const char **values);
static PGresult *executeQuery(PGconn *conn, const char *query);
static void executeCommand(PGconn *conn, const char *query);
--
2.34.1
Peter Geoghegan <pg@bowt.ie> writes:
I would like to give another 24 hours for anybody to lodge final
objections to what I've done in this patch. It seems possible that
there will be concerns about how this might affect backpatching, or
something like that. This patch goes relatively far in the direction
of refactoring to make things consistent at the module level -- unlike
most of the patches, which largely consisted of mechanical adjustments
that were obviously correct, both locally and at the whole-module level.
Yeah. I'm not much on board with the AHX->A and AH->A changes you made;
those seem extremely invasive and it's not real clear that they add a
lot of value.
I've never thought that the Archive vs. ArchiveHandle separation in
pg_dump was very well thought out. I could perhaps get behind a patch
to eliminate that bit of "abstraction"; but I'd still try to avoid
wholesale changes in local-variable names from it. I don't think that
would buy anything that's worth the back-patching pain. Just accepting
that Archive[Handle] variables might be named either AH or AHX depending
on historical accident does not seem that bad to me. We have lots more
and worse naming inconsistencies in our tree.
regards, tom lane
On Thu, Sep 22, 2022 at 2:55 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Yeah. I'm not much on board with the AHX->A and AH->A changes you made;
those seem extremely invasive and it's not real clear that they add a
lot of value.
That makes it easy, then. I'll just take the least invasive approach
possible with pg_dump: treat the names from function definitions as
authoritative, and mechanically adjust the function declarations as
needed to make everything agree.
The commit message for this will note in passing that the
inconsistency that this creates at the header file level is a known
issue.
Thanks
--
Peter Geoghegan
Peter Geoghegan <pg@bowt.ie> writes:
That makes it easy, then. I'll just take the least invasive approach
possible with pg_dump: treat the names from function definitions as
authoritative, and mechanically adjust the function declarations as
needed to make everything agree.
WFM.
regards, tom lane
On Thu, Sep 22, 2022 at 3:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
WFM.
Okay, pushed a minimally invasive commit to fix the inconsistencies in
pg_dump related code just now. That's the last of them. Now the only
remaining clang-tidy warnings about inconsistent parameter names are
those that seem practically impossible to fix (these are mostly just
cases involving flex/bison).
It still seems like a good idea to formally create a new coding
standard around C function parameter names. We really need a simple
clang-tidy workflow to be able to do that. I'll try to get to that
soon. Part of the difficulty there will be finding a way to ignore the
warnings that we really can't do anything about.
Thanks
--
Peter Geoghegan