Some new bits, And some old ones. -- Justin
>From b74bef6f9d36a2fac71045ab707ed4be65730ba7 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <[email protected]> Date: Wed, 29 Apr 2020 13:13:29 -0500 Subject: [PATCH v5 1/5] Fix comments for WITH OIDs, removed at 578b22971
Previously mentioned here: https://www.postgresql.org/message-id/[email protected] --- src/backend/access/common/tupdesc.c | 4 +--- src/backend/access/transam/varsup.c | 3 +-- src/backend/commands/tablecmds.c | 5 ++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index 1e743d7d86..ce84e22cbd 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -786,9 +786,7 @@ TupleDescInitEntryCollation(TupleDesc desc, * * Given a relation schema (list of ColumnDef nodes), build a TupleDesc. * - * Note: the default assumption is no OIDs; caller may modify the returned - * TupleDesc if it wants OIDs. Also, tdtypeid will need to be filled in - * later on. + * tdtypeid will need to be filled in later on. */ TupleDesc BuildDescForRelation(List *schema) diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index e14b53bf9e..8328b8050a 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -527,8 +527,7 @@ GetNewObjectId(void) * The first time through this routine after normal postmaster start, the * counter will be forced up to FirstNormalObjectId. This mechanism * leaves the OIDs between FirstBootstrapObjectId and FirstNormalObjectId - * available for automatic assignment during initdb, while ensuring they - * will never conflict with user-assigned OIDs. + * available for automatic assignment during initdb. */ if (ShmemVariableCache->nextOid < ((Oid) FirstNormalObjectId)) { diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 2ab02e01a0..35945bce73 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -4829,7 +4829,7 @@ ATRewriteTables(AlterTableStmt *parsetree, List **wqueue, LOCKMODE lockmode, continue; /* - * If we change column data types or add/remove OIDs, the operation + * If we change column data types, the operation * has to be propagated to tables that use this table's rowtype as a * column type. tab->newvals will also be non-NULL in the case where * we're adding a column with a default. We choose to forbid that @@ -4853,8 +4853,7 @@ ATRewriteTables(AlterTableStmt *parsetree, List **wqueue, LOCKMODE lockmode, /* * We only need to rewrite the table if at least one column needs to - * be recomputed, we are adding/removing the OID column, or we are - * changing its persistence. + * be recomputed, or we are changing its persistence. * * There are two reasons for requiring a rewrite when changing * persistence: on one hand, we need to ensure that the buffers -- 2.17.0
>From eb85fabed31d7c3a8fa1396ddfd2ea733c5c8baf Mon Sep 17 00:00:00 2001 From: Justin Pryzby <[email protected]> Date: Sun, 10 May 2020 17:30:14 -0500 Subject: [PATCH v5 2/5] Remove mention of double timestamps.. ..which were removed in v10. This was previously discussed here: https://www.postgresql.org/message-id/20191230074721.GM12890%40telsasoft.com --- src/backend/utils/adt/selfuncs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 0f02f32ffd..be08eb4814 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -4018,8 +4018,8 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel, * to be treated separately. * * The several datatypes representing absolute times are all converted - * to Timestamp, which is actually a double, and then we just use that - * double value. Note this will give correct results even for the "special" + * to Timestamp, which is actually an int64, and then we promote that to + * a double. Note this will give correct results even for the "special" * values of Timestamp, since those are chosen to compare correctly; * see timestamp_cmp. * -- 2.17.0
>From c0501535b1ec3709abb8334ddd29f2603bece5ca Mon Sep 17 00:00:00 2001 From: Justin Pryzby <[email protected]> Date: Sun, 3 May 2020 19:57:32 -0500 Subject: [PATCH v5 3/5] possessive: its (and more) --- src/backend/replication/logical/origin.c | 2 +- src/backend/utils/mmgr/README | 2 +- src/bin/pg_dump/pg_backup_archiver.c | 6 +++--- src/bin/pg_dump/pg_backup_custom.c | 8 +++----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index 1ca4479605..dec9e95119 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -427,7 +427,7 @@ restart: /* - * Lookup replication origin via it's oid and return the name. + * Lookup replication origin via its oid and return the name. * * The external name is palloc'd in the calling context. * diff --git a/src/backend/utils/mmgr/README b/src/backend/utils/mmgr/README index e892779cdd..221b4bd343 100644 --- a/src/backend/utils/mmgr/README +++ b/src/backend/utils/mmgr/README @@ -462,7 +462,7 @@ Memory Accounting ----------------- One of the basic memory context operations is determining the amount of -memory used in the context (and it's children). We have multiple places +memory used in the context (and its children). We have multiple places that implement their own ad hoc memory accounting, and this is meant to provide a unified approach. Ad hoc accounting solutions work for places with tight control over the allocations or when it's easy to determine diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 8f0b32ca17..4c91b9e1bc 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -209,14 +209,14 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt) /* * Wrapper functions. * - * The objective it to make writing new formats and dumpers as simple + * The objective is to make writing new formats and dumpers as simple * as possible, if necessary at the expense of extra function calls etc. * */ /* * The dump worker setup needs lots of knowledge of the internals of pg_dump, - * so It's defined in pg_dump.c and passed into OpenArchive. The restore worker + * so it's defined in pg_dump.c and passed into OpenArchive. The restore worker * setup doesn't need to know anything much, so it's defined here. */ static void @@ -1450,7 +1450,7 @@ SortTocFromFile(Archive *AHX) } /********************** - * 'Convenience functions that look like standard IO functions + * Convenience functions that look like standard IO functions * for writing data when in dump mode. **********************/ diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c index 369dcea429..31a03ea3ee 100644 --- a/src/bin/pg_dump/pg_backup_custom.c +++ b/src/bin/pg_dump/pg_backup_custom.c @@ -262,7 +262,6 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) * that includes useful information about the TOC entry. * * Optional. - * */ static void _PrintExtraToc(ArchiveHandle *AH, TocEntry *te) @@ -324,7 +323,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen) * finished. * * Optional. - * */ static void _EndData(ArchiveHandle *AH, TocEntry *te) @@ -529,8 +527,8 @@ _LoadBlobs(ArchiveHandle *AH, bool drop) /* * Skip the BLOBs from the current file position. * BLOBS are written sequentially as data blocks (see below). - * Each BLOB is preceded by it's original OID. - * A zero OID indicated the end of the BLOBS + * Each BLOB is preceded by its original OID. + * A zero OID indicates the end of the BLOBS */ static void _skipBlobs(ArchiveHandle *AH) @@ -548,7 +546,7 @@ _skipBlobs(ArchiveHandle *AH) /* * Skip data from current file position. * Data blocks are formatted as an integer length, followed by data. - * A zero length denoted the end of the block. + * A zero length indicates the end of the block. */ static void _skipData(ArchiveHandle *AH) -- 2.17.0
>From 8f435e9e75c2b7f3c197ffa61b5849fcabf1a040 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <[email protected]> Date: Sun, 3 May 2020 21:22:05 -0500 Subject: [PATCH v5 4/5] typo --- src/backend/replication/logical/relation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c index 02164f8d9b..e1a447e097 100644 --- a/src/backend/replication/logical/relation.c +++ b/src/backend/replication/logical/relation.c @@ -576,7 +576,7 @@ logicalrep_partmap_init(void) * the attribute map, which can be different for the partition. * * Note there's no logicalrep_partition_close, because the caller closes the - * the component relation. + * component relation. */ LogicalRepRelMapEntry * logicalrep_partition_open(LogicalRepRelMapEntry *root, -- 2.17.0
>From e16b432f2b84f8868256dbfe500cd481de8b4504 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <[email protected]> Date: Thu, 23 Apr 2020 21:54:27 -0500 Subject: [PATCH v5 5/5] unused variable found@AttrDefaultFetch().. since: commit 16828d5c0273b4fe5f10f42588005f16b415b2d8 Author: Andrew Dunstan <[email protected]> Date: Wed Mar 28 10:43:52 2018 +1030 Fast ALTER TABLE ADD COLUMN with a non-NULL default --- src/backend/utils/cache/relcache.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 0b9eb00d2d..f964cc7051 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -4240,7 +4240,6 @@ AttrDefaultFetch(Relation relation) HeapTuple htup; Datum val; bool isnull; - int found; int i; ScanKeyInit(&skey, @@ -4251,7 +4250,6 @@ AttrDefaultFetch(Relation relation) adrel = table_open(AttrDefaultRelationId, AccessShareLock); adscan = systable_beginscan(adrel, AttrDefaultIndexId, true, NULL, 1, &skey); - found = 0; while (HeapTupleIsValid(htup = systable_getnext(adscan))) { @@ -4266,8 +4264,6 @@ AttrDefaultFetch(Relation relation) elog(WARNING, "multiple attrdef records found for attr %s of rel %s", NameStr(attr->attname), RelationGetRelationName(relation)); - else - found++; val = fastgetattr(htup, Anum_pg_attrdef_adbin, -- 2.17.0
