Re: Typos in the code and README

2024-09-06 Thread Daniel Gustafsson
> On 4 Sep 2024, at 17:34, David Rowley  wrote:
> 
> On Wed, 4 Sept 2024 at 20:24, Daniel Gustafsson  wrote:
>> Not mandatory at all, but since you were prepping a typo backpatch anyways I
>> figured these could join to put a small dent in reducing risks for future
>> backports.
> 
> I think this is pretty good logic.  I think fixing comment typos in
> ancient code and backpatching to all supported versions isn't good use
> of time, but fixing a typo in "recent" code and backpatching to where
> that code was added seems useful. Newer code is more likely to need
> bug fixes in the future, so going to a bit more effort to make
> backpatching those bug fixes easier seems worth the effort.

Absolutely agree.

> I just don't know what "recent" should be defined as. I'd say if it's in a
> version we've not released yet, that's probably recent. By the time .1
> is out, there's less chance of bugs in new code. Anyway, I doubt hard
> guidelines are warranted here, but maybe some hints about best
> practices in https://wiki.postgresql.org/wiki/Committing_checklist ?

That sounds like a good idea.  Off the cuff I would agree that unreleased
versions and .0 versions are strong candidates (but not mandatory) for trivial
backpatches like typos, beyond that the value is likely to be lower.

--
Daniel Gustafsson





Re: Typos in the code and README

2024-09-04 Thread Michael Paquier
On Thu, Sep 05, 2024 at 03:34:31AM +1200, David Rowley wrote:
> Anyway, I doubt hard
> guidelines are warranted here, but maybe some hints about best
> practices in https://wiki.postgresql.org/wiki/Committing_checklist ?

Yep, that may be useful.  I just tend to be cautious because it can be
very easy to mess up things depending on the code path you're
manipulating, speaking with some..  Experience on the matter.  And an
RC1 is kind of something to be cautious with.
--
Michael


signature.asc
Description: PGP signature


Re: Typos in the code and README

2024-09-04 Thread David Rowley
On Wed, 4 Sept 2024 at 20:24, Daniel Gustafsson  wrote:
> Not mandatory at all, but since you were prepping a typo backpatch anyways I
> figured these could join to put a small dent in reducing risks for future
> backports.

I think this is pretty good logic.  I think fixing comment typos in
ancient code and backpatching to all supported versions isn't good use
of time, but fixing a typo in "recent" code and backpatching to where
that code was added seems useful. Newer code is more likely to need
bug fixes in the future, so going to a bit more effort to make
backpatching those bug fixes easier seems worth the effort.  I just
don't know what "recent" should be defined as. I'd say if it's in a
version we've not released yet, that's probably recent. By the time .1
is out, there's less chance of bugs in new code. Anyway, I doubt hard
guidelines are warranted here, but maybe some hints about best
practices in https://wiki.postgresql.org/wiki/Committing_checklist ?

David




Re: Typos in the code and README

2024-09-04 Thread Daniel Gustafsson
> On 4 Sep 2024, at 03:25, Michael Paquier  wrote:
> 
> On Tue, Sep 03, 2024 at 12:00:13PM +0200, Daniel Gustafsson wrote:
>> I see your v17 typo fixes, and raise you a few more.  Commit 31a98934d169 
>> from
>> just now contains 2 (out of 3) sets of typos introduced in v17 so they should
>> follow along when you push the ones mentioned here.
> 
> Is that really mandatory?  I tend to worry about back branches only
> when this stuff is user-visible, like in the docs or error messages.
> This opinion varies for each individual, of course.  That's just my
> lazy opinion.

Not mandatory at all, but since you were prepping a typo backpatch anyways I
figured these could join to put a small dent in reducing risks for future
backports.

--
Daniel Gustafsson





Re: Typos in the code and README

2024-09-03 Thread Michael Paquier
On Tue, Sep 03, 2024 at 12:00:13PM +0200, Daniel Gustafsson wrote:
> I see your v17 typo fixes, and raise you a few more.  Commit 31a98934d169 from
> just now contains 2 (out of 3) sets of typos introduced in v17 so they should
> follow along when you push the ones mentioned here.

Is that really mandatory?  I tend to worry about back branches only
when this stuff is user-visible, like in the docs or error messages.
This opinion varies for each individual, of course.  That's just my
lazy opinion.

CommitTSSLRU -> CommitTsSLRU is user-visible, showing up in
pg_stat_activity.  Fixed this one with 08b9b9e043bb, as the tag for
17rc1 has been pushed.

Picking f747bc18f7f2 and 75c5231a00f3 on REL_17_STABLE leads to the
attached, I think, without the conflicts.
--
Michael
From f747bc18f7f205795177cce6a93e19169bd0467f Mon Sep 17 00:00:00 2001
From: Michael Paquier 
Date: Tue, 3 Sep 2024 14:49:04 +0900
Subject: [PATCH 1/2] Fix typos and grammar in code comments and docs

Author: Alexander Lakhin
Discussion: https://postgr.es/m/f7e514cf-2446-21f1-a5d2-8c089a6e2...@gmail.com
---
 src/include/utils/injection_point.h| 2 +-
 src/backend/access/transam/multixact.c | 2 +-
 src/backend/executor/execExprInterp.c  | 2 +-
 src/backend/replication/logical/slotsync.c | 2 +-
 src/backend/storage/aio/read_stream.c  | 2 +-
 src/backend/storage/lmgr/lock.c| 2 +-
 src/bin/pg_combinebackup/t/008_promote.pl  | 4 ++--
 src/bin/psql/common.c  | 2 +-
 src/interfaces/libpq/fe-connect.c  | 2 +-
 src/test/subscription/t/021_twophase.pl| 2 +-
 contrib/test_decoding/specs/skip_snapshot_restore.spec | 2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/include/utils/injection_point.h b/src/include/utils/injection_point.h
index 6e417cedc6..8041e4fe0f 100644
--- a/src/include/utils/injection_point.h
+++ b/src/include/utils/injection_point.h
@@ -12,7 +12,7 @@
 #define INJECTION_POINT_H
 
 /*
- * Injections points require --enable-injection-points.
+ * Injection points require --enable-injection-points.
  */
 #ifdef USE_INJECTION_POINTS
 #define INJECTION_POINT(name) InjectionPointRun(name)
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index b7b47ef076..42ea9ba5b4 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2009,7 +2009,7 @@ check_multixact_offset_buffers(int *newval, void **extra, GucSource source)
 }
 
 /*
- * GUC check_hook for multixact_member_buffer
+ * GUC check_hook for multixact_member_buffers
  */
 bool
 check_multixact_member_buffers(int *newval, void **extra, GucSource source)
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c
index c32ac7c509..ff76e10bd3 100644
--- a/src/backend/executor/execExprInterp.c
+++ b/src/backend/executor/execExprInterp.c
@@ -4626,7 +4626,7 @@ ExecEvalJsonCoercionFinish(ExprState *state, ExprEvalStep *op)
 	if (SOFT_ERROR_OCCURRED(&jsestate->escontext))
 	{
 		/*
-		 * jsestate->error or jsetate->empty being set means that the error
+		 * jsestate->error or jsestate->empty being set means that the error
 		 * occurred when coercing the JsonBehavior value.  Throw the error in
 		 * that case with the actual coercion error message shown in the
 		 * DETAIL part.
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index ebfbaebe16..fe0478e373 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -83,7 +83,7 @@
  * this flag is set. Note that we don't need to reset this variable as after
  * promotion the slot sync worker won't be restarted because the pmState
  * changes to PM_RUN from PM_HOT_STANDBY and we don't support demoting
- * primary without restarting the server. See MaybeStartSlotSyncWorker.
+ * primary without restarting the server. See LaunchMissingBackgroundProcesses.
  *
  * The 'syncing' flag is needed to prevent concurrent slot syncs to avoid slot
  * overwrites.
diff --git a/src/backend/storage/aio/read_stream.c b/src/backend/storage/aio/read_stream.c
index a6c50b2ae2..f04c788a46 100644
--- a/src/backend/storage/aio/read_stream.c
+++ b/src/backend/storage/aio/read_stream.c
@@ -450,7 +450,7 @@ read_stream_begin_relation(int flags,
 	queue_size = max_pinned_buffers + 1;
 
 	/*
-	 * Allocate the object, the buffers, the ios and per_data_data space in
+	 * Allocate the object, the buffers, the ios and per_buffer_data space in
 	 * one big chunk.  Though we have queue_size buffers, we want to be able
 	 * to assume that all the buffers for a single read are contiguous (i.e.
 	 * don't wrap around halfway through), so we allow temporary overflows of
diff --git a/src/backend/storage/lmgr/loc

Re: Typos in the code and README

2024-09-03 Thread Daniel Gustafsson
> On 3 Sep 2024, at 07:51, Michael Paquier  wrote:
> 
> On Tue, Sep 03, 2024 at 02:24:32PM +0900, Michael Paquier wrote:
>> On Mon, Sep 02, 2024 at 09:00:00PM +0300, Alexander Lakhin wrote:
>>> I've gathered another bunch of defects with the possible substitutions.
>>> Please take a look:
>>> pgstat_add_kind -> pgstat_register_kind (see 7949d9594)
>> 
>> And here I thought I took care of these inconsistencies.  This one is
>> on me so I'll go fix that in a bit, with the rest while on it.
> 
> And done that.
> 
> The bit about CommitTSSLRU -> CommitTsSLRU in lwlock.c should be
> backpatched down to 17, indeed, but the branch is frozen until the RC
> tag lands in the tree, so I have left it out for now. The tag should
> show up tomorrow or so.  Good thing that you have noticed this issue
> before the release.

I see your v17 typo fixes, and raise you a few more.  Commit 31a98934d169 from
just now contains 2 (out of 3) sets of typos introduced in v17 so they should
follow along when you push the ones mentioned here.

--
Daniel Gustafsson





Re: Typos in the code and README

2024-09-02 Thread Michael Paquier
On Tue, Sep 03, 2024 at 02:24:32PM +0900, Michael Paquier wrote:
> On Mon, Sep 02, 2024 at 09:00:00PM +0300, Alexander Lakhin wrote:
> > I've gathered another bunch of defects with the possible substitutions.
> > Please take a look:
> > pgstat_add_kind -> pgstat_register_kind (see 7949d9594)
> 
> And here I thought I took care of these inconsistencies.  This one is
> on me so I'll go fix that in a bit, with the rest while on it.

And done that.

The bit about CommitTSSLRU -> CommitTsSLRU in lwlock.c should be
backpatched down to 17, indeed, but the branch is frozen until the RC
tag lands in the tree, so I have left it out for now. The tag should
show up tomorrow or so.  Good thing that you have noticed this issue
before the release.
--
Michael


signature.asc
Description: PGP signature


Re: Typos in the code and README

2024-09-02 Thread Michael Paquier
On Mon, Sep 02, 2024 at 09:00:00PM +0300, Alexander Lakhin wrote:
> I've gathered another bunch of defects with the possible substitutions.
> Please take a look:
> pgstat_add_kind -> pgstat_register_kind (see 7949d9594)

And here I thought I took care of these inconsistencies.  This one is
on me so I'll go fix that in a bit, with the rest while on it.
--
Michael


signature.asc
Description: PGP signature


Re: Typos in the code and README

2024-09-02 Thread Alexander Lakhin

Hello,

12.08.2024 14:59, David Rowley wrote:

(I know Daniel mentioned he'd get to these, but the ScanDirection one
was my fault and I needed to clear that off my mind. I did a few
others while on this topic.)


Thank you, David, for working on that!

I've gathered another bunch of defects with the possible substitutions.
Please take a look:
adapated -> adapted

becasue -> because

cancelled -> canceled (introduced by 90f517821, but see 8c9da1441)

cange -> change

comand -> command

CommitTSSLRU -> CommitTsSLRU (introduced by 53c2a97a9; maybe the fix
 should be back-patched...)

connectOptions2 -> pqConnectOptions2 (see 774bcffe4)

Injections points -> Injection points

jsetate -> jsestate

LockShmemSize -> remove the sentence? (added by ec0baf949, outdated with
 a794fb068)

MaybeStartSlotSyncWorker -> LaunchMissingBackgroundProcesses (the logic to
 start B_SLOTSYNC_WORKER moved from the former to the latter function with
 3354f8528)

multixact_member_buffer -> multixact_member_buffers

per_data_data -> per_buffer_data (see code below the comment; introduced by
 b5a9b18cd)

per_buffer_private -> remove the function declaration? (the duplicate
 declaration was added by a858be17c)

performancewise -> performance-wise? (coined by a7f107df2)

pgstat_add_kind -> pgstat_register_kind (see 7949d9594)

pg_signal_autovacuum -> pg_signal_autovacuum_worker (see d2b74882c)

recoveery -> recovery

RegisteredWorker -> RegisteredBgWorker

RUNNING_XACT -> RUNNING_XACTS

sanpshot -> snapshot

TypeEntry -> TypeCacheEntry (align with AttoptCacheEntry, from the same
 commit 40064a8ee)

The corresponding patch is attached for your convenience.

Best regards,
Alexanderdiff --git a/contrib/test_decoding/specs/skip_snapshot_restore.spec b/contrib/test_decoding/specs/skip_snapshot_restore.spec
index 3f1fb6f02c7..7b35dbcc9f3 100644
--- a/contrib/test_decoding/specs/skip_snapshot_restore.spec
+++ b/contrib/test_decoding/specs/skip_snapshot_restore.spec
@@ -39,7 +39,7 @@ step "s2_get_changes_slot0" { SELECT data FROM pg_logical_slot_get_changes('slot
 # serializes consistent snapshots to the disk at LSNs where are before
 # s0-transaction's commit. After s0-transaction commits, "s1_init" resumes but
 # must not restore any serialized snapshots and will reach the consistent state
-# when decoding a RUNNING_XACT record generated after s0-transaction's commit.
+# when decoding a RUNNING_XACTS record generated after s0-transaction's commit.
 # We check if the get_changes on 'slot1' will not return any s0-transaction's
 # changes as its confirmed_flush_lsn will be after the s0-transaction's commit
 # record.
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index 9bc23a9a938..af7864a1b5b 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -3891,8 +3891,8 @@ static const PgStat_KindInfo custom_stats = {
  it with pgstat_register_kind and a unique ID used to
  store the entries related to this type of statistics:
 
-extern PgStat_Kind pgstat_add_kind(PgStat_Kind kind,
-   const PgStat_KindInfo *kind_info);
+extern PgStat_Kind pgstat_register_kind(PgStat_Kind kind,
+const PgStat_KindInfo *kind_info);
 
  While developing a new extension, use
  PGSTAT_KIND_EXPERIMENTAL for
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index a03d56541d0..8c37d7eba76 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2017,7 +2017,7 @@ check_multixact_offset_buffers(int *newval, void **extra, GucSource source)
 }
 
 /*
- * GUC check_hook for multixact_member_buffer
+ * GUC check_hook for multixact_member_buffers
  */
 bool
 check_multixact_member_buffers(int *newval, void **extra, GucSource source)
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c
index 91f0fd6ea3e..b2457f121a7 100644
--- a/src/backend/commands/matview.c
+++ b/src/backend/commands/matview.c
@@ -382,7 +382,7 @@ RefreshMatViewByOid(Oid matviewOid, bool is_create, bool skipData,
 	 * command tag is left false in cmdtaglist.h. Otherwise, the change of
 	 * completion tag output might break applications using it.
 	 *
-	 * When called from CREATE MATERIALIZED VIEW comand, the rowcount is
+	 * When called from CREATE MATERIALIZED VIEW command, the rowcount is
 	 * displayed with the command tag CMDTAG_SELECT.
 	 */
 	if (qc)
diff --git a/src/backend/commands/waitlsn.c b/src/backend/commands/waitlsn.c
index d9cf9e7d75e..d7065726749 100644
--- a/src/backend/commands/waitlsn.c
+++ b/src/backend/commands/waitlsn.c
@@ -369,7 +369,7 @@ pg_wal_replay_wait(PG_FUNCTION_ARGS)
 	 */
 	InvalidateCatalogSnapshot();
 
-	/* Give up if there is still an active or registered sanpshot. */
+	/* Give up if there is still an active or registered snapshot. */
 	if (GetOldestSnapshot())
 		ereport(ERROR,
 (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
diff --git a/src/backe

Re: Typos in the code and README

2024-08-12 Thread David Rowley
(I know Daniel mentioned he'd get to these, but the ScanDirection one
was my fault and I needed to clear that off my mind. I did a few
others while on this topic.)

On Fri, 5 Jul 2024 at 05:00, Alexander Lakhin  wrote:
> Please look at another bunch of inconsistencies/orphaned entities I found
> in the tree, with the possible substitutions:
> errmsg_buf -> errormsg_buf
> (coined by 6b18b3fe2)

Fixed.

> NoMovementScanDirectionScans -> NoMovementScanDirection
> (introduced with e9aaf0632, discussed in [1], but still seems inaccurate)

Oops. Fixed.

> XLogReadRecordInternal -> XLogReadRecord
> (from 3f1ce9734, align with a comment above: "Start and end point of last
> record returned by XLogReadRecord().")

Fixed.

> BYPASS_ALLOWCONN -> BGWORKER_BYPASS_ROLELOGINCHECK (see 492217301)

Fixed

> xs_ctup.t_self -> xs_heaptid (see c2fe139c2 and 304532421)

Fixed.

> pgStatShmLookupCache -> pgStatLocal.shmem (coined by 5891c7a8e)

Fixed.

> smgr_fsm_nblocks and smgr_vm_nblocks -> smgr_cached_nblocks
> (see the same comment updated by c5315f4f4)

Heikki fixed in 19de089cd.

> XID becomes older than GlobalXmin -> XID becomes visible to everyone
> (in accordance with dc7420c2c9 src/backend/access/gist/gistutil.c)

I'd need to spend more time to understand this.

> gen-rtab - remove (non-existing since db7d1a7b0)

Daniel fixed in cc59f9d0f.

> BARRIER_SHOULD_CHECK - remove (unused since a3ed4d1ef)

I wasn't sure if nothing else external could be using this. The macro
doesn't use any fields that are now gone, so I'm not confident enough
to remove it. Can Robert confirm?

> EXE_EXT - remove (unused since f06b1c598)

Daniel fixed in 88e3da565.

> endterm - remove
> (see 60c90c16c -- Use xreflabel attributes instead of endterm ...)

I read that commit message and I agree it's now unused. I just didn't
get any vibes from the commit message that it shouldn't ever be used
again.  Can Tom confirm?

> xl_commit_ts_set, SizeOfCommitTsSet - remove (unused since 08aa89b32)

I would say it should be removed.  I just didn't because the commit I
had pending fitted into the "typos" category and this didn't quite
fit.

I've attached a patch with the remainder.

David


remaining_typos.patch
Description: Binary data


Re: Typos in the code and README

2024-07-25 Thread Daniel Gustafsson
> On 4 Jul 2024, at 19:00, Alexander Lakhin  wrote:

> Please look at another bunch of inconsistencies/orphaned entities I found
> in the tree, with the possible substitutions:

Thanks for these, and sorry for the delay in processing them (summer happened
etc).  I've started to go through them and have applied some low-hanging fruit
already, will go over all them.

--
Daniel Gustafsson





Re: Typos in the code and README

2024-07-04 Thread Alexander Lakhin

Hello hackers,

03.05.2024 17:36, David Rowley wrote:

I pushed the patch after only adjusting the path in the docs which had
"module" rather than "modules".


Please look at another bunch of inconsistencies/orphaned entities I found
in the tree, with the possible substitutions:
errmsg_buf -> errormsg_buf
(coined by 6b18b3fe2)

NoMovementScanDirectionScans -> NoMovementScanDirection
(introduced with e9aaf0632, discussed in [1], but still seems inaccurate)

XLogReadRecordInternal -> XLogReadRecord
(from 3f1ce9734, align with a comment above: "Start and end point of last
record returned by XLogReadRecord().")

BYPASS_ALLOWCONN -> BGWORKER_BYPASS_ROLELOGINCHECK (see 492217301)

xs_ctup.t_self -> xs_heaptid (see c2fe139c2 and 304532421)

pgStatShmLookupCache -> pgStatLocal.shmem (coined by 5891c7a8e)

smgr_fsm_nblocks and smgr_vm_nblocks -> smgr_cached_nblocks
(see the same comment updated by c5315f4f4)

XID becomes older than GlobalXmin -> XID becomes visible to everyone
(in accordance with dc7420c2c9 src/backend/access/gist/gistutil.c)

gen-rtab - remove (non-existing since db7d1a7b0)

BARRIER_SHOULD_CHECK - remove (unused since a3ed4d1ef)

EXE_EXT - remove (unused since f06b1c598)

endterm - remove
(see 60c90c16c -- Use xreflabel attributes instead of endterm ...)

xl_commit_ts_set, SizeOfCommitTsSet - remove (unused since 08aa89b32)

The corresponding patch is attached for your convenience.

[1] 
https://www.postgresql.org/message-id/20230131140224.7j6gbcsfwmad2a4b%40liskov

Best regards,
Alexanderdiff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile
index 5efa10c334..85f1c94681 100644
--- a/contrib/pgcrypto/Makefile
+++ b/contrib/pgcrypto/Makefile
@@ -45,8 +45,6 @@ REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
 	pgp-armor pgp-decrypt pgp-encrypt pgp-encrypt-md5 $(CF_PGP_TESTS) \
 	pgp-pubkey-decrypt pgp-pubkey-encrypt pgp-info
 
-EXTRA_CLEAN = gen-rtab
-
 ifdef USE_PGXS
 PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
diff --git a/doc/src/sgml/README.links b/doc/src/sgml/README.links
index 65df9c111f..900e0308b6 100644
--- a/doc/src/sgml/README.links
+++ b/doc/src/sgml/README.links
@@ -15,10 +15,6 @@ Intra-document Linking
 linkend=
 	controls the target of the link/xref, required
 
-endterm=
-	for , allows the text of the link/xref to be taken from a
-	different link target title
-
 
 	use to supply text for the link, only uses linkend, requires 
 	http://www.oasis-open.org/docbook/documentation/reference/html/link.html
diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c
index 24fb94f473..59372783d0 100644
--- a/src/backend/access/gist/gistvacuum.c
+++ b/src/backend/access/gist/gistvacuum.c
@@ -643,7 +643,7 @@ gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
 	 * The page cannot be immediately recycled, because in-progress scans that
 	 * saw the downlink might still visit it.  Mark the page with the current
 	 * next-XID counter, so that we know when it can be recycled.  Once that
-	 * XID becomes older than GlobalXmin, we know that all scans that are
+	 * XID becomes visible to everyone, we know that all scans that are
 	 * currently in progress must have ended.  (That's much more conservative
 	 * than needed, but let's keep it safe and simple.)
 	 */
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 37d2a57961..45bc17e7f4 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -946,7 +946,7 @@ err:
 	XLogReaderInvalReadState(state);
 
 	/*
-	 * If an error was written to errmsg_buf, it'll be returned to the caller
+	 * If an error was written to errormsg_buf, it'll be returned to the caller
 	 * of XLogReadRecord() after all successfully decoded records from the
 	 * read queue.
 	 */
diff --git a/src/backend/executor/execCurrent.c b/src/backend/executor/execCurrent.c
index 70c62ac110..5285b84d30 100644
--- a/src/backend/executor/execCurrent.c
+++ b/src/backend/executor/execCurrent.c
@@ -200,7 +200,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
 			/*
 			 * For IndexOnlyScan, the tuple stored in ss_ScanTupleSlot may be
 			 * a virtual tuple that does not have the ctid column, so we have
-			 * to get the TID from xs_ctup.t_self.
+			 * to get the TID from xs_heaptid.
 			 */
 			IndexScanDesc scan = ((IndexOnlyScanState *) scanstate)->ioss_ScanDesc;
 
diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/storage/ipc/procsignal.c
index 4ed9cedcdd..d9a84b66e0 100644
--- a/src/backend/storage/ipc/procsignal.c
+++ b/src/backend/storage/ipc/procsignal.c
@@ -88,10 +88,6 @@ typedef struct
  */
 #define NumProcSignalSlots	(MaxBackends + NUM_AUXILIARY_PROCS)
 
-/* Check whether the relevant type bit is set in the flags. */
-#define BARRIER_SHOULD_CHECK(flags, type) \
-	(((flags) & (((uint32) 1) << (uint32) (type))) != 0)
-
 /* Clear the relevant type bit from the flags. */
 #define BARRIER_CLEAR_BIT(flags, type

Re: Typos in the code and README

2024-05-03 Thread David Rowley
On Fri, 3 May 2024 at 00:00, Alexander Lakhin  wrote:
> (some of them are located in doc/, so it's not a code-only change)
> I've attached the patch for your convenience, though maybe some
> of the suggestions are to be discarded.

Thanks. I was hoping you'd do that.

I pushed the patch after only adjusting the path in the docs which had
"module" rather than "modules".

David




Re: Typos in the code and README

2024-05-02 Thread Alexander Lakhin

Hello,

28.04.2024 11:05, David Rowley wrote:


On Sat, 20 Apr 2024 at 16:09, David Rowley  wrote:

Here are a few more to see if it motivates anyone else to do a more
thorough search for another batch.

I've pushed these now.


Please look also at the list of other typos and inconsistencies I've found
on the master branch:
additional_notnulls -> old_notnulls (cf. b0e96f311)
ATAddCheckConstraint ->? ATAddCheckNNConstraint (cf. b0e96f311)
bt_page_check -> bt_target_page_check (cf. 5ae208720)
calblack_arg -> callback_arg
combinig -> combining
compaining -> complaining
ctllock - remove (cf. 53c2a97a9)
dabatase -> database
eval_const_exprs_mutator -> eval_const_expressions_mutator
ExecEndValuesScan - remove (cf. d060e921e)
get_json_nested_columns -> get_json_table_nested_columns
io_direct -> debug_io_direct
iS ->? IS (a neatnik-ism)
joing ->? join (cf. 20f90a0e4)
_jumbleRangeTblEntry - remove (cf. 367c989cd)
Mallroy -> Mallory
onstead -> instead
procedual -> procedural
psql_safe -> safe_psql
read_quoted_pattern -> read_quoted_string
repertiore -> repertoire
rightfirstdataoffset ->? rightfirstoffset (cf. 5ae208720)
Sincle ->? Since (perhaps the whole sentence could be rephrased)
sslnegotition=direct/requiredirectwould -> sslnegotiation=direct/requiredirect 
would
sslnegotitation -> sslnegotiation
walreciever -> walreceiver
xid_wrapround -> xid_wraparound

(some of them are located in doc/, so it's not a code-only change)
I've attached the patch for your convenience, though maybe some
of the suggestions are to be discarded.

Best regards,
Alexanderdiff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c
index 20da4a46ba..70f65b645a 100644
--- a/contrib/amcheck/verify_nbtree.c
+++ b/contrib/amcheck/verify_nbtree.c
@@ -1086,7 +1086,7 @@ bt_entry_unique_check(BtreeCheckState *state, IndexTuple itup,
 
 	/*
 	 * Current tuple has no posting list. If TID is visible save info about it
-	 * for the next comparisons in the loop in bt_page_check(). Report
+	 * for the next comparisons in the loop in bt_target_page_check(). Report
 	 * duplicate if lVis_tid is already valid.
 	 */
 	else
@@ -1953,7 +1953,7 @@ bt_target_page_check(BtreeCheckState *state)
  * Note that !readonly callers must reverify that target page has not
  * been concurrently deleted.
  *
- * Save rightfirstdataoffset for detailed error message.
+ * Save rightfirstoffset for detailed error message.
  */
 static BTScanInsert
 bt_right_page_check_scankey(BtreeCheckState *state, OffsetNumber *rightfirstoffset)
diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml
index d7e78204ad..f4b00399e4 100644
--- a/doc/src/sgml/regress.sgml
+++ b/doc/src/sgml/regress.sgml
@@ -331,7 +331,7 @@ make check-world PG_TEST_EXTRA='kerberos ldap ssl load_balance libpq_encryption'
  xid_wraparound
  
   
-   Runs the test suite under src/test/module/xid_wrapround.
+   Runs the test suite under src/test/module/xid_wraparound.
Not enabled by default because it is resource intensive.
   
  
diff --git a/doc/src/sgml/targets-meson.txt b/doc/src/sgml/targets-meson.txt
index 1c42dd3028..bd470c87a7 100644
--- a/doc/src/sgml/targets-meson.txt
+++ b/doc/src/sgml/targets-meson.txt
@@ -11,7 +11,7 @@ Code Targets:
   backend   Build backend and related modules
   bin   Build frontend binaries
   contrib   Build contrib modules
-  plBuild procedual languages
+  plBuild procedural languages
 
 Developer Targets:
   reformat-dat-filesRewrite catalog data files into standard format
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index bf28400dd8..d0f3848c95 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -2598,7 +2598,7 @@ _brin_parallel_heapscan(BrinBuildState *state)
  *
  * After waiting for all workers to finish, merge the per-worker results into
  * the complete index. The results from each worker are sorted by block number
- * (start of the page range). While combinig the per-worker results we merge
+ * (start of the page range). While combining the per-worker results we merge
  * summaries for the same page range, and also fill-in empty summaries for
  * ranges without any tuples.
  *
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index f99ec38a4a..77b05cc0a7 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -228,7 +228,6 @@ SimpleLruAutotuneBuffers(int divisor, int max)
  * name: name of SLRU.  (This is user-visible, pick with care!)
  * nslots: number of page slots to use.
  * nlsns: number of LSN groups per page (set to zero if not relevant).
- * ctllock: LWLock to use to control access to the shared control structure.
  * subdir: PGDATA-rela

Re: Typos in the code and README

2024-04-28 Thread David Rowley
On Sat, 20 Apr 2024 at 16:09, David Rowley  wrote:
> Here are a few more to see if it motivates anyone else to do a more
> thorough search for another batch.

I've pushed these now.

David




Re: Typos in the code and README

2024-04-19 Thread David Rowley
On Fri, 19 Apr 2024 at 20:13, Daniel Gustafsson  wrote:
> Thanks, I incorporated these into 0001 before pushing.  All the commits in 
> this
> patchset are now applied.

Here are a few more to see if it motivates anyone else to do a more
thorough search for another batch.

Fixes duplicate words spanning multiple lines plus an outdated
reference to "streaming read" which was renamed to "read stream" late
in that patch's development.

duplicate words found using:
ag "\s([a-zA-Z]{2,})[\s*]*\n\1\b"
ag "\s([a-zA-Z]{2,})\n(\s*\*\s*)\1\b"

David
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 4a4cf76269..32e7d3c146 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -1122,7 +1122,7 @@ heap_beginscan(Relation relation, Snapshot snapshot,
/*
 * Set up a read stream for sequential scans and TID range scans. This
 * should be done after initscan() because initscan() allocates the
-* BufferAccessStrategy object passed to the streaming read API.
+* BufferAccessStrategy object passed to the read stream API.
 */
if (scan->rs_base.rs_flags & SO_TYPE_SEQSCAN ||
scan->rs_base.rs_flags & SO_TYPE_TIDRANGESCAN)
diff --git a/src/backend/access/heap/vacuumlazy.c 
b/src/backend/access/heap/vacuumlazy.c
index de109acc89..0c5379666b 100644
--- a/src/backend/access/heap/vacuumlazy.c
+++ b/src/backend/access/heap/vacuumlazy.c
@@ -13,7 +13,7 @@
  * autovacuum_work_mem) memory space to keep track of dead TIDs.  If the
  * TID store is full, we must call lazy_vacuum to vacuum indexes (and to vacuum
  * the pages that we've pruned). This frees up the memory space dedicated to
- * to store dead TIDs.
+ * store dead TIDs.
  *
  * In practice VACUUM will often complete its initial pass over the target
  * heap relation without ever running out of space to store TIDs.  This means
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index 4548a91723..a2510cf80c 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -108,7 +108,7 @@
  * (if one exists).
  *
  * activeSearchPath is always the actually active path; it points to
- * to baseSearchPath which is the list derived from namespace_search_path.
+ * baseSearchPath which is the list derived from namespace_search_path.
  *
  * If baseSearchPathValid is false, then baseSearchPath (and other derived
  * variables) need to be recomputed from namespace_search_path, or retrieved
diff --git a/src/backend/replication/logical/slotsync.c 
b/src/backend/replication/logical/slotsync.c
index cb39adcd0e..ed8104ccb4 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -601,7 +601,7 @@ update_and_persist_local_synced_slot(RemoteSlot 
*remote_slot, Oid remote_dbid)
  * metadata of the slot as per the data received from the primary server.
  *
  * The slot is created as a temporary slot and stays in the same state until 
the
- * the remote_slot catches up with locally reserved position and local slot is
+ * remote_slot catches up with locally reserved position and local slot is
  * updated. The slot is then persisted and is considered as sync-ready for
  * periodic syncs.
  *
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index 100f6454e5..a691aed1f4 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -244,7 +244,7 @@ smgropen(RelFileLocator rlocator, ProcNumber backend)
 
 /*
  * smgrpin() -- Prevent an SMgrRelation object from being destroyed at end of
- * of transaction
+ * transaction
  */
 void
 smgrpin(SMgrRelation reln)


Re: Typos in the code and README

2024-04-19 Thread Daniel Gustafsson
> On 16 Apr 2024, at 15:37, Nazir Bilal Yavuz  wrote:

> I realized two small typos: 'sgmr' -> 'smgr'. You may want to include
> them in 0001.

Thanks, I incorporated these into 0001 before pushing.  All the commits in this
patchset are now applied.

--
Daniel Gustafsson





Re: Typos in the code and README

2024-04-16 Thread Nazir Bilal Yavuz
Hi,

Thanks for working on this!

On Mon, 15 Apr 2024 at 15:26, Daniel Gustafsson  wrote:
>
> > On 14 Apr 2024, at 13:19, David Rowley  wrote:
> >
> > On Sat, 13 Apr 2024 at 09:17, Daniel Gustafsson  wrote:
> >>
> >>> On 12 Apr 2024, at 23:15, Heikki Linnakangas  wrote:
> >>> Here's a few more. I've accumulate these over the past couple of months, 
> >>> keeping them stashed in a branch, adding to it whenever I've spotted a 
> >>> minor typo while reading the code.
> >>
> >> Nice, let's lot all these together.
> >
> > Here are a few additional ones to add to that.
>
> Thanks.  Collecting all the ones submitted here, as well as a few submitted
> off-list by Alexander, the patch is now a 3-part patchset of cleanups:
>
> 0001 contains the typos and duplicate words fixups, 0002 fixes a parameter 
> with
> the wrong name in the prototype and 0003 removes a leftover prototype which 
> was
> accidentally left in a refactoring.

I realized two small typos: 'sgmr' -> 'smgr'. You may want to include
them in 0001.

-- 
Regards,
Nazir Bilal Yavuz
Microsoft




Re: Typos in the code and README

2024-04-16 Thread Richard Guo
On Mon, Apr 15, 2024 at 8:26 PM Daniel Gustafsson  wrote:

> Thanks.  Collecting all the ones submitted here, as well as a few submitted
> off-list by Alexander, the patch is now a 3-part patchset of cleanups:
>
> 0001 contains the typos and duplicate words fixups, 0002 fixes a parameter
> with
> the wrong name in the prototype and 0003 removes a leftover prototype
> which was
> accidentally left in a refactoring.


BTW, it seems that 0001 needs a rebase over 9dfcac8e15.

Thanks
Richard


Re: Typos in the code and README

2024-04-15 Thread Daniel Gustafsson
> On 14 Apr 2024, at 13:19, David Rowley  wrote:
> 
> On Sat, 13 Apr 2024 at 09:17, Daniel Gustafsson  wrote:
>> 
>>> On 12 Apr 2024, at 23:15, Heikki Linnakangas  wrote:
>>> Here's a few more. I've accumulate these over the past couple of months, 
>>> keeping them stashed in a branch, adding to it whenever I've spotted a 
>>> minor typo while reading the code.
>> 
>> Nice, let's lot all these together.
> 
> Here are a few additional ones to add to that.

Thanks.  Collecting all the ones submitted here, as well as a few submitted
off-list by Alexander, the patch is now a 3-part patchset of cleanups:

0001 contains the typos and duplicate words fixups, 0002 fixes a parameter with
the wrong name in the prototype and 0003 removes a leftover prototype which was
accidentally left in a refactoring.

--
Daniel Gustafsson



v2-0003-Remove-unused-function-prototype.patch
Description: Binary data


v2-0002-Fix-incorrect-parameter-name-in-prototype.patch
Description: Binary data


v2-0001-Fix-typos-and-duplicate-words-in-comments.patch
Description: Binary data


Re: Typos in the code and README

2024-04-14 Thread David Rowley
On Sat, 13 Apr 2024 at 09:17, Daniel Gustafsson  wrote:
>
> > On 12 Apr 2024, at 23:15, Heikki Linnakangas  wrote:
> > Here's a few more. I've accumulate these over the past couple of months, 
> > keeping them stashed in a branch, adding to it whenever I've spotted a 
> > minor typo while reading the code.
>
> Nice, let's lot all these together.

Here are a few additional ones to add to that.

Found with a manual trawl through git grep -E
'\b([a-zA-Z]{2,}[^long|^that])\s+\1\b' -- ':!*.po' ':!*.dat'

David
diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c
index f71f1854e0..20da4a46ba 100644
--- a/contrib/amcheck/verify_nbtree.c
+++ b/contrib/amcheck/verify_nbtree.c
@@ -3036,7 +3036,7 @@ bt_normalize_tuple(BtreeCheckState *state, IndexTuple 
itup)
 * In the heap, tuples may contain short varlena datums with both 1B
 * header and 4B headers.  But the corresponding index tuple should 
always
 * have such varlena's with 1B headers.  So, if there is a short varlena
-* with 4B header, we need to convert it for for fingerprinting.
+* with 4B header, we need to convert it for fingerprinting.
 *
 * Note that we rely on deterministic index_form_tuple() TOAST 
compression
 * of normalized input.
diff --git a/src/backend/access/nbtree/nbtutils.c 
b/src/backend/access/nbtree/nbtutils.c
index 2eff34c4aa..725811034f 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -1756,7 +1756,7 @@ _bt_start_prim_scan(IndexScanDesc scan, ScanDirection dir)
  *
  * (The rules are the same for backwards scans, except that the operators are
  * flipped: just replace the precondition's >= operator with a <=, and the
- * postcondition's <= operator with with a >=.  In other words, just swap the
+ * postcondition's <= operator with a >=.  In other words, just swap the
  * precondition with the postcondition.)
  *
  * We also deal with "advancing" non-required arrays here.  Callers whose
diff --git a/src/backend/partitioning/partbounds.c 
b/src/backend/partitioning/partbounds.c
index c0c49b0a0b..af3b1a90d2 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -5145,7 +5145,7 @@ get_partition_bound_spec(Oid partOid, RangeVar *name)
  * the first of new partitions) then lower bound of "spec" should be equal (or
  * greater than or equal in case defaultPart=true) to lower bound of split
  * partition. If last=true (this means that "spec" is the last of new
- * partitions) then upper bound of of "spec" should be equal (or less than or
+ * partitions) then upper bound of "spec" should be equal (or less than or
  * equal in case defaultPart=true) to upper bound of split partition.
  *
  * parent: partitioned table
@@ -5244,7 +5244,7 @@ check_partition_bounds_for_split_range(Relation parent,

  false, split_upper);
 
/*
-* Upper bound of of "spec" should be equal (or less 
than or equal
+* Upper bound of "spec" should be equal (or less than 
or equal
 * in case defaultPart=true) to upper bound of split 
partition.
 */
if ((!defaultPart && cmpval) || (defaultPart && cmpval 
> 0))
diff --git a/src/backend/storage/aio/read_stream.c 
b/src/backend/storage/aio/read_stream.c
index f54dacdd91..634cf4f0d1 100644
--- a/src/backend/storage/aio/read_stream.c
+++ b/src/backend/storage/aio/read_stream.c
@@ -541,9 +541,9 @@ read_stream_begin_relation(int flags,
stream->distance = 1;
 
/*
-* Since we always always access the same relation, we can initialize
-* parts of the ReadBuffersOperation objects and leave them that way, to
-* avoid wasting CPU cycles writing to them for each read.
+* Since we always access the same relation, we can initialize parts of
+* the ReadBuffersOperation objects and leave them that way, to avoid
+* wasting CPU cycles writing to them for each read.
 */
for (int i = 0; i < max_ios; ++i)
{
diff --git a/src/backend/utils/mmgr/bump.c b/src/backend/utils/mmgr/bump.c
index 449bd29344..26d2907fb7 100644
--- a/src/backend/utils/mmgr/bump.c
+++ b/src/backend/utils/mmgr/bump.c
@@ -501,8 +501,8 @@ BumpAlloc(MemoryContext context, Size size, int flags)
 #endif
 
/*
-* If requested size exceeds maximum for chunks we hand the the request
-* off to BumpAllocLarge().
+* If requested size exceeds maximum for chunks we hand the request off 
to
+* BumpAllocLarge().
 */
if (chunk_size > set->allocChunkLimit)
return BumpAllocLarge(context, size, flags);
diff --git a/src/bin/pg_combinebackup/reconstruct.c 
b/src/bin/pg_combinebackup/reconstruct.c
index 15f62c18df..d481a5c56

Re: Typos in the code and README

2024-04-12 Thread Daniel Gustafsson
> On 12 Apr 2024, at 23:15, Heikki Linnakangas  wrote:
> 
> On 11/04/2024 16:05, Daniel Gustafsson wrote:
>> Now that the tree has settled down a bit post-freeze I ran some tooling to
>> check spelling.  I was primarily interested in docs and README* which were
>> mostly free from simply typos, while the code had some in various comments 
>> and
>> one in code.  The attached fixes all that I came across (not cross-referenced
>> against ongoing reverts or any other fixup threads but will be before pushing
>> of course).
> 
> Here's a few more. I've accumulate these over the past couple of months, 
> keeping them stashed in a branch, adding to it whenever I've spotted a minor 
> typo while reading the code.

Nice, let's lot all these together.

--
Daniel Gustafsson





Re: Typos in the code and README

2024-04-12 Thread Heikki Linnakangas

On 11/04/2024 16:05, Daniel Gustafsson wrote:

Now that the tree has settled down a bit post-freeze I ran some tooling to
check spelling.  I was primarily interested in docs and README* which were
mostly free from simply typos, while the code had some in various comments and
one in code.  The attached fixes all that I came across (not cross-referenced
against ongoing reverts or any other fixup threads but will be before pushing
of course).


Here's a few more. I've accumulate these over the past couple of months, 
keeping them stashed in a branch, adding to it whenever I've spotted a 
minor typo while reading the code.


--
Heikki Linnakangas
Neon (https://neon.tech)
From 5f531b719c176b2f316b6341fa062af508ed2e10 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas 
Date: Sun, 7 Apr 2024 22:34:23 +0300
Subject: [PATCH 1/2] fix typos

---
 doc/src/sgml/maintenance.sgml   | 2 +-
 doc/src/sgml/meson.build| 2 +-
 src/backend/access/rmgrdesc/xactdesc.c  | 2 +-
 src/backend/catalog/system_functions.sql| 2 +-
 src/backend/commands/amcmds.c   | 2 +-
 src/backend/commands/tablecmds.c| 4 ++--
 src/backend/postmaster/walsummarizer.c  | 2 +-
 src/backend/replication/logical/slotsync.c  | 2 +-
 src/backend/statistics/dependencies.c   | 4 ++--
 src/backend/utils/adt/multirangetypes.c | 2 +-
 src/backend/utils/mmgr/aset.c   | 4 ++--
 src/backend/utils/mmgr/generation.c | 4 ++--
 src/bin/pg_basebackup/bbstreamer_tar.c  | 2 +-
 src/bin/pg_combinebackup/pg_combinebackup.c | 2 +-
 src/interfaces/libpq/fe-secure-openssl.c| 2 +-
 src/test/modules/test_resowner/test_resowner_many.c | 2 +-
 src/test/regress/expected/aggregates.out| 2 +-
 src/test/regress/sql/aggregates.sql | 2 +-
 18 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 2bfa05b8bc..0be90bdc7e 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -802,7 +802,7 @@ HINT:  Execute a database-wide VACUUM in that database.
 
  Similar to the XID case, if autovacuum fails to clear old MXIDs from a table, the
  system will begin to emit warning messages when the database's oldest MXIDs reach forty
- million transactions from the wraparound point.  And, just as an the XID case, if these
+ million transactions from the wraparound point.  And, just as in the XID case, if these
  warnings are ignored, the system will refuse to generate new MXIDs once there are fewer
  than three million left until wraparound.
 
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index 3a4b47d387..e418de83a7 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -207,7 +207,7 @@ if docs_dep.found()
   alias_target('man', man)
   alias_target('install-man', install_doc_man)
 
-  # built and installed as part of the the docs target
+  # built and installed as part of the docs target
   installdocs += install_doc_man
   docs += man
 endif
diff --git a/src/backend/access/rmgrdesc/xactdesc.c b/src/backend/access/rmgrdesc/xactdesc.c
index 41b842d80e..dccca201e0 100644
--- a/src/backend/access/rmgrdesc/xactdesc.c
+++ b/src/backend/access/rmgrdesc/xactdesc.c
@@ -25,7 +25,7 @@
  * Parse the WAL format of an xact commit and abort records into an easier to
  * understand format.
  *
- * This routines are in xactdesc.c because they're accessed in backend (when
+ * These routines are in xactdesc.c because they're accessed in backend (when
  * replaying WAL) and frontend (pg_waldump) code. This file is the only xact
  * specific one shared between both. They're complicated enough that
  * duplication would be bothersome.
diff --git a/src/backend/catalog/system_functions.sql b/src/backend/catalog/system_functions.sql
index fe2bb50f46..ae099e328c 100644
--- a/src/backend/catalog/system_functions.sql
+++ b/src/backend/catalog/system_functions.sql
@@ -5,7 +5,7 @@
  *
  * src/backend/catalog/system_functions.sql
  *
- * This file redefines certain built-in functions that it's impractical
+ * This file redefines certain built-in functions that are impractical
  * to fully define in pg_proc.dat.  In most cases that's because they use
  * SQL-standard function bodies and/or default expressions.  The node
  * tree representations of those are too unreadable, platform-dependent,
diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index 10e386288a..aaa0f9a1dc 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -167,7 +167,7 @@ get_index_am_oid(const char *amname, bool missing_ok)
 
 /*
  * get_table_am_oid - given an access method name, look up its OID
- *		and verify it corresponds to an 

Re: Typos in the code and README

2024-04-12 Thread Bruce Momjian
On Fri, Apr 12, 2024 at 04:55:16PM -0400, Bruce Momjian wrote:
> On Thu, Apr 11, 2024 at 03:37:00PM +0200, Daniel Gustafsson wrote:
> > On 11 Apr 2024, at 15:29, David Rowley  wrote:
> > 
> > On Fri, 12 Apr 2024, 1:05 am Daniel Gustafsson,  wrote:
> > 
> > Now that the tree has settled down a bit post-freeze I ran some 
> > tooling
> > to
> > check spelling.  I was primarily interested in docs and README* 
> > which
> > were
> > mostly free from simply typos, while the code had some in various
> > comments and
> > one in code.  The attached fixes all that I came across (not
> > cross-referenced
> > against ongoing reverts or any other fixup threads but will be 
> > before
> > pushing
> > of course).
> > 
> > 
> > I see you've corrected "iif" to "if". It should be "iff".
> > 
> > 
> > Gotcha, will fix.  I opted for "if" due to recent threads where the use of
> > "iff" was discouraged due to not being commonly known, but that was in doc/ 
> > and
> > not code comments.
> 
> I actually agree "iff" is just not clear enough.  "Iff" stands for "if
> and only if" and maybe should be spelled out that way.

Just to clarify, I think "if and only if" means "if A then B" and B can
only happen if A happens, meaning there are not other cases where B can
happen.  This latter part is what disinguishes "iff" from "if".

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  Only you can decide what is important to you.




Re: Typos in the code and README

2024-04-12 Thread Bruce Momjian
On Thu, Apr 11, 2024 at 03:37:00PM +0200, Daniel Gustafsson wrote:
> On 11 Apr 2024, at 15:29, David Rowley  wrote:
> 
> On Fri, 12 Apr 2024, 1:05 am Daniel Gustafsson,  wrote:
> 
> Now that the tree has settled down a bit post-freeze I ran some 
> tooling
> to
> check spelling.  I was primarily interested in docs and README* which
> were
>     mostly free from simply typos, while the code had some in various
> comments and
> one in code.  The attached fixes all that I came across (not
> cross-referenced
> against ongoing reverts or any other fixup threads but will be before
> pushing
> of course).
> 
> 
> I see you've corrected "iif" to "if". It should be "iff".
> 
> 
> Gotcha, will fix.  I opted for "if" due to recent threads where the use of
> "iff" was discouraged due to not being commonly known, but that was in doc/ 
> and
> not code comments.

I actually agree "iff" is just not clear enough.  "Iff" stands for "if
and only if" and maybe should be spelled out that way.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  Only you can decide what is important to you.




Re: Typos in the code and README

2024-04-11 Thread Daniel Gustafsson
> On 11 Apr 2024, at 15:29, David Rowley  wrote:
> 
> On Fri, 12 Apr 2024, 1:05 am Daniel Gustafsson,  <mailto:dan...@yesql.se>> wrote:
>> Now that the tree has settled down a bit post-freeze I ran some tooling to
>> check spelling.  I was primarily interested in docs and README* which were
>> mostly free from simply typos, while the code had some in various comments 
>> and
>> one in code.  The attached fixes all that I came across (not cross-referenced
>> against ongoing reverts or any other fixup threads but will be before pushing
>> of course).
> 
> 
> I see you've corrected "iif" to "if". It should be "iff".

Gotcha, will fix.  I opted for "if" due to recent threads where the use of
"iff" was discouraged due to not being commonly known, but that was in doc/ and
not code comments.

--
Daniel Gustafsson



Re: Typos in the code and README

2024-04-11 Thread David Rowley
On Fri, 12 Apr 2024, 1:05 am Daniel Gustafsson,  wrote:

> Now that the tree has settled down a bit post-freeze I ran some tooling to
> check spelling.  I was primarily interested in docs and README* which were
> mostly free from simply typos, while the code had some in various comments
> and
> one in code.  The attached fixes all that I came across (not
> cross-referenced
> against ongoing reverts or any other fixup threads but will be before
> pushing
> of course).
>

I see you've corrected "iif" to "if". It should be "iff".

David

>


Re: Typos in the code and README

2024-04-11 Thread Andrew Dunstan



On 2024-04-11 Th 09:05, Daniel Gustafsson wrote:

Now that the tree has settled down a bit post-freeze I ran some tooling to
check spelling.  I was primarily interested in docs and README* which were
mostly free from simply typos, while the code had some in various comments and
one in code.  The attached fixes all that I came across (not cross-referenced
against ongoing reverts or any other fixup threads but will be before pushing
of course).




I have these covered:


src/test/modules/test_json_parser/README  | 2 +-
.../test_json_parser/test_json_parser_incremental.c   | 4 ++--
src/test/modules/test_json_parser/test_json_parser_perf.c | 2 +-


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com





Typos in the code and README

2024-04-11 Thread Daniel Gustafsson
Now that the tree has settled down a bit post-freeze I ran some tooling to
check spelling.  I was primarily interested in docs and README* which were
mostly free from simply typos, while the code had some in various comments and
one in code.  The attached fixes all that I came across (not cross-referenced
against ongoing reverts or any other fixup threads but will be before pushing
of course).

--
Daniel Gustafsson



v1-0001-Fix-typos.patch
Description: Binary data


Re: Typos in reorderbuffer.c.

2024-03-14 Thread Kyotaro Horiguchi
At Thu, 14 Mar 2024 11:23:38 +0530, Amit Kapila  wrote 
in 
> On Thu, Mar 14, 2024 at 9:58 AM Kyotaro Horiguchi
>  wrote:
> >
> > While examining reorderbuffer.c, I found several typos. I'm not sure
> > if fixing them is worthwhile, but I've attached a fix just in case.
> >
> 
> LGTM. I'll push this in some time.

Thanks!

-- 
Kyotaro Horiguchi
NTT Open Source Software Center


Re: Typos in reorderbuffer.c.

2024-03-13 Thread Amit Kapila
On Thu, Mar 14, 2024 at 9:58 AM Kyotaro Horiguchi
 wrote:
>
> While examining reorderbuffer.c, I found several typos. I'm not sure
> if fixing them is worthwhile, but I've attached a fix just in case.
>

LGTM. I'll push this in some time.

-- 
With Regards,
Amit Kapila.




Typos in reorderbuffer.c.

2024-03-13 Thread Kyotaro Horiguchi
Hello.

While examining reorderbuffer.c, I found several typos. I'm not sure
if fixing them is worthwhile, but I've attached a fix just in case.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 001f901ee6..92cf39ff74 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -32,7 +32,7 @@
  *
  *	  In order to cope with large transactions - which can be several times as
  *	  big as the available memory - this module supports spooling the contents
- *	  of a large transactions to disk. When the transaction is replayed the
+ *	  of large transactions to disk. When the transaction is replayed the
  *	  contents of individual (sub-)transactions will be read from disk in
  *	  chunks.
  *
@@ -3078,10 +3078,10 @@ ReorderBufferImmediateInvalidation(ReorderBuffer *rb, uint32 ninvalidations,
  * least once for every xid in XLogRecord->xl_xid (other places in records
  * may, but do not have to be passed through here).
  *
- * Reorderbuffer keeps some datastructures about transactions in LSN order,
+ * Reorderbuffer keeps some data structures about transactions in LSN order,
  * for efficiency. To do that it has to know about when transactions are seen
  * first in the WAL. As many types of records are not actually interesting for
- * logical decoding, they do not necessarily pass though here.
+ * logical decoding, they do not necessarily pass through here.
  */
 void
 ReorderBufferProcessXid(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn)
@@ -3513,11 +3513,11 @@ ReorderBufferLargestTXN(ReorderBuffer *rb)
  * snapshot because we don't decode such transactions.  Also, we do not select
  * the transaction which doesn't have any streamable change.
  *
- * Note that, we skip transactions that contains incomplete changes. There
+ * Note that, we skip transactions that contain incomplete changes. There
  * is a scope of optimization here such that we can select the largest
  * transaction which has incomplete changes.  But that will make the code and
  * design quite complex and that might not be worth the benefit.  If we plan to
- * stream the transactions that contains incomplete changes then we need to
+ * stream the transactions that contain incomplete changes then we need to
  * find a way to partially stream/truncate the transaction changes in-memory
  * and build a mechanism to partially truncate the spilled files.
  * Additionally, whenever we partially stream the transaction we need to
@@ -4701,8 +4701,8 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
 }
 
 /*
- * Rejigger change->newtuple to point to in-memory toast tuples instead to
- * on-disk toast tuples that may not longer exist (think DROP TABLE or VACUUM).
+ * Rejigger change->newtuple to point to in-memory toast tuples instead of
+ * on-disk toast tuples that may no longer exist (think DROP TABLE or VACUUM).
  *
  * We cannot replace unchanged toast tuples though, so those will still point
  * to on-disk toast data.
@@ -4713,7 +4713,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
  * at unexpected times.
  *
  * We simply subtract size of the change before rejiggering the tuple, and
- * then adding the new size. This makes it look like the change was removed
+ * then add the new size. This makes it look like the change was removed
  * and then added back, except it only tweaks the accounting info.
  *
  * In particular it can't trigger serialization, which would be pointless


Re: Fix some typos

2024-01-21 Thread Michael Paquier
On Sun, Jan 21, 2024 at 08:22:01PM +0800, Yongtao Huang wrote:
> As the title said, just fix some typos.

Thanks, applied.
--
Michael


signature.asc
Description: PGP signature


Fix some typos

2024-01-21 Thread Yongtao Huang
Hi all,

As the title said, just fix some typos.

Regards

Yongtao Huang


0001-Fix-some-typos.patch
Description: Binary data


Re: Fix typos and inconsistencies for v16

2023-05-05 Thread Michael Paquier
On Tue, May 02, 2023 at 12:26:31PM +0900, Michael Paquier wrote:
> On Fri, Apr 21, 2023 at 12:00:00PM +0300, Alexander Lakhin wrote:
>> 4. CommitTSBuffer -> CommitTsBuffer // the inconsistency exists since 
>> 5da14938f; maybe this change should be backpatched
> 
> Yes, we'd better backpatch that.  I agree that it seems more sensible
> here to switch the compiled value rather than what the docs have been
> using for years.  Perhaps somebody has a different opinion?

Hearing nothing, I have now applied this part down to 13, on time for
the next minor release.
--
Michael


signature.asc
Description: PGP signature


Re: Fix typos and inconsistencies for v16

2023-05-01 Thread Michael Paquier
On Fri, Apr 21, 2023 at 12:00:00PM +0300, Alexander Lakhin wrote:
> Please look at the following two bunches for v14+ and v13+ (split to ease
> back-patching if needed). Having processed them, I've reached the state that
> could be considered "clean" ([2], [3]); at least I don't see how to detect
> yet more errors of this class in dozens, so it's my last run for now (though I
> have several entities left, which I couldn't find replacements for).

This was hanging around, and I had some time, so I have looked at the
whole.  One of the only two user-visible change was in the docs for
pg_amcheck, so I have applied that first as of 6fd8ae6 and backpatched
it down to 14.

Now, for the remaining 59..

> 1. agg_init_trans_check -> agg_trans
> 2. agg_strict_trans_check -> agg_trans

/*
 * pergroup = &aggstate->all_pergroups
-* [op->d.agg_strict_trans_check.setoff]
-* [op->d.agg_init_trans_check.transno];
+* [op->d.agg_trans.setoff]
+* [op->d.agg_trans.transno];
 */
Honestly, while incorrect, I have no idea what this comment means ;)

> 4. CommitTSBuffer -> CommitTsBuffer // the inconsistency exists since 
> 5da14938f; maybe this change should be backpatched

Yes, we'd better backpatch that.  I agree that it seems more sensible
here to switch the compiled value rather than what the docs have been
using for years.  Perhaps somebody has a different opinion?

The others were OK and in line with the discussion of upthread, so
applied.
--
Michael


signature.asc
Description: PGP signature


Re: Fix typos and inconsistencies for v16

2023-04-21 Thread Alexander Lakhin

Hi David,

21.04.2023 01:49, David Rowley wrote:

On Wed, 19 Apr 2023 at 07:00, Alexander Lakhin  wrote:

please look at the similar list for v15+ (596b5af1d..HEAD).

I've now pushed most of these but didn't include the following ones:


Thank you!


3. BufFileOpenShared -> BufFileOpenFileSet // see dcac5e7ac

Maybe I need to spend longer, but I just didn't believe the command
that claimed that "BufFiles opened using BufFileOpenFileSet() are
read-only by definition". Looking at the code for that, it seems to
depend on if O_RDONLY is included in the mode flags.


I've found the following explanation for that:
1) As of dcac5e7ac~1 function ltsConcatWorkerTapes() contained:
...
    file = BufFileOpenShared(fileset, filename, O_RDONLY);
...
 * The only thing that currently prevents writing to the leader tape 
from
 * working is the fact that BufFiles opened using BufFileOpenShared() 
are
 * read-only by definition, but that could be changed if it seemed
...

2) A patch [1], which eventually resulted in c4649cce3, initially started
with the change:

-ltsConcatWorkerTapes(LogicalTapeSet *lts, TapeShare *shared,
...
- * working is the fact that BufFiles opened using BufFileOpenShared() are
...
+LogicalTapeImport(LogicalTapeSet *lts, int worker, TapeShare *shared)
...
+    file = BufFileOpenShared(lts->fileset, filename, O_RDONLY);
...
+ * the fact that BufFiles opened using BufFileOpenShared() are read-only

3) The commit dcac5e7ac (pushed 2021-08-30) renamed the function
BufFileOpenShared() to BufFileOpenFileSet() and changed the comment:
...
 * The only thing that currently prevents writing to the leader tape 
from
-    * working is the fact that BufFiles opened using BufFileOpenShared() 
are
+    * working is the fact that BufFiles opened using BufFileOpenFileSet() 
are
 * read-only by definition, but that could be changed if it seemed
...

4) The commit c4649cce3 (pushed 2021-10-18) removed the comment referencing
BufFileOpenFileSet() and added that somewhat distant comment
referencing BufFileOpenShared():
$ git show c4649cce3 src/backend/utils/sort/logtape.c | grep 'BufFiles opened'
-    * working is the fact that BufFiles opened using BufFileOpenFileSet() 
are
+    * the fact that BufFiles opened using BufFileOpenShared() are read-only

So I still believe that the "BufFileOpenShared -> BufFileOpenFileSet" change
is correct and that comment can be read now as referencing to the line:
    file = BufFileOpenFileSet(fileset->fs, filename, O_RDONLY, false);
in LogicalTapeImport(). Although it could be improved, for sure.

Please look at the following two bunches for v14+ and v13+ (split to ease
back-patching if needed). Having processed them, I've reached the state that
could be considered "clean" ([2], [3]); at least I don't see how to detect
yet more errors of this class in dozens, so it's my last run for now (though I
have several entities left, which I couldn't find replacements for).

v14+:
1. AsyncCtl -> NotifyCtl // renamed in 5da14938f
2. ATExecConstrRecurse -> ATExecAlterConstrRecurse
3. attlocal -> attislocal
4. before_shmem_access -> before_shmem_exit
5. bodys -> bodies
6. can_getnextslot_tidrange -> scan_getnextslot_tidrange
7. DISABLE_ATOMICS -> HAVE_ATOMICS
8. FETCH_H -> REWIND_SOURCE_H
9. filed -> field
10. find_minmax_aggs_walker -> can_minmax_aggs // renamed in 0a2bc5d61e

11. GroupExprInfo ->  GroupVarInfo  a4d75c86b
12. LD_DEAD -> LP_DEAD
13. libpq-trace.c -> fe-trace.c
14. lowerItem -> lowestItem  bb437f995
15. has_privs -> has_privs_of_role
16. heap_hot_prune_opt -> heap_page_prune_opt
17. MAX_CONVERSION_LENGTH -> MAX_CONVERSION_INPUT_LENGTH  ea1b99a66
18. MAX_FLUSH_BUFFERS -> MAX_WRITEALL_BUFFERS // renamed in dee663f78
19. myscheam -> myschema // doc/ -- maybe should be backpatched
20. pgbestat_beinit -> pgstat_beinit

21. pgWALUsage -> pgWalUsage
22. point-in-time-recovery -> point-in-time recovery
23. PQnotify -> PGnotify
24. QUERYJUBLE_H -> QUERYJUMBLE_H
25. rd_partdesc_nodetach -> rd_partdesc_nodetached
26. ReadNewTransactionid -> GetNewTransactionId
27. RelationBuildDescr -> RelationBuildDesc
28. SnapBuildCommittedTxn -> SnapBuildCommitTxn // see DecodeCommit()
29. subscription_rel -> pg_subscription_rel
30. tap_rep -> tab_rep

31. total_heap_blks -> heap_blks_total
32. tuple_cids -> tuplecids
33. WatchLatch -> WaitLatch
34. WriteAll -> SimpleLruWriteAll
35. PageIsPrunable -- remove // that define and the PageIsPrunable() check 
above were removed in dc7420c2c

Candidates for removal:
BARRIER_SHOULD_CHECK //unused since a3ed4d1ef
EXE_EXT // unused since f06b1c598
get_toast_for // unused since 860593ec3
SizeOfCommitTsSet // unused since 08aa89b32

v13+:
1. agg_init_trans_check -> agg_trans
2. agg_strict_trans_check -> agg_trans
3. amopclassopts -> amoptsprocnum  since 911e70207
4. CommitTSBuffer -> CommitTsBuffer // the inconsistency exists since 
5da14938f; maybe this change should be back

Re: Fix typos and inconsistencies for v16

2023-04-20 Thread David Rowley
On Wed, 19 Apr 2023 at 07:00, Alexander Lakhin  wrote:
> please look at the similar list for v15+ (596b5af1d..HEAD).

I've now pushed most of these but didn't include the following ones:

> 3. BufFileOpenShared -> BufFileOpenFileSet // see dcac5e7ac

Maybe I need to spend longer, but I just didn't believe the command
that claimed that "BufFiles opened using BufFileOpenFileSet() are
read-only by definition". Looking at the code for that, it seems to
depend on if O_RDONLY is included in the mode flags.

> 19. multidimensional-aware -> multidimension-aware // sync with gistbuild.c

I didn't change this as I didn't think it was an improvement.  I'd
probably have written "multidimensionally aware", but I didn't feel
strongly enough to want to change it.

David




Re: Fix typos and inconsistencies for v16

2023-04-18 Thread Tom Lane
Justin Pryzby  writes:
> On Tue, Apr 18, 2023 at 02:06:43PM +1200, David Rowley wrote:
>> On Tue, 18 Apr 2023 at 10:10, Justin Pryzby  wrote:
>>> and s/evade/avoid/

>> I didn't touch this. You'll need to provide more justification for why
>> you think it's more correct than what's there.  

> I'd noticed that it's a substitution/mistake that's been made in the
> past.

"Evade" doesn't seem like le mot juste there; it's got negative
connotations.  But the code around it is just horrible.  Some offenses:

* No documentation in the function header comment of what the
usersetArray parameter is or does.  Which is bad enough in itself,
but what the parameter actually does is falsify the header comment's
principal claim that the passed context is what is used.  So I don't
find that omission acceptable.

* Non-obvious, and quite unnecessary, dependency on the isnull variable
having been left in a particular state by previous code.

* For me, at least, it'd read better if the if/else arms were swapped,
allowing removal of the negation in the if-condition and bringing
the code this comment comments on closer to said comment.

As for the comment text, maybe say

 * If the value was USER SET, then apply it at PGC_USERSET context
 * rather than the caller-supplied context, to prevent any more-restricted
 * GUCs being set.  Also pass InvalidOid for the role, to ensure any
 * special privileges of the current user aren't applied.

I hesitate to go look at the rest of this commit, but I guess somebody
had better.

regards, tom lane




Re: Fix typos and inconsistencies for v16

2023-04-18 Thread Alexander Lakhin

Hi Justin and David,

18.04.2023 01:10, Justin Pryzby wrote:

Well done.


Thank you for reviewing!


On Mon, Apr 17, 2023 at 09:00:00PM +0300, Alexander Lakhin wrote:

Hello hackers,

Please consider fixing the following unique words/identifiers introduced in v16:

Note that your patches are overlapping:
...
It'd make sense if the changes to each file were isolated to a single
patch (especially 004_load and acl.c).


I'd hoped that most of the proposed fixes will be accepted, so conflicts due
to skipping of some changes seemed unlikely to me. So if you are not
strongly disagree, I would continue presenting my findings the same way.


...
You missed "boostrap" :)


Yes, that's because "boostrap" was not unique, but my semi-automatic approach
is based on `uniq -u`, so I'm sure that there are typos that can't be found
this way.


But hadn't yet convinced myself to start the process of defending each
one of the fixes.  Attached some others that I found.


Yeah, those are good catches too, but e. g. "privilges" is not new in v16,
so it's fallen out of my "hot errors" category. If we're going to fix not so
hot ones too now, please look at the similar list for v15+ (596b5af1d..HEAD).

1. abbrevated -> abbreviated
2. ArchiveModeRequested -> ArchiveRecoveryRequested
3. BufFileOpenShared -> BufFileOpenFileSet // see dcac5e7ac
4. check_publication_columns -> pub_collist_contains_invalid_column // see note 
1
5. configuation -> configuration
6. copyAclUserName -> dequoteAclUserName // see 0c9d84427
7. EndWalRecovery -> FinishWalRecovery
8. HaveRegisteredOrActiveSnapshots -> HaveRegisteredOrActiveSnapshot
9. idiosyncracies -> idiosyncrasies
10. iif -> iff

11. initpriv -> initprivs
12. inserted_destrel -> insert_destrel
13. Intialize -> Initialize
14. invtrans -> invtransfn
15. isolation-level -> isolation level
16. lefthasheqoperator -> left_hasheqoperator + righthasheqoperator -> 
right_hasheqoperator
17. LRQ_NO_IO -> LRQ_NEXT_NO_IO
18. minRecovery point -> minRecoveryPoint
19. multidimensional-aware -> multidimension-aware // sync with gistbuild.c
20. ParalleVacuumState -> ParallelVacuumState

21. PgStatShm_Stat*Entry -> PgStatShared_* // see note 2
22. plpython_call_handler -> plpython3_call_handler // see 9b7e24a2c
23. pulications -> publications
24. ReadCheckPointRecord -> ReadCheckpointRecord
25. relkkinds -> relkinds
26. separare -> separate // though perhaps it's not the most suitable word here
27. setup_formatted_log_time -> get_formatted_log_time // see ac7c80758
28. SPI_abort -> SPI_rollback
29. ssup_datum_int32_compare -> ssup_datum_int32_cmp
30. ssup_datum_signed_compare -> ssup_datum_signed_cmp

31. ssup_datum_unsigned_compare -> ssup_datum_unsigned_cmp
32. SUBSCRITPION -> SUBSCRIPTION
33. tabelspaces -> tablespaces
34. table_state_not_ready -> table_states_not_ready
35. underling -> underlying
36. WalRecoveryResult -> EndOfWalRecoveryInfo

Also, I'd like to note that the following entities/references are orphaned now,
so maybe some of them could be removed too:
1. gen-rtab (in pgcrypto/Makefile) // orphaned since db7d1a7b0
2. pgstat_temp_directory // was left by b3abca681 for v15, but maybe it's time 
to remove it for v16
3. pgstat_write_statsfiles (in valgrind.supp)
4. quote_system_arg (in vcregress.pl) // unused since d2a2ce418
5. standard_initdb (in vcregress.pl) // unused since 322becb60
/* though maybe vcregress.pl will be removed completely soon */
6. int pstat;  /* mcrypt uses it */ (in 
contrib/pgcrypto/px.h)
/* "mcrypt" became unique after abe81ee08, support for libmcrypt was removed at 
2005
(3cc866123) */

Note 1. A check that was located in check_publication_columns() in
v13-0003-Add-column-filtering-to-logical-replication.patch [1],
can be found in pub_collist_contains_invalid_column() now (see also [2]).

Note 2. The inconsistency appeared in [3],
v67-0007-pgstat-store-statistics-in-shared-memory.patch was correct in
this aspect.


18.04.2023 04:35, David Rowley wrote:

Please consider fixing the following unique words/identifiers introduced in v16:

Thanks, I've pushed all of these apart from the following 2.

Thank you!

[1] 
https://www.postgresql.org/message-id/202112302021.ca7ihogysgh3%40alvherre.pgsql
[2] 
https://www.postgresql.org/message-id/CAA4eK1K5pkrPT9z5TByUPptExian5c18g6GnfNf9Cr97QdPbjw%40mail.gmail.com
[3] 
https://www.postgresql.org/message-id/20220404041516.cctrvpadhuriawlq%40alap3.anarazel.de

Best regards,
Alexanderdiff --git a/contrib/basebackup_to_shell/t/001_basic.pl b/contrib/basebackup_to_shell/t/001_basic.pl
index a278df3f91..84ad93f614 100644
--- a/contrib/basebackup_to_shell/t/001_basic.pl
+++ b/contrib/basebackup_to_shell/t/001_basic.pl
@@ -49,7 +49,7 @@ $node->command_fails_like(
 	qr/shell c

Re: Fix typos and inconsistencies for v16

2023-04-18 Thread Justin Pryzby
On Tue, Apr 18, 2023 at 02:06:43PM +1200, David Rowley wrote:
> On Tue, 18 Apr 2023 at 10:10, Justin Pryzby  wrote:
> > > -  * USER SET values are appliciable only for PGC_USERSET 
> > > parameters. We
> > > +  * USER SET values are applicable only for PGC_USERSET 
> > > parameters. We
> > >* use InvalidOid as role in order to evade possible 
> > > privileges of the
> >
> > and s/evade/avoid/
> 
> I didn't touch this. You'll need to provide more justification for why
> you think it's more correct than what's there.  

I'd noticed that it's a substitution/mistake that's been made in the
past.  I dug up:

9436041ed848debb3d64fb5fbff6cdb35bc46d04
8e12f4a250d250a89153da2eb9b91c31bb80c483
cd9479af2af25d7fa9bfd24dd4dcf976b360f077
6df7a9698bb036610c1e8c6d375e1be38cb26d5f
911e70207703799605f5a0e8aad9f06cff067c63

> It might not be worth too much discussion, however.

+many.  I may resend the patch at some later date.

> > Attached some others that I found.
> 
> Pushed the rest.  Thanks

Thanks!

-- 
Justin 




Re: Fix typos and inconsistencies for v16

2023-04-17 Thread Tom Lane
David Rowley  writes:
> On Tue, 18 Apr 2023 at 06:00, Alexander Lakhin  wrote:
>> Also, maybe OID_MAX should be removed from src/include/postgres_ext.h as 
>> it's unused since eb8312a22.

> I didn't touch this. It seems like it could be useful for extensions
> and client apps even if it's not used in core.

Agreed, bad idea.  For better or worse, that's part of our client API now.

>> Beside that, this simple script:
>> for w in $(cat src/tools/pgindent/typedefs.list); do grep -q -P "\b$w\b" -r 
>> * --exclude typedefs.list || echo "$w"; done
>> detects 58 identifiers that don't exist in the source tree anymore (see 
>> typedefs.lost attached).
>> Maybe they should be removed from typedefs.list too.

> I didn't touch this either.  typedefs.list normally gets some work
> done during the pgindent run, which is likely going to happen around
> May or June.

Yeah, it will get refreshed from the buildfarm output [1] pretty soon.
A quick check says that as of today, that refresh would add 81 names
and remove 94.  (Seems like a remarkably high number of removals,
but I didn't dig further than counting the diff output.)

regards, tom lane

[1] https://buildfarm.postgresql.org/cgi-bin/typedefs.pl?show_list




Re: Fix typos and inconsistencies for v16

2023-04-17 Thread David Rowley
On Tue, 18 Apr 2023 at 10:10, Justin Pryzby  wrote:
> > -  * USER SET values are appliciable only for PGC_USERSET 
> > parameters. We
> > +  * USER SET values are applicable only for PGC_USERSET 
> > parameters. We
> >* use InvalidOid as role in order to evade possible 
> > privileges of the
>
> and s/evade/avoid/

I didn't touch this. You'll need to provide more justification for why
you think it's more correct than what's there.  It might not be worth
too much discussion, however.

> Attached some others that I found.

Pushed the rest.  Thanks

David




Re: Fix typos and inconsistencies for v16

2023-04-17 Thread David Rowley
On Tue, 18 Apr 2023 at 06:00, Alexander Lakhin  wrote:
> Please consider fixing the following unique words/identifiers introduced in 
> v16:

Thanks, I've pushed all of these apart from the following 2.

> 45. tar_set_error -- remove (obsolete since ebfb814f7)
> 46. test_tranche_name -- remove (not used, see 006b69fd9)

These didn't quite fit in with the "typo fixes" category of the
commit, so I left them off the commit I just pushed.

> Also, maybe OID_MAX should be removed from src/include/postgres_ext.h as it's 
> unused since eb8312a22.

I didn't touch this. It seems like it could be useful for extensions
and client apps even if it's not used in core.

> Beside that, this simple script:
> for w in $(cat src/tools/pgindent/typedefs.list); do grep -q -P "\b$w\b" -r * 
> --exclude typedefs.list || echo "$w"; done
> detects 58 identifiers that don't exist in the source tree anymore (see 
> typedefs.lost attached).
> Maybe they should be removed from typedefs.list too.

I didn't touch this either.  typedefs.list normally gets some work
done during the pgindent run, which is likely going to happen around
May or June.  Maybe you can check back after that's done and make sure
all these unused ones were removed. I'm not sure if the process that's
done for that only finds new ones that are now required or if it
completely generates a new list.

David




Re: Fix typos and inconsistencies for v16

2023-04-17 Thread Justin Pryzby
On Mon, Apr 17, 2023 at 09:00:00PM +0300, Alexander Lakhin wrote:
> Hello hackers,
> 
> Please consider fixing the following unique words/identifiers introduced in 
> v16:

Well done.

Note that your patches are overlapping:

  3 --- a/src/backend/utils/misc/guc.c
  2 --- a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
  2 --- a/src/test/ldap/LdapServer.pm
  2 --- a/src/interfaces/libpq/t/004_load_balance_dns.pl
  2 --- a/src/backend/utils/adt/acl.c

It'd make sense if the changes to each file were isolated to a single
patch (especially 004_load and acl.c).

> -  * USER SET values are appliciable only for PGC_USERSET 
> parameters. We
> +  * USER SET values are applicable only for PGC_USERSET 
> parameters. We
>* use InvalidOid as role in order to evade possible privileges 
> of the

and s/evade/avoid/

> +++ b/src/bin/pg_dump/pg_dumpall.c

You missed "boostrap" :)

I independently found 11 of the same typos you did:

> 1. addresess -> addresses
> 3. appeneded -> appended
> 4. appliciable -> applicable
> 8. containsthe ->  contains the
> 15. execpt -> except
> 19. happend -> happened
> 27. optionn -> option
> 30. permissons -> permissions
> 37. remaing -> remaining
> 42. sentinal -> sentinel
> 47. varilables -> variables

But hadn't yet convinced myself to start the process of defending each
one of the fixes.  Attached some others that I found.

-- 
Justin
diff --git a/contrib/test_decoding/expected/ddl.out 
b/contrib/test_decoding/expected/ddl.out
index 9a28b5ddc5a..d55fb3a667f 100644
--- a/contrib/test_decoding/expected/ddl.out
+++ b/contrib/test_decoding/expected/ddl.out
@@ -428,7 +428,7 @@ SELECT data FROM 
pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
 -- test whether a known, but not yet logged toplevel xact, followed by a
 -- subxact commit is handled correctly
 BEGIN;
-SELECT pg_current_xact_id() != '0'; -- so no fixed xid apears in the outfile
+SELECT pg_current_xact_id() != '0'; -- so no fixed xid appears in the outfile
  ?column? 
 --
  t
diff --git a/contrib/test_decoding/sql/ddl.sql 
b/contrib/test_decoding/sql/ddl.sql
index 4f76bed72c1..57285a828c7 100644
--- a/contrib/test_decoding/sql/ddl.sql
+++ b/contrib/test_decoding/sql/ddl.sql
@@ -236,7 +236,7 @@ SELECT data FROM 
pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'inc
 -- test whether a known, but not yet logged toplevel xact, followed by a
 -- subxact commit is handled correctly
 BEGIN;
-SELECT pg_current_xact_id() != '0'; -- so no fixed xid apears in the outfile
+SELECT pg_current_xact_id() != '0'; -- so no fixed xid appears in the outfile
 SAVEPOINT a;
 INSERT INTO tr_sub(path) VALUES ('4-top-1-#1');
 RELEASE SAVEPOINT a;
diff --git a/doc/src/sgml/user-manag.sgml b/doc/src/sgml/user-manag.sgml
index b5e0392ad27..b6c37ccef26 100644
--- a/doc/src/sgml/user-manag.sgml
+++ b/doc/src/sgml/user-manag.sgml
@@ -346,7 +346,7 @@ ALTER ROLE myname SET enable_indexscan TO off;
role using SET ROLE. However, since any user who has
ADMIN OPTION on a role can grant membership in that
role to any other user, the CREATEROLE user can gain
-   access to the created role by simplying granting that role back to
+   access to the created role by simply granting that role back to
themselves with the INHERIT and/or SET
options. Thus, the fact that privileges are not inherited by default nor
is SET ROLE granted by default is a safeguard against
diff --git a/src/backend/optimizer/path/allpaths.c 
b/src/backend/optimizer/path/allpaths.c
index 244957a2483..9bdc70c702e 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -4051,7 +4051,7 @@ recurse_push_qual(Node *setOp, Query *topquery,
  *
  * extra_used_attrs can be passed as non-NULL to mark any columns (offset by
  * FirstLowInvalidHeapAttributeNumber) that we should not remove.  This
- * parameter is modifed by the function, so callers must make a copy if they
+ * parameter is modified by the function, so callers must make a copy if they
  * need to use the passed in Bitmapset after calling this function.
  *
  * To avoid affecting column numbering in the targetlist, we don't physically
diff --git a/src/backend/optimizer/util/plancat.c 
b/src/backend/optimizer/util/plancat.c
index e3824efe9b5..65adf04c4eb 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -436,7 +436,7 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, 
bool inhparent,
 * the number-of-tuples estimate to equal the parent 
table; if it
 * is partial then we have to use the same methods as 
we would for
 * a table, except we can be sure that

Fix typos and inconsistencies for v16

2023-04-17 Thread Alexander Lakhin

Hello hackers,

Please consider fixing the following unique words/identifiers introduced in v16:
1. addresess -> addresses
2. adminstrator -> administrator // the same typo found in src/backend/po/id.po, but perhaps it should be fixed via 
pgsql-translators

3. appeneded -> appended
4. appliciable -> applicable
5. BackroundPsql -> BackgroundPsql
6. binaies -> binaries
7. compresion -> compression
8. containsthe ->  contains the
9. contextes -> contexts
10. deparseAnalyzeTuplesSql -> deparseAnalyzeInfoSql // that function was 
renamed in 57d11ef0

11. DO_LARGE_OJECT_DATA -> DO_LARGE_OBJECT_DATA
12. doesnt't -> doesn't
13. dst_perminfo -> dst_perminfos
14. eror -> error
15. execpt -> except
16. forech -> foreach
17. GetResultRelCheckAsUser -> ExecGetResultRelCheckAsUser
18. GUCS -> GUCs
19. happend -> happened
20. immitated -> imitated

21. insert_xid -> tuple_xid // see bfcf1b348
22. ldap_add -> ldapadd_file
23. ldapbindpassw -> ldapbindpasswd
24. MemoryChunkSetExternal -> MemoryChunkSetHdrMaskExternal
25. non-encyrpted -> non-encrypted
26. --no-process_main -> --no-process-main
27. optionn -> option
28. Othewise -> Otherwise
29. parellel -> parallel
30. permissons -> permissions

31. pg_pwrite_zeroes -> pg_pwrite_zeros
32. pg_writev -> pg_pwritev
33. possbile -> possible
34. pqsymlink -> pgsymlink
35. PG_GET_WAL_FPI_BLOCK_COLS -> PG_GET_WAL_BLOCK_INFO_COLS
36. RangeVarCallbackOwnsTable -> RangeVarCallbackMaintainsTable // see 60684dd83
37. remaing -> remaining
38. ResourceOwnerForgetBufferIOs -> ResourceOwnerForgetBufferIO
39. RMGRDESC_UTILS_H -> RMGRDESC_UTILS_H_ // or may be the other way
40. rolenamehash -> rolename_hash

41. ROLERECURSE_SETROLe -> ROLERECURSE_SETROLE
42. sentinal -> sentinel
43. smgzerorextend -> smgrzeroextend
44. stacktoodeep -> rstacktoodeep // an excessive character was deleted with 
db4f21e4a?
45. tar_set_error -- remove (obsolete since ebfb814f7)
46. test_tranche_name -- remove (not used, see 006b69fd9)
47. varilables -> variables
48. xid_commit_status -> xmin_commit_status

Also, maybe OID_MAX should be removed from src/include/postgres_ext.h as it's 
unused since eb8312a22.

Beside that, this simple script:
for w in $(cat src/tools/pgindent/typedefs.list); do grep -q -P "\b$w\b" -r * --exclude 
typedefs.list || echo "$w"; done
detects 58 identifiers that don't exist in the source tree anymore (see 
typedefs.lost attached).
Maybe they should be removed from typedefs.list too.

Best regards,
Alexanderdiff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index d728bd70b3..95dbe8b06c 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -5016,7 +5016,7 @@ postgresGetAnalyzeInfoForForeignTable(Relation relation, bool *can_tablesample)
 			pgfdw_report_error(ERROR, res, conn, false, sql.data);
 
 		if (PQntuples(res) != 1 || PQnfields(res) != 2)
-			elog(ERROR, "unexpected result from deparseAnalyzeTuplesSql query");
+			elog(ERROR, "unexpected result from deparseAnalyzeInfoSql query");
 		reltuples = strtod(PQgetvalue(res, 0, 0), NULL);
 		relkind = *(PQgetvalue(res, 0, 1));
 	}
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 7d3b20168a..f6c0c5ca1a 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -6272,7 +6272,7 @@ ProcessGUCArray(ArrayType *array, ArrayType *usersetArray,
 			userSetDatum = BoolGetDatum(false);
 
 		/*
-		 * USER SET values are appliciable only for PGC_USERSET parameters. We
+		 * USER SET values are applicable only for PGC_USERSET parameters. We
 		 * use InvalidOid as role in order to evade possible privileges of the
 		 * current user.
 		 */
diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index 3894a017f3..104c01d966 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -87,7 +87,7 @@ static size_t ps_buffer_cur_len;	/* nominal strlen(ps_buffer) */
 static size_t ps_buffer_fixed_size; /* size of the constant prefix */
 
 /*
- * Length of ps_buffer before the suffix was appeneded to the end, or 0 if we
+ * Length of ps_buffer before the suffix was appended to the end, or 0 if we
  * didn't set a suffix.
  */
 static size_t ps_buffer_nosuffix_len;
diff --git a/src/bin/pg_dump/compress_lz4.c b/src/bin/pg_dump/compress_lz4.c
index 5aca9c1f06..423e1b7976 100644
--- a/src/bin/pg_dump/compress_lz4.c
+++ b/src/bin/pg_dump/compress_lz4.c
@@ -342,7 +342,7 @@ LZ4Stream_get_error(CompressFileHandle *CFH)
 /*
  * Initialize an already alloc'ed LZ4State struct for subsequent calls.
  *
- * Creates the necessary contexts for either compresion or decompression. When
+ * Creates the necessary contexts for either compression or decompression. When
  * compressing data (indicated by compressing=true), it additionally writes the
  * LZ4 header in the output stream.
  *
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index 395abfe596..656a2e9897 10

Re: typos

2023-02-08 Thread Tom Lane
Michael Paquier  writes:
> On Wed, Feb 08, 2023 at 09:56:44AM -0600, Justin Pryzby wrote:
>> Some more accumulated/new typos.

> 0005 can indeed fix a lot of confusion around the spaces after an
> "else if" block.  Is that something that could be automated with the
> indentation, though?  Same remark for 0009 and 0010.

I see your point about 0005, but I've never seen pgindent remove
vertical whitespace once it's been added.  Not sure what it'd take
to teach it to do so, or whether we'd like the results.

I'd reject 0009 and 0010 altogether --- they don't add any readability
that's worth the potential increase in back-patch problems.

regards, tom lane




Re: typos

2023-02-08 Thread Michael Paquier
On Wed, Feb 08, 2023 at 09:56:44AM -0600, Justin Pryzby wrote:
> Some more accumulated/new typos.

0001 has been a debate for a long time, and it depends on the way SQL
is spelled.  For reference:
$ git grep -i " an sql" -- *.c | wc -l
63
$ git grep -i " a sql" -- *.c | wc -l
135

0005 can indeed fix a lot of confusion around the spaces after an
"else if" block.  Is that something that could be automated with the
indentation, though?  Same remark for 0009 and 0010.

Applied 0002, 0003, 0004, 0006, after rewording a bit 0003 to mention
the compression type.
--
Michael


signature.asc
Description: PGP signature


Re: typos

2023-02-08 Thread Justin Pryzby
Some more accumulated/new typos.
>From 6c79a0d4e0251dbbac38babb60bb2d0fbae3da8d Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Wed, 11 Jan 2023 12:52:25 -0600
Subject: [PATCH 01/10] use "an SQL" rather than a SQL

Per 04539e
---
 doc/src/sgml/ecpg.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index a76cf3538f1..f52165165dc 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -1506,7 +1506,7 @@ EXEC SQL TYPE serial_t IS long;
  
 
  
-  Any word you declare as a typedef cannot be used as a SQL keyword
+  Any word you declare as a typedef cannot be used as an SQL keyword
   in EXEC SQL commands later in the same program.
   For example, this won't work:
 
@@ -1518,7 +1518,7 @@ EXEC SQL START TRANSACTION;
 
   ECPG will report a syntax error for START
   TRANSACTION, because it no longer
-  recognizes START as a SQL keyword,
+  recognizes START as an SQL keyword,
   only as a typedef.
   (If you have such a conflict, and renaming the typedef
   seems impractical, you could write the SQL command
@@ -1530,7 +1530,7 @@ EXEC SQL START TRANSACTION;
In PostgreSQL releases before v16, use
of SQL keywords as typedef names was likely to result in syntax
errors associated with use of the typedef itself, rather than use
-   of the name as a SQL keyword.  The new behavior is less likely to
+   of the name as an SQL keyword.  The new behavior is less likely to
cause problems when an existing ECPG application is recompiled in
a new PostgreSQL release with new
keywords.
-- 
2.25.1

>From fef49b822bad849722ec9b043ffd676c80492d0d Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 15 Jan 2023 17:00:06 -0600
Subject: [PATCH 02/10] comment typos

---
 src/backend/commands/dbcommands.c  | 2 +-
 src/backend/executor/execMain.c| 2 +-
 src/backend/jit/llvm/llvmjit_inline.cpp| 2 +-
 src/backend/replication/logical/snapbuild.c| 2 +-
 src/backend/replication/walsender.c| 6 +++---
 src/bin/pg_dump/pg_backup_custom.c | 2 +-
 src/bin/pg_dump/pg_dumpall.c   | 2 +-
 src/include/lib/ilist.h| 2 +-
 src/test/regress/expected/alter_table.out  | 2 +-
 src/test/regress/expected/create_procedure.out | 2 +-
 src/test/regress/sql/alter_table.sql   | 2 +-
 src/test/regress/sql/create_procedure.sql  | 2 +-
 src/test/subscription/t/031_column_list.pl | 2 +-
 13 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 1f4ce2fb9cf..ef05633bb05 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -3090,7 +3090,7 @@ dbase_redo(XLogReaderState *record)
 
 		/*
 		 * There's a case where the copy source directory is missing for the
-		 * same reason above.  Create the emtpy source directory so that
+		 * same reason above.  Create the empty source directory so that
 		 * copydir below doesn't fail.  The directory will be dropped soon by
 		 * recovery.
 		 */
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index a5115b9c1f7..39bfb48dc22 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -134,7 +134,7 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
 	/*
 	 * In some cases (e.g. an EXECUTE statement) a query execution will skip
 	 * parse analysis, which means that the query_id won't be reported.  Note
-	 * that it's harmless to report the query_id multiple time, as the call
+	 * that it's harmless to report the query_id multiple times, as the call
 	 * will be ignored if the top level query_id has already been reported.
 	 */
 	pgstat_report_query_id(queryDesc->plannedstmt->queryId, false);
diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp
index dc35e002f51..c765add8564 100644
--- a/src/backend/jit/llvm/llvmjit_inline.cpp
+++ b/src/backend/jit/llvm/llvmjit_inline.cpp
@@ -753,7 +753,7 @@ function_inlinable(llvm::Function &F,
 		/* import referenced function itself */
 		importVars.insert(referencedFunction->getName());
 
-		/* import referenced function and its dependants */
+		/* import referenced function and its dependents */
 		for (auto& recImportVar : recImportVars)
 			importVars.insert(recImportVar.first());
 	}
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 829c5681120..62542827e4b 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1816,7 +1816,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)
 	fsync_fname("pg_logical/snapshots", true);
 
 	/*
-	 * Now there's no way we can loose t

Re: typos

2023-01-10 Thread Michael Paquier
On Tue, Jan 10, 2023 at 01:55:56PM +0530, Amit Kapila wrote:
> I have not yet started, so please go ahead.

Okay, I have looked at that and fixed the whole new things, including
the typo you have introduced.  0001~0004 have been left out, as of the
same reasons as upthread.
--
Michael


signature.asc
Description: PGP signature


Re: typos

2023-01-10 Thread Amit Kapila
On Tue, Jan 10, 2023 at 1:18 PM Michael Paquier  wrote:
>
> On Tue, Jan 10, 2023 at 12:24:40PM +0530, Amit Kapila wrote:
> > Thanks for noticing this. I'll take care of this and some other typo
> > patches together.
>
> Does this include 0010?  I was just looking at the whole set and this
> one looked like a cleanup worth on its own so I was going to handle
> it, until I saw your update.  If you are also looking at that, I won't
> stand in your way, of course :)
>

I have not yet started, so please go ahead.

-- 
With Regards,
Amit Kapila.




Re: typos

2023-01-09 Thread Michael Paquier
On Tue, Jan 10, 2023 at 12:24:40PM +0530, Amit Kapila wrote:
> Thanks for noticing this. I'll take care of this and some other typo
> patches together.

Does this include 0010?  I was just looking at the whole set and this
one looked like a cleanup worth on its own so I was going to handle
it, until I saw your update.  If you are also looking at that, I won't
stand in your way, of course :) 
--
Michael


signature.asc
Description: PGP signature


Re: typos

2023-01-09 Thread Amit Kapila
On Tue, Jan 10, 2023 at 10:27 AM Justin Pryzby  wrote:
>
> On Tue, Jan 03, 2023 at 03:39:22PM -0600, Justin Pryzby wrote:
> > On Tue, Jan 03, 2023 at 04:28:29PM +0900, Michael Paquier wrote:
> > > On Fri, Dec 30, 2022 at 05:12:57PM -0600, Justin Pryzby wrote:
> > >
> > >  # Use larger ccache cache, as this task compiles with multiple 
> > > compilers /
> > >  # flag combinations
> > > -CCACHE_MAXSIZE: "1GB"
> > > +CCACHE_MAXSIZE: "1G"
> > >
> > > In 0006, I am not sure how much this matters.  Perhaps somebody more
> > > fluent with Cirrus, though, has a different opinion..
> >
> > It's got almost nothing to do with cirrus.  It's an environment
> > variable, and we're using a suffix other than what's
> > supported/documented by ccache, which only happens to work.
> >
> > > 0014 and 0013 do not reduce the translation workload, as the messages
> > > include some stuff specific to the GUC names accessed to, or some
> > > specific details about the code paths triggered.
> >
> > It seems to matter because otherwise the translators sometimes re-type
> > the view name, which (not surprisingly) can get messed up, which is how
> > I mentioned having noticed this.
> >
> > On Tue, Jan 03, 2023 at 05:41:58PM +0900, Michael Paquier wrote:
> > > On Tue, Jan 03, 2023 at 01:03:01PM +0530, Amit Kapila wrote:
> > > > One minor comment:
> > > > -spoken in Belgium (BE), with a UTF-8
> > > > character set
> > > > +spoken in Belgium (BE), with a UTF-8
> > > > character set
> > > >
> > > > Shouldn't this be UTF8 as we are using in
> > > > func.sgml?
> > >
> > > Yeah, I was wondering as well why this change is not worse, which is
> > > why I left it out of 33ab0a2.  There is an acronym for UTF in
> > > acronym.sgml, which makes sense to me, but that's the only place where
> > > this is used.  To add more on top of that, the docs basically need
> > > only UTF8, and we have three references to UTF-16, none of them using
> > > the  markup.
> >
> > I changed it for consistency, as it's the only thing that says <>UTF-8<>
> > anywhere, and charset.sgml already says <>UTF<>-8 elsewhere.
> >
> > Alternately, I suggest to change charset to say <>UTF8<> in both places.
>
> As attached.
> This also fixes "specualtive" in Amit's recent commit.
>

Thanks for noticing this. I'll take care of this and some other typo
patches together.

-- 
With Regards,
Amit Kapila.




Re: typos

2023-01-09 Thread Justin Pryzby
On Tue, Jan 03, 2023 at 03:39:22PM -0600, Justin Pryzby wrote:
> On Tue, Jan 03, 2023 at 04:28:29PM +0900, Michael Paquier wrote:
> > On Fri, Dec 30, 2022 at 05:12:57PM -0600, Justin Pryzby wrote:
> > 
> >  # Use larger ccache cache, as this task compiles with multiple 
> > compilers /
> >  # flag combinations
> > -CCACHE_MAXSIZE: "1GB"
> > +CCACHE_MAXSIZE: "1G"
> > 
> > In 0006, I am not sure how much this matters.  Perhaps somebody more
> > fluent with Cirrus, though, has a different opinion..
> 
> It's got almost nothing to do with cirrus.  It's an environment
> variable, and we're using a suffix other than what's
> supported/documented by ccache, which only happens to work.
> 
> > 0014 and 0013 do not reduce the translation workload, as the messages
> > include some stuff specific to the GUC names accessed to, or some
> > specific details about the code paths triggered.
> 
> It seems to matter because otherwise the translators sometimes re-type
> the view name, which (not surprisingly) can get messed up, which is how
> I mentioned having noticed this.
> 
> On Tue, Jan 03, 2023 at 05:41:58PM +0900, Michael Paquier wrote:
> > On Tue, Jan 03, 2023 at 01:03:01PM +0530, Amit Kapila wrote:
> > > One minor comment:
> > > -spoken in Belgium (BE), with a UTF-8
> > > character set
> > > +spoken in Belgium (BE), with a UTF-8
> > > character set
> > > 
> > > Shouldn't this be UTF8 as we are using in
> > > func.sgml?
> > 
> > Yeah, I was wondering as well why this change is not worse, which is
> > why I left it out of 33ab0a2.  There is an acronym for UTF in
> > acronym.sgml, which makes sense to me, but that's the only place where 
> > this is used.  To add more on top of that, the docs basically need
> > only UTF8, and we have three references to UTF-16, none of them using
> > the  markup.
> 
> I changed it for consistency, as it's the only thing that says <>UTF-8<>
> anywhere, and charset.sgml already says <>UTF<>-8 elsewhere.
> 
> Alternately, I suggest to change charset to say <>UTF8<> in both places.

As attached.
This also fixes "specualtive" in Amit's recent commit.

-- 
Justin
>From 8b56d6007e13e3b42bc75da3b9174ecab8a8dd70 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 25 Sep 2022 18:40:36 -0500
Subject: [PATCH 1/9] typos

---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 69837bcd5ad..048a004e309 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -655,7 +655,7 @@ task:
 
 # Use larger ccache cache, as this task compiles with multiple compilers /
 # flag combinations
-CCACHE_MAXSIZE: "1GB"
+CCACHE_MAXSIZE: "1G"
 CCACHE_DIR: "/tmp/ccache_dir"
 
 LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-- 
2.25.1

>From c082768a857ebd7a0a534ee497761dca0c621f64 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 26 Sep 2021 11:13:27 -0500
Subject: [PATCH 2/9] comments grammar: extended (and other) stats

See:
202109272104.7t253iw236fb@alvherre.pgsql
070d2e19e40897d857f570f24888fc30727ed9c0
609b0652af00374b89411ea2613fd5bb92bca92c
a4d75c86bf15220df22de0a92c819ecef9db3849
7300a699502fe5432b05fbc75baca534b080bebb
ccaa3569f58796868303629bc2d63b599b38
---
 src/backend/commands/statscmds.c | 4 ++--
 src/backend/statistics/README| 2 +-
 src/backend/statistics/dependencies.c| 8 
 src/backend/statistics/extended_stats.c  | 4 ++--
 src/backend/utils/adt/pgstatfuncs.c  | 4 ++--
 src/backend/utils/adt/ruleutils.c| 2 +-
 src/include/statistics/extended_stats_internal.h | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c
index 26ebd0819d6..2e41745646b 100644
--- a/src/backend/commands/statscmds.c
+++ b/src/backend/commands/statscmds.c
@@ -377,7 +377,7 @@ CreateStatistics(CreateStatsStmt *stmt)
 
 	/*
 	 * If no statistic type was specified, build them all (but only when the
-	 * statistics is defined on more than one column/expression).
+	 * statistics object is defined on more than one column/expression).
 	 */
 	if ((!requested_type) && (numcols >= 2))
 	{
@@ -432,7 +432,7 @@ CreateStatistics(CreateStatsStmt *stmt)
 	 * similar to why we don't bother with extracting columns from
 	 * expressions. It's either expensive or very easy to defeat for
 	 * determined user, and there's no risk if we allow such statistics (the
-	 * statistics is useless, but harmless).
+	 * statistic is useless, but harmless).
 	 */
 	

Re: typos

2023-01-03 Thread Justin Pryzby
On Tue, Jan 03, 2023 at 04:28:29PM +0900, Michael Paquier wrote:
> On Fri, Dec 30, 2022 at 05:12:57PM -0600, Justin Pryzby wrote:
> 
>  # Use larger ccache cache, as this task compiles with multiple compilers 
> /
>  # flag combinations
> -CCACHE_MAXSIZE: "1GB"
> +CCACHE_MAXSIZE: "1G"
> 
> In 0006, I am not sure how much this matters.  Perhaps somebody more
> fluent with Cirrus, though, has a different opinion..

It's got almost nothing to do with cirrus.  It's an environment
variable, and we're using a suffix other than what's
supported/documented by ccache, which only happens to work.

> 0014 and 0013 do not reduce the translation workload, as the messages
> include some stuff specific to the GUC names accessed to, or some
> specific details about the code paths triggered.

It seems to matter because otherwise the translators sometimes re-type
the view name, which (not surprisingly) can get messed up, which is how
I mentioned having noticed this.

On Tue, Jan 03, 2023 at 05:41:58PM +0900, Michael Paquier wrote:
> On Tue, Jan 03, 2023 at 01:03:01PM +0530, Amit Kapila wrote:
> > One minor comment:
> > -spoken in Belgium (BE), with a UTF-8
> > character set
> > +spoken in Belgium (BE), with a UTF-8
> > character set
> > 
> > Shouldn't this be UTF8 as we are using in
> > func.sgml?
> 
> Yeah, I was wondering as well why this change is not worse, which is
> why I left it out of 33ab0a2.  There is an acronym for UTF in
> acronym.sgml, which makes sense to me, but that's the only place where 
> this is used.  To add more on top of that, the docs basically need
> only UTF8, and we have three references to UTF-16, none of them using
> the  markup.

I changed it for consistency, as it's the only thing that says <>UTF-8<>
anywhere, and charset.sgml already says <>UTF<>-8 elsewhere.

Alternately, I suggest to change charset to say <>UTF8<> in both places.

-- 
Justin




Re: typos

2023-01-03 Thread Peter Eisentraut

On 03.01.23 09:41, Michael Paquier wrote:

On Tue, Jan 03, 2023 at 01:03:01PM +0530, Amit Kapila wrote:

One minor comment:
-spoken in Belgium (BE), with a UTF-8 character set
+spoken in Belgium (BE), with a UTF-8 character set

Shouldn't this be UTF8 as we are using in func.sgml?


Yeah, I was wondering as well why this change is not worse, which is
why I left it out of 33ab0a2.  There is an acronym for UTF in
acronym.sgml, which makes sense to me, but that's the only place where
this is used.  To add more on top of that, the docs basically need
only UTF8, and we have three references to UTF-16, none of them using
the  markup.


The thing is called "UTF-8".  Here, we are not talking about the 
PostgreSQL identifier.






Re: typos

2023-01-03 Thread Michael Paquier
On Tue, Jan 03, 2023 at 01:03:01PM +0530, Amit Kapila wrote:
> One minor comment:
> -spoken in Belgium (BE), with a UTF-8 character set
> +spoken in Belgium (BE), with a UTF-8 character set
> 
> Shouldn't this be UTF8 as we are using in func.sgml?

Yeah, I was wondering as well why this change is not worse, which is
why I left it out of 33ab0a2.  There is an acronym for UTF in
acronym.sgml, which makes sense to me, but that's the only place where 
this is used.  To add more on top of that, the docs basically need
only UTF8, and we have three references to UTF-16, none of them using
the  markup.
--
Michael


signature.asc
Description: PGP signature


Re: typos

2023-01-02 Thread Amit Kapila
On Tue, Jan 3, 2023 at 12:58 PM Michael Paquier  wrote:
>
> On Fri, Dec 30, 2022 at 05:12:57PM -0600, Justin Pryzby wrote:
>
>  # Use larger ccache cache, as this task compiles with multiple compilers 
> /
>  # flag combinations
> -CCACHE_MAXSIZE: "1GB"
> +CCACHE_MAXSIZE: "1G"
>
> In 0006, I am not sure how much this matters.
>

The other places in that file use M, so maybe, this is more consistent.

One minor comment:
-spoken in Belgium (BE), with a UTF-8 character set
+spoken in Belgium (BE), with a UTF-8 character set

Shouldn't this be UTF8 as we are using in func.sgml?

-- 
With Regards,
Amit Kapila.




Re: typos

2023-01-02 Thread Michael Paquier
On Fri, Dec 30, 2022 at 05:12:57PM -0600, Justin Pryzby wrote:

 # Use larger ccache cache, as this task compiles with multiple compilers /
 # flag combinations
-CCACHE_MAXSIZE: "1GB"
+CCACHE_MAXSIZE: "1G"

In 0006, I am not sure how much this matters.  Perhaps somebody more
fluent with Cirrus, though, has a different opinion..

  * pointer to this structure.  The information here must be sufficient to
  * properly initialize each new TableScanDesc as workers join the scan, and it
- * must act as a information what to scan for those workers.
+ * must provide information what to scan for those workers.

This comment in 0009 is obviously incorrect, but I am not sure whether
your new suggestion is an improvement.  Do workers provide such
information or has this structure some information that the workers
rely on?

Not sure that the whitespace issue in 0021 for the header of inval.c
is worth caring about.

0014 and 0013 do not reduce the translation workload, as the messages
include some stuff specific to the GUC names accessed to, or some
specific details about the code paths triggered.

The rest has been applied where they matter.
--
Michael


signature.asc
Description: PGP signature


typos

2022-12-30 Thread Justin Pryzby
/sgml/ref/create_subscription.sgml
index f9a1776380b..90bd70050dd 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -383,7 +383,7 @@ CREATE SUBSCRIPTION subscription_nameFOR TABLES IN SCHEMA, rows are always published
regardless of the definition of the other expressions.
If the subscriber is a PostgreSQL version before
-   15 then any row filtering is ignored during the initial data synchronization
+   15, then any row filtering is ignored during the initial data synchronization
phase. For this case, the user might want to consider deleting any initially
copied data that would be incompatible with subsequent filtering.
Because initial data synchronization does not take into account the publication
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 5186d75d616..e0a6f775b6e 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -935,8 +935,8 @@ BETTER: unrecognized node type: 42

 Function-Like Macros and Inline Functions
 
- Both, macros with arguments and static inline
- functions, may be used. The latter are preferable if there are
+ Both macros with arguments and static inline
+ functions may be used. The latter are preferable if there are
  multiple-evaluation hazards when written as a macro, as e.g., the
  case with
 
-- 
2.25.1

>From 759288c53d30d32c608d0316df06f645ffa4dccf Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 25 Sep 2022 18:40:36 -0500
Subject: [PATCH 06/16] typos

---
 .cirrus.yml   | 12 ++--
 doc/src/sgml/ref/grant.sgml   |  2 +-
 meson.build   |  4 ++--
 src/backend/optimizer/util/tlist.c|  2 +-
 src/bin/pg_dump/pg_dumpall.c  |  2 +-
 src/include/lib/ilist.h   |  2 +-
 src/test/regress/expected/copy.out|  2 +-
 src/test/regress/expected/expressions.out |  2 +-
 src/test/regress/sql/copy.sql |  2 +-
 src/test/regress/sql/expressions.sql  |  2 +-
 src/test/ssl/t/SSL/Server.pm  |  2 +-
 11 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 993af888659..082ba84c2b2 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -11,7 +11,7 @@ env:
   CONTAINER_REPO: us-docker.pkg.dev/${GCP_PROJECT}/ci
 
   # The lower depth accelerates git clone. Use a bit of depth so that
-  # concurrent tasks and retrying older jobs has a chance of working.
+  # concurrent tasks and retrying older jobs have a chance of working.
   CIRRUS_CLONE_DEPTH: 500
   # Useful to be able to analyse what in a script takes long
   CIRRUS_LOG_TIMESTAMP: true
@@ -47,7 +47,7 @@ on_failure_meson: &on_failure_meson
 
   # In theory it'd be nice to upload the junit files meson generates, so that
   # cirrus will nicely annotate the commit. Unfortunately the files don't
-  # contain identifieable file + line numbers right now, so the annotations
+  # contain identifiable file + line numbers right now, so the annotations
   # don't end up useful. We could probably improve on that with a some custom
   # conversion script, but ...
   meson_log_artifacts:
@@ -160,7 +160,7 @@ task:
 
   ccache_cache:
 folder: $CCACHE_DIR
-  # Workaround around performance issues due to 32KB block size
+  # Work around performance issues due to 32KB block size
   repartition_script: src/tools/ci/gcp_freebsd_repartition.sh
   create_user_script: |
 pw useradd postgres
@@ -251,7 +251,7 @@ task:
 DEBUGINFOD_URLS: "https://debuginfod.debian.net";
 
 # Enable a reasonable set of sanitizers. Use the linux task for that, as
-# it one of the fastest tasks (without sanitizers). Also several of the
+# it's one of the fastest tasks (without sanitizers). Also several of the
 # sanitizers work best on linux.
 #
 # The overhead of alignment sanitizer is low, undefined behaviour has
@@ -600,7 +600,7 @@ task:
 CCACHE_MAXSIZE: "500M"
 CCACHE_SLOPPINESS: pch_defines,time_macros
 CCACHE_DEPEND: 1
-# for some reason mingw plpython cannot find it's installation without this
+# for some reason mingw plpython cannot find its installation without this
 PYTHONHOME: C:/msys64/ucrt64
 # prevents MSYS bash from resetting error mode
 MSYS: winjitdebug
@@ -655,7 +655,7 @@ task:
 
 # Use larger ccache cache, as this task compiles with multiple compilers /
 # flag combinations
-CCACHE_MAXSIZE: "1GB"
+CCACHE_MAXSIZE: "1G"
 CCACHE_DIR: "/tmp/ccache_dir"
 
 LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml
index c8ca2b1d641..518bdb32d82 100644
--- a/doc/src/sgml/ref/grant.sgml
+++ b/doc/src/sgml/ref/grant.sgml
@@ -253,7 +253,7 @@ GRANT role_name [, ...] TO 
 
diff --git a/meson.build b/meson.build
index b872470cd

Re: pgsql: Fix typos and bump catversion.

2022-11-19 Thread Joe Conway

On 11/19/22 17:24, Tom Lane wrote:

Andres Freund  writes:

On 2022-11-19 17:10:57 -0500, Joe Conway wrote:

Rishu Bagga pointed out to me offlist that this catversion bump seems
flawed:
 /* mmddN */
-#define CATALOG_VERSION_NO 202211121
+#define CATALOG_VERSION_NO 202211821



I think that should be 202211181, no? I am not clear on the desirable way to
fix though :-/



I think it's fine to just update to a "normal" catversion.


Yeah, just fix it --- and the sooner the better, to avoid the risk
that this becomes a value that someone needs to care about.



WFM, done

--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





Re: pgsql: Fix typos and bump catversion.

2022-11-19 Thread Tom Lane
Andres Freund  writes:
> On 2022-11-19 17:10:57 -0500, Joe Conway wrote:
>> Rishu Bagga pointed out to me offlist that this catversion bump seems
>> flawed:
>>  /* mmddN */
>> -#define CATALOG_VERSION_NO 202211121
>> +#define CATALOG_VERSION_NO 202211821

>> I think that should be 202211181, no? I am not clear on the desirable way to
>> fix though :-/

> I think it's fine to just update to a "normal" catversion.

Yeah, just fix it --- and the sooner the better, to avoid the risk
that this becomes a value that someone needs to care about.

regards, tom lane




Re: pgsql: Fix typos and bump catversion.

2022-11-19 Thread Andres Freund
Hi,

On 2022-11-19 17:10:57 -0500, Joe Conway wrote:
> Rishu Bagga pointed out to me offlist that this catversion bump seems
> flawed:
> 
> diff --git a/src/include/catalog/catversion.h
> b/src/include/catalog/catversion.h
> index 
> c6ef593207c227ce10b0c897379476b553974f67..b3a57136b755fed182b4518330e65786032db870
> 100644 (file)
> --- a/src/include/catalog/catversion.h
> +++ b/src/include/catalog/catversion.h
> @@ -57,6 +57,6 @@
>   */
> 
>  /* mmddN */
> -#define CATALOG_VERSION_NO 202211121
> +#define CATALOG_VERSION_NO 202211821
> 
>  #endif
> 
> I think that should be 202211181, no? I am not clear on the desirable way to
> fix though :-/

I think it's fine to just update to a "normal" catversion. We really just
match for an exact match with a few exceptions (somewhere in pg_upgrade IIRC),
and those exceptions don't really matter for some individual commit on the
development branch.

Greetings,

Andres Freund




Re: pgsql: Fix typos and bump catversion.

2022-11-19 Thread Joe Conway

On 11/18/22 16:18, Robert Haas wrote:

Fix typos and bump catversion.

Typos reported by Álvaro Herrera and Erik Rijkers.

Catversion bump for 3d14e171e9e2236139e8976f3309a588bcc8683b was
inadvertently omitted.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/2fb6154fcd769b2d4ea1226788e0ec2fc3522cb8

Modified Files
--
doc/src/sgml/ref/grant.sgml  | 2 +-
src/bin/pg_dump/pg_dumpall.c | 1 -
src/include/catalog/catversion.h | 2 +-


Rishu Bagga pointed out to me offlist that this catversion bump seems 
flawed:


diff --git a/src/include/catalog/catversion.h 
b/src/include/catalog/catversion.h
index 
c6ef593207c227ce10b0c897379476b553974f67..b3a57136b755fed182b4518330e65786032db870 
100644 (file)

--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
  */

 /* mmddN */
-#define CATALOG_VERSION_NO 202211121
+#define CATALOG_VERSION_NO 202211821

 #endif

I think that should be 202211181, no? I am not clear on the desirable 
way to fix though :-/


Joe
--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





Re: Fix typos in code comments

2022-09-25 Thread Amit Kapila
On Sat, Sep 24, 2022 at 4:00 AM Justin Pryzby  wrote:
>
> On Mon, Sep 19, 2022 at 06:10:00AM -0500, Justin Pryzby wrote:
> > On Mon, Sep 19, 2022 at 11:05:24AM +0800, Zhang Mingli wrote:
> > > Good catch. There is a similar typo in doc, runtime.sgml.
> > > ```using TLS protocols enabled by by setting the parameter```
> >
> > That one should be backpatched to v15.
>
> This is still needed -- "by by"
>

Thanks for the reminder. I have pushed the fix.

-- 
With Regards,
Amit Kapila.




Re: Fix typos in code comments

2022-09-23 Thread Justin Pryzby
On Mon, Sep 19, 2022 at 06:10:00AM -0500, Justin Pryzby wrote:
> On Mon, Sep 19, 2022 at 11:05:24AM +0800, Zhang Mingli wrote:
> > Good catch. There is a similar typo in doc, runtime.sgml.
> > ```using TLS protocols enabled by by setting the parameter```
> 
> That one should be backpatched to v15.

This is still needed -- "by by"

-- 
Justin




Re: Fix typos in code comments

2022-09-19 Thread David Rowley
On Mon, 19 Sept 2022 at 23:10, Justin Pryzby  wrote:
> Find below some others.

Thanks. Pushed.

David




Re: Fix typos in code comments

2022-09-19 Thread Justin Pryzby
On Mon, Sep 19, 2022 at 02:44:12AM +, houzj.f...@fujitsu.com wrote:
> While working on some other patches, I found serval typos(duplicate words and
> incorrect function name reference) in the code comments. Here is a small patch
> to fix them.

Thanks.

On Mon, Sep 19, 2022 at 11:05:24AM +0800, Zhang Mingli wrote:
> Good catch. There is a similar typo in doc, runtime.sgml.
> ```using TLS protocols enabled by by setting the parameter```

That one should be backpatched to v15.

Find below some others.

diff --git a/src/backend/executor/execPartition.c 
b/src/backend/executor/execPartition.c
index 901dd435efd..160296e1daf 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -2155,7 +2155,7 @@ InitPartitionPruneContext(PartitionPruneContext *context,
  * Current values of the indexes present in PartitionPruneState count all the
  * subplans that would be present before initial pruning was done.  If initial
  * pruning got rid of some of the subplans, any subsequent pruning passes will
- * will be looking at a different set of target subplans to choose from than
+ * be looking at a different set of target subplans to choose from than
  * those in the pre-initial-pruning set, so the maps in PartitionPruneState
  * containing those indexes must be updated to reflect the new indexes of
  * subplans in the post-initial-pruning set.
diff --git a/src/backend/utils/activity/pgstat.c 
b/src/backend/utils/activity/pgstat.c
index 6224c498c21..5b0f26e3b07 100644
--- a/src/backend/utils/activity/pgstat.c
+++ b/src/backend/utils/activity/pgstat.c
@@ -556,7 +556,7 @@ pgstat_initialize(void)
  * suggested idle timeout is returned. Currently this is always
  * PGSTAT_IDLE_INTERVAL (1ms). Callers can use the returned time to set up
  * a timeout after which to call pgstat_report_stat(true), but are not
- * required to to do so.
+ * required to do so.
  *
  * Note that this is called only when not within a transaction, so it is fair
  * to use transaction stop time as an approximation of current time.
diff --git a/src/backend/utils/activity/pgstat_replslot.c 
b/src/backend/utils/activity/pgstat_replslot.c
index b77c05ab5fa..9a59012a855 100644
--- a/src/backend/utils/activity/pgstat_replslot.c
+++ b/src/backend/utils/activity/pgstat_replslot.c
@@ -8,7 +8,7 @@
  * storage implementation and the details about individual types of
  * statistics.
  *
- * Replication slot stats work a bit different than other other
+ * Replication slot stats work a bit different than other
  * variable-numbered stats. Slots do not have oids (so they can be created on
  * physical replicas). Use the slot index as object id while running. However,
  * the slot index can change when restarting. That is addressed by using the
diff --git a/src/test/ssl/t/SSL/Server.pm b/src/test/ssl/t/SSL/Server.pm
index 62f54dcbf16..0a9e5da01e4 100644
--- a/src/test/ssl/t/SSL/Server.pm
+++ b/src/test/ssl/t/SSL/Server.pm
@@ -257,7 +257,7 @@ The certificate file to use. Implementation is SSL backend 
specific.
 
 =item keyfile => B
 
-The private key to to use. Implementation is SSL backend specific.
+The private key file to use. Implementation is SSL backend specific.
 
 =item crlfile => B
 




Re: Fix typos in code comments

2022-09-18 Thread Zhang Mingli
Hi
On Sep 19, 2022, 10:57 +0800, Amit Kapila , wrote:
> On Mon, Sep 19, 2022 at 8:14 AM houzj.f...@fujitsu.com
>  wrote:
> >
> > While working on some other patches, I found serval typos(duplicate words 
> > and
> > incorrect function name reference) in the code comments. Here is a small 
> > patch
> > to fix them.
> >
>
> Thanks, the patch looks good to me. I'll push this.
>
> --
> With Regards,
> Amit Kapila.
>
>
Good catch. There is a similar typo in doc, runtime.sgml.

```using TLS protocols enabled by by setting the parameter```


Re: Fix typos in code comments

2022-09-18 Thread Amit Kapila
On Mon, Sep 19, 2022 at 8:14 AM houzj.f...@fujitsu.com
 wrote:
>
> While working on some other patches, I found serval typos(duplicate words and
> incorrect function name reference) in the code comments. Here is a small patch
> to fix them.
>

Thanks, the patch looks good to me. I'll push this.

-- 
With Regards,
Amit Kapila.




Fix typos in code comments

2022-09-18 Thread houzj.f...@fujitsu.com
Hi,

While working on some other patches, I found serval typos(duplicate words and
incorrect function name reference) in the code comments. Here is a small patch
to fix them.

Best regards,
Hou zhijie



0001-fix-typos.patch
Description: 0001-fix-typos.patch


Re: fix typos

2022-08-17 Thread John Naylor
On Tue, Aug 16, 2022 at 8:48 AM John Naylor
 wrote:
>
> On Fri, Aug 12, 2022 at 8:55 PM Tom Lane  wrote:
> >
> > John Naylor  writes:
> > > This is really a straw-man proposal, since I'm not volunteering to do
> > > the work, or suggest anybody else should do the same. That being the
> > > case, it seems we should just go ahead with Justin's patch for
> > > consistency. Possibly we could also change the messages to say "ID"?
> >
> > I'd be content if we change the user-facing messages (and documentation
> > if any) to say "ID" not "OID".
>
> The documentation has both, so it makes sense to standardize on "ID".
> The messages all had oid/OID, which I changed in the attached. I think
> I got all the places.
>
> I'm thinking it's not wrong enough to confuse people, but consistency
> is good, so backpatch to v15 and no further. Does anyone want to make
> a case otherwise?

This is done.

-- 
John Naylor
EDB: http://www.enterprisedb.com




Re: fix typos

2022-08-15 Thread John Naylor
On Fri, Aug 12, 2022 at 8:55 PM Tom Lane  wrote:
>
> John Naylor  writes:
> > This is really a straw-man proposal, since I'm not volunteering to do
> > the work, or suggest anybody else should do the same. That being the
> > case, it seems we should just go ahead with Justin's patch for
> > consistency. Possibly we could also change the messages to say "ID"?
>
> I'd be content if we change the user-facing messages (and documentation
> if any) to say "ID" not "OID".

The documentation has both, so it makes sense to standardize on "ID".
The messages all had oid/OID, which I changed in the attached. I think
I got all the places.

I'm thinking it's not wrong enough to confuse people, but consistency
is good, so backpatch to v15 and no further. Does anyone want to make
a case otherwise?

-- 
John Naylor
EDB: http://www.enterprisedb.com
diff --git a/doc/src/sgml/replication-origins.sgml b/doc/src/sgml/replication-origins.sgml
index 7e02c4605b..bb0fb624d2 100644
--- a/doc/src/sgml/replication-origins.sgml
+++ b/doc/src/sgml/replication-origins.sgml
@@ -27,12 +27,12 @@
  
 
  
-  Replication origins have just two properties, a name and an OID. The name,
+  Replication origins have just two properties, a name and an ID. The name,
   which is what should be used to refer to the origin across systems, is
   free-form text. It should be used in a way that makes conflicts
   between replication origins created by different replication solutions
   unlikely; e.g., by prefixing the replication solution's name to it.
-  The OID is used only to avoid having to store the long version
+  The ID is used only to avoid having to store the long version
   in situations where space efficiency is important. It should never be shared
   across systems.
  
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index c72ad6b93d..9eb97fac58 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -328,7 +328,7 @@ replorigin_create(const char *roname)
 	if (tuple == NULL)
 		ereport(ERROR,
 (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("could not find free replication origin OID")));
+ errmsg("could not find free replication origin ID")));
 
 	heap_freetuple(tuple);
 	return roident;
@@ -364,7 +364,7 @@ restart:
 if (nowait)
 	ereport(ERROR,
 			(errcode(ERRCODE_OBJECT_IN_USE),
-			 errmsg("could not drop replication origin with OID %d, in use by PID %d",
+			 errmsg("could not drop replication origin with ID %u, in use by PID %d",
 	state->roident,
 	state->acquired_by)));
 
@@ -408,7 +408,7 @@ restart:
 	 */
 	tuple = SearchSysCache1(REPLORIGIDENT, ObjectIdGetDatum(roident));
 	if (!HeapTupleIsValid(tuple))
-		elog(ERROR, "cache lookup failed for replication origin with oid %u",
+		elog(ERROR, "cache lookup failed for replication origin with ID %u",
 			 roident);
 
 	CatalogTupleDelete(rel, &tuple->t_self);
@@ -485,7 +485,7 @@ replorigin_by_oid(RepOriginId roident, bool missing_ok, char **roname)
 		if (!missing_ok)
 			ereport(ERROR,
 	(errcode(ERRCODE_UNDEFINED_OBJECT),
-	 errmsg("replication origin with OID %u does not exist",
+	 errmsg("replication origin with ID %u does not exist",
 			roident)));
 
 		return false;
@@ -937,7 +937,7 @@ replorigin_advance(RepOriginId node,
 		{
 			ereport(ERROR,
 	(errcode(ERRCODE_OBJECT_IN_USE),
-	 errmsg("replication origin with OID %d is already active for PID %d",
+	 errmsg("replication origin with ID %u is already active for PID %d",
 			replication_state->roident,
 			replication_state->acquired_by)));
 		}
@@ -948,7 +948,7 @@ replorigin_advance(RepOriginId node,
 	if (replication_state == NULL && free_state == NULL)
 		ereport(ERROR,
 (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("could not find free replication state slot for replication origin with OID %u",
+ errmsg("could not find free replication state slot for replication origin with ID %u",
 		node),
  errhint("Increase max_replication_slots and try again.")));
 
@@ -1126,7 +1126,7 @@ replorigin_session_setup(RepOriginId node)
 		{
 			ereport(ERROR,
 	(errcode(ERRCODE_OBJECT_IN_USE),
-	 errmsg("replication origin with OID %d is already active for PID %d",
+	 errmsg("replication origin with ID %u is already active for PID %d",
 			curstate->roident, curstate->acquired_by)));
 		}
 
@@ -1138,7 +1138,7 @@ replorigin_session_setup(RepOriginId node)
 	if (session_replication_state == NULL && free_slot == -1)
 		ereport(ERROR,
 (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("could not find free replication state slot for replication origin with OID %u",
+ errmsg("could not find free replication state slot for replication origin with ID %u",
 		node),
  errhint("Increase max_replication_slots and try again.")));
 	else if (session_replication_state == NULL)


Re: fix typos

2022-08-12 Thread Tom Lane
John Naylor  writes:
> This is really a straw-man proposal, since I'm not volunteering to do
> the work, or suggest anybody else should do the same. That being the
> case, it seems we should just go ahead with Justin's patch for
> consistency. Possibly we could also change the messages to say "ID"?

I'd be content if we change the user-facing messages (and documentation
if any) to say "ID" not "OID".

regards, tom lane




Re: fix typos

2022-08-12 Thread Euler Taveira
On Fri, Aug 12, 2022, at 3:59 AM, John Naylor wrote:
> This is really a straw-man proposal, since I'm not volunteering to do
> the work, or suggest anybody else should do the same. That being the
> case, it seems we should just go ahead with Justin's patch for
> consistency. Possibly we could also change the messages to say "ID"?
... or say

could not drop replication origin %u, in use by PID %d

AFAICS there is no "with ID" but there is "with identifier". I personally
prefer to omit these additional words; it seems clear without them.


--
Euler Taveira
EDB   https://www.enterprisedb.com/


Re: fix typos

2022-08-11 Thread John Naylor
I wrote:

> On Thu, Aug 4, 2022 at 8:41 PM Tom Lane  wrote:
> >
> > John Naylor  writes:
>
> > > RepOriginId is a typedef for uint16, so this can't print the wrong answer,
> > > but it is inconsistent with other uses. So it seems we don't need to
> > > backpatch this one?
> >
> > Um ... if it's int16, then it can't be an OID, so I'd say this message has
> > far worse problems than %d vs %u.  It should not use that terminology.
>
> The catalog has the following. Since it's not a real oid, maybe this column 
> should be rethought?

This is really a straw-man proposal, since I'm not volunteering to do
the work, or suggest anybody else should do the same. That being the
case, it seems we should just go ahead with Justin's patch for
consistency. Possibly we could also change the messages to say "ID"?

> CATALOG(pg_replication_origin,6000,ReplicationOriginRelationId) 
> BKI_SHARED_RELATION
> {
> /*
> * Locally known id that get included into WAL.
> *
> * This should never leave the system.
> *
> * Needs to fit into an uint16, so we don't waste too much space in WAL
> * records. For this reason we don't use a normal Oid column here, since
> * we need to handle allocation of new values manually.
> */
> Oid roident;

-- 
John Naylor
EDB: http://www.enterprisedb.com




Re: fix typos

2022-08-04 Thread John Naylor
On Thu, Aug 4, 2022 at 8:41 PM Tom Lane  wrote:
>
> John Naylor  writes:

> > RepOriginId is a typedef for uint16, so this can't print the wrong
answer,
> > but it is inconsistent with other uses. So it seems we don't need to
> > backpatch this one?
>
> Um ... if it's int16, then it can't be an OID, so I'd say this message has
> far worse problems than %d vs %u.  It should not use that terminology.

The catalog has the following. Since it's not a real oid, maybe this column
should be rethought?

CATALOG(pg_replication_origin,6000,ReplicationOriginRelationId)
BKI_SHARED_RELATION
{
/*
* Locally known id that get included into WAL.
*
* This should never leave the system.
*
* Needs to fit into an uint16, so we don't waste too much space in WAL
* records. For this reason we don't use a normal Oid column here, since
* we need to handle allocation of new values manually.
*/
Oid roident;
[...]

--
John Naylor
EDB: http://www.enterprisedb.com


Re: fix typos

2022-08-04 Thread Tom Lane
John Naylor  writes:
> On Tue, Aug 2, 2022 at 1:11 AM Justin Pryzby  wrote:
>   ereport(ERROR,
>   (errcode(ERRCODE_OBJECT_IN_USE),
> - errmsg("could not drop replication origin with OID %d, in use by PID %d",
> + errmsg("could not drop replication origin with OID %u, in use by PID %d",

> RepOriginId is a typedef for uint16, so this can't print the wrong answer,
> but it is inconsistent with other uses. So it seems we don't need to
> backpatch this one?

Um ... if it's int16, then it can't be an OID, so I'd say this message has
far worse problems than %d vs %u.  It should not use that terminology.

regards, tom lane




Re: fix typos

2022-08-04 Thread John Naylor
On Tue, Aug 2, 2022 at 1:11 AM Justin Pryzby  wrote:
>
> On Mon, Aug 01, 2022 at 08:04:54PM +0200, Erik Rijkers wrote:
> > Recent typos...
>
> LGTM, thanks.
>
> Here are some others I've been sitting on, mostly in .c files.

I pushed Robert's suggestion, then pushed the rest of Erik's changes and
two of Justin's. For Justin's 0004:

--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -364,7 +364,7 @@ restart:
  if (nowait)
  ereport(ERROR,
  (errcode(ERRCODE_OBJECT_IN_USE),
- errmsg("could not drop replication origin with OID %d, in use by PID %d",
+ errmsg("could not drop replication origin with OID %u, in use by PID %d",

RepOriginId is a typedef for uint16, so this can't print the wrong answer,
but it is inconsistent with other uses. So it seems we don't need to
backpatch this one?

For patch 0002, the whitespace issue in the top comment in inval.c, I'm
inclined to just change all the out-of-place tabs in a single commit, so we
can add that to the list of whitespace commits.

--
John Naylor
EDB: http://www.enterprisedb.com


Re: fix typos

2022-08-04 Thread John Naylor
On Wed, Aug 3, 2022 at 11:41 PM Robert Haas  wrote:
>
> I think that it's talking about this (documented) syntax:
>
> ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
> [ NO ] DEPENDS ON EXTENSION extension_name
>
> So the change from "depends" to "depend" here is incorrect. Maybe we
> can say something like:
>
> the DEPENDS ON EXTENSION
> extension_name action
>
> (I haven't tested whether this markup works.)

Makes sense, I'll go make it happen.

--
John Naylor
EDB: http://www.enterprisedb.com


Re: fix typos

2022-08-03 Thread Robert Haas
On Tue, Aug 2, 2022 at 4:32 AM Erik Rijkers  wrote:
> > The part of the sentence inside parentheses is not clear to me, before
> > or after the patch:
> >
> >  Dropping an extension causes its component objects, and other
> > explicitly
> >  dependent routines (see ,
> > -   the depends on extension action), to be dropped as well.
> > +   that depend on extension action), to be dropped as well.
> > 
> >
>
> Hm, I see what you mean, I did not notice that earlier and I won't make
> a guess as to intention.  Maybe Bruce can have another look? (commit
> 5fe2d4c56e)

I think that it's talking about this (documented) syntax:

ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
[ NO ] DEPENDS ON EXTENSION extension_name

So the change from "depends" to "depend" here is incorrect. Maybe we
can say something like:

the DEPENDS ON EXTENSION
extension_name action

(I haven't tested whether this markup works.)

-- 
Robert Haas
EDB: http://www.enterprisedb.com




Re: fix typos

2022-08-02 Thread Erik Rijkers

Op 02-08-2022 om 07:28 schreef John Naylor:


On Tue, Aug 2, 2022 at 1:05 AM Erik Rijkers <mailto:e...@xs4all.nl>> wrote:

 >
 > Recent typos...

The part of the sentence inside parentheses is not clear to me, before 
or after the patch:


     Dropping an extension causes its component objects, and other 
explicitly

     dependent routines (see ,
-   the depends on extension action), to be dropped as well.
+   that depend on extension action), to be dropped as well.
    



Hm, I see what you mean, I did not notice that earlier and I won't make 
a guess as to intention.  Maybe Bruce can have another look? (commit 
5fe2d4c56e)




--
John Naylor
EDB: http://www.enterprisedb.com <http://www.enterprisedb.com>





Re: fix typos

2022-08-01 Thread John Naylor
On Tue, Aug 2, 2022 at 1:11 AM Justin Pryzby  wrote:
>
> Here are some others I've been sitting on, mostly in .c files.

0002:
weird since c91560defc57f89f7e88632ea14ae77b5cec78ee

It was weird long before that, maybe we should instead change most of those
tabs in the top comment to single space, as is customary? The rest LGTM.

--
John Naylor
EDB: http://www.enterprisedb.com


Re: fix typos

2022-08-01 Thread John Naylor
On Tue, Aug 2, 2022 at 1:05 AM Erik Rijkers  wrote:
>
> Recent typos...

The part of the sentence inside parentheses is not clear to me, before or
after the patch:

Dropping an extension causes its component objects, and other explicitly
dependent routines (see ,
-   the depends on extension action), to be dropped as well.
+   that depend on extension action), to be dropped as well.
   

--
John Naylor
EDB: http://www.enterprisedb.com


Re: fix typos

2022-08-01 Thread Justin Pryzby
On Mon, Aug 01, 2022 at 08:04:54PM +0200, Erik Rijkers wrote:
> Recent typos...

LGTM, thanks.

Here are some others I've been sitting on, mostly in .c files.

-- 
Justin
>From 19f320438476aff2773440447f167d06051a0a47 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Tue, 5 Jul 2022 14:12:26 -0500
Subject: [PATCH 1/4] typos

---
 doc/src/sgml/brin.sgml  | 2 +-
 src/backend/commands/dbcommands.c   | 6 +++---
 src/include/replication/reorderbuffer.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index 4ee8908b65a..71697155d7c 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -75,7 +75,7 @@
summarized will cause the summary information to be updated with data
from the new tuples.
When a new page is created that does not fall within the last
-   summarized range, the range that the new page belongs into
+   summarized range, the range that the new page belongs to
does not automatically acquire a summary tuple;
those tuples remain unsummarized until a summarization run is
invoked later, creating the initial summary for that range.
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 7bc53f3a0bb..9f990a8d68f 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -188,7 +188,7 @@ CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid,
 
 		/*
 		 * If the relation is from the source db's default tablespace then we
-		 * need to create it in the destinations db's default tablespace.
+		 * need to create it in the destination db's default tablespace.
 		 * Otherwise, we need to create in the same tablespace as it is in the
 		 * source database.
 		 */
@@ -1351,8 +1351,8 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
 	/*
 	 * If we're going to be reading data for the to-be-created database into
 	 * shared_buffers, take a lock on it. Nobody should know that this
-	 * database exists yet, but it's good to maintain the invariant that a
-	 * lock an AccessExclusiveLock on the database is sufficient to drop all
+	 * database exists yet, but it's good to maintain the invariant that an
+	 * AccessExclusiveLock on the database is sufficient to drop all
 	 * of its buffers without worrying about more being read later.
 	 *
 	 * Note that we need to do this before entering the
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index d109d0baede..2c9206ace41 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -262,7 +262,7 @@ typedef struct ReorderBufferTXN
 	 * aborted. This can be a
 	 * * plain commit record
 	 * * plain commit record, of a parent transaction
-	 * * prepared tansaction
+	 * * prepared transaction
 	 * * prepared transaction commit
 	 * * plain abort record
 	 * * prepared transaction abort
-- 
2.17.1

>From 57b1a6001b2910c9a8002e72f22391255e8b8bb9 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sat, 23 Jul 2022 15:10:01 -0500
Subject: [PATCH 2/4] fix whitespace

weird since c91560defc57f89f7e88632ea14ae77b5cec78ee
---
 src/backend/utils/cache/inval.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index eb5782f82a4..c0e33c0f177 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -9,8 +9,8 @@
  *	consider that it is *still valid* so long as we are in the same command,
  *	ie, until the next CommandCounterIncrement() or transaction commit.
  *	(See access/heap/heapam_visibility.c, and note that system catalogs are
- *  generally scanned under the most current snapshot available, rather than
- *  the transaction snapshot.)	At the command boundary, the old tuple stops
+ *	generally scanned under the most current snapshot available, rather than
+ *	the transaction snapshot.)  At the command boundary, the old tuple stops
  *	being valid and the new version, if any, becomes valid.  Therefore,
  *	we cannot simply flush a tuple from the system caches during heap_update()
  *	or heap_delete().  The tuple is still good at that point; what's more,
-- 
2.17.1

>From 6fc057ae26567f39b85902933e4eddc9cbd9c915 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Tue, 26 Jul 2022 18:34:08 -0500
Subject: [PATCH 3/4] f!newline

---
 src/backend/commands/explain.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index e29c2ae206f..e078456b191 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -3284,7 +3284,6 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
 
 	if (es->format != EXPLAIN_FORMAT_TEXT)
 	{
-
 		if (es->costs)
 			ExplainPropertyInteger("Planned Partitions", NULL,
    aggstate->hash_planned_part

fix typos

2022-08-01 Thread Erik Rijkers

Recent typos...
--- ./doc/src/sgml/ref/drop_extension.sgml.orig 2022-08-01 19:38:18.249729884 
+0200
+++ ./doc/src/sgml/ref/drop_extension.sgml  2022-08-01 19:40:33.312359069 
+0200
@@ -32,7 +32,7 @@
DROP EXTENSION removes extensions from the database.
Dropping an extension causes its component objects, and other explicitly
dependent routines (see ,
-   the depends on extension action), to be dropped as well.
+   that depend on extension action), to be dropped as well.
   
 
   
@@ -80,8 +80,8 @@
 
  
   This option prevents the specified extensions from being dropped
-  if there exists non-extension-member objects that depends on any
-  the extensions.  This is the default.
+  if there exist non-extension-member objects that depend on any
+  of the extensions.  This is the default.
  
 

--- ./doc/src/sgml/ref/psql-ref.sgml.orig   2022-08-01 19:58:21.000644788 
+0200
+++ ./doc/src/sgml/ref/psql-ref.sgml2022-08-01 19:59:00.417285655 +0200
@@ -2864,7 +2864,7 @@
   
 
   
-   page: truncate the the header line at the 
terminal
+   page: truncate the header line at the terminal
width.
   
 


Re: typos

2022-07-05 Thread Noah Misch
On Thu, Apr 14, 2022 at 08:56:22AM +1200, David Rowley wrote:
> 0007: Not pushed. No space after comment and closing */  pgindent
> fixed one of these but not the other 2.  I've not looked into why
> pgindent does 1 and not the other 2.

> -/* get operation priority  by its code*/
> +/* get operation priority by its code */

pgindent never touches comments that start in column zero.  (That's why many
column-0 comments are wrapped to widths other than the standard 78.)




Re: fix typos in storing statistics in shared memory

2022-05-23 Thread Michael Paquier
On Mon, May 23, 2022 at 10:22:36AM -0700, Nathan Bossart wrote:
> On Mon, May 23, 2022 at 10:46:22PM +0900, torikoshia wrote:
>> It seems like there are some duplications of 'the' in pgstat.c and
>> pgstat_internal.h.
>> Attaching a tiny patch to fix them.
> 
> LGTM

Thanks Torikoshi-san, fixed.
--
Michael


signature.asc
Description: PGP signature


Re: fix typos in storing statistics in shared memory

2022-05-23 Thread Nathan Bossart
On Mon, May 23, 2022 at 10:46:22PM +0900, torikoshia wrote:
> It seems like there are some duplications of 'the' in pgstat.c and
> pgstat_internal.h.
> Attaching a tiny patch to fix them.

LGTM

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com




fix typos in storing statistics in shared memory

2022-05-23 Thread torikoshia

Hi,

It seems like there are some duplications of 'the' in pgstat.c and 
pgstat_internal.h.

Attaching a tiny patch to fix them.

--
Regards,

--
Atsushi Torikoshi
NTT DATA CORPORATIONFrom fabf3bc5da8e5ebd4f600b6ba762d4413cbdcd6b Mon Sep 17 00:00:00 2001
From: Atsushi Torikoshi 
Date: Mon, 23 May 2022 17:11:54 +0900
Subject: [PATCH v1] Fix duplications of 'the' in pgstat.c and
 pgstat_internal.h

---
 src/backend/utils/activity/pgstat.c | 4 ++--
 src/include/utils/pgstat_internal.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/backend/utils/activity/pgstat.c b/src/backend/utils/activity/pgstat.c
index 3c3fd0e9b7..05f2d9e9bd 100644
--- a/src/backend/utils/activity/pgstat.c
+++ b/src/backend/utils/activity/pgstat.c
@@ -32,9 +32,9 @@
  * backend-local hashtable (pgStatEntryRefHash) in front of the shared
  * hashtable, containing references (PgStat_EntryRef) to shared hashtable
  * entries. The shared hashtable only needs to be accessed when no prior
- * reference is found in the local hashtable. Besides pointing to the the
+ * reference is found in the local hashtable. Besides pointing to the
  * shared hashtable entry (PgStatShared_HashEntry) PgStat_EntryRef also
- * contains a pointer to the the shared statistics data, as a process-local
+ * contains a pointer to the shared statistics data, as a process-local
  * address, to reduce access costs.
  *
  * The names for structs stored in shared memory are prefixed with
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 0eccaea6c1..7d13310fe6 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -296,9 +296,9 @@ static const char *const slru_names[] = {
  * values in a copy of the stats data, which is protected by ->lock. See
  * pgstat_fetch_stat_(archiver|bgwriter|checkpointer) for the reader side.
  *
- * The only exception to that is the the stat_reset_timestamp in these
- * structs, which is protected by ->lock, because it has to be written by
- * another backend while resetting
+ * The only exception to that is the stat_reset_timestamp in these structs,
+ * which is protected by ->lock, because it has to be written by another
+ * backend while resetting
  * --
  */
 
-- 
2.27.0



Re: typos

2022-05-10 Thread Michael Paquier
On Tue, May 10, 2022 at 09:03:34PM -0500, Justin Pryzby wrote:
> I found a bunch more typos; a couple from codespell, and several which are the
> result of looking for previously-reported typos, like:

Thanks, applied 0002.

Regarding 0001, I don't really know which one of {AND,OR}ed or
{AND,OR}-ed is better.  Note that the code prefers the former, but
your patch changes the docs to use the latter.
--
Michael


signature.asc
Description: PGP signature


Re: typos

2022-05-10 Thread Justin Pryzby
I found a bunch more typos; a couple from codespell, and several which are the
result of looking for previously-reported typos, like:

time git log origin --grep '[tT]ypo' --word-diff -U1 |grep -Eo 
'\[-[[:lower:]]+-\]' |sed 's/^\[-//; s/-\]$//' |sort -u |grep -Fxvwf 
/usr/share/dict/words >badwords.txt
time grep -rhoFwf badwords.txt doc |sort -u >not-badwords.txt
time grep -Fxvwf not-badwords.txt ./badwords.txt >./badwords.txt.new
time grep -rhoIFwf ./badwords.txt.new src --incl='*.[chly]' --incl='*.p[lm]' 
|sort |uniq -c |sort -nr |less

>From 2166aa51840094f4b738f4a9af1ad6bd94a97cff Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Mon, 18 Apr 2022 10:13:09 -0500
Subject: [PATCH v2022051001 1/2] doc: ANDed and ORed

---
 doc/src/sgml/indexam.sgml | 2 +-
 doc/src/sgml/indices.sgml | 4 ++--
 doc/src/sgml/logical-replication.sgml | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml
index d4163c96e9f..16669f4086a 100644
--- a/doc/src/sgml/indexam.sgml
+++ b/doc/src/sgml/indexam.sgml
@@ -843,7 +843,7 @@ amparallelrescan (IndexScanDesc scan);
constant, where the index key is one of the columns of the
index and the operator is one of the members of the operator family
associated with that index column.  An index scan has zero or more scan
-   keys, which are implicitly ANDed — the returned tuples are expected
+   keys, which are implicitly AND-ed — the returned tuples are expected
to satisfy all the indicated conditions.
   
 
diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml
index 023157d8884..890c6d3451c 100644
--- a/doc/src/sgml/indices.sgml
+++ b/doc/src/sgml/indices.sgml
@@ -597,7 +597,7 @@ CREATE INDEX test3_desc_index ON test3 (id DESC NULLS LAST);
a query like WHERE x = 42 OR x = 47 OR x = 53 OR x = 99
could be broken down into four separate scans of an index on x,
each scan using one of the query clauses.  The results of these scans are
-   then ORed together to produce the result.  Another example is that if we
+   then OR-ed together to produce the result.  Another example is that if we
have separate indexes on x and y, one possible
implementation of a query like WHERE x = 5 AND y = 6 is to
use each index with the appropriate query clause and then AND together
@@ -608,7 +608,7 @@ CREATE INDEX test3_desc_index ON test3 (id DESC NULLS LAST);
To combine multiple indexes, the system scans each needed index and
prepares a bitmap in memory giving the locations of
table rows that are reported as matching that index's conditions.
-   The bitmaps are then ANDed and ORed together as needed by the query.
+   The bitmaps are then AND-ed and OR-ed together as needed by the query.
Finally, the actual table rows are visited and returned.  The table rows
are visited in physical order, because that is how the bitmap is laid
out; this means that any ordering of the original indexes is lost, and
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 145ea71d61b..d2939fec71c 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -477,7 +477,7 @@

 If the subscription has several publications in which the same table has
 been published with different row filters (for the same publish
-operation), those expressions get ORed together, so that rows satisfying
+operation), those expressions get OR-ed together, so that rows satisfying
 any of the expressions will be replicated. This means all
 the other row filters for the same table become redundant if:
 
-- 
2.17.1

>From a566141ebb01fc48cb766339553b600755ca4dca Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Tue, 10 May 2022 19:02:02 -0500
Subject: [PATCH v2022051001 2/2] typos

---
 contrib/citext/expected/citext.out  | 2 +-
 contrib/citext/expected/citext_1.out| 2 +-
 contrib/citext/sql/citext.sql   | 2 +-
 src/backend/executor/execGrouping.c | 2 +-
 src/backend/parser/parse_expr.c | 2 +-
 src/backend/replication/basebackup_target.c | 2 +-
 src/backend/utils/adt/int8.c| 2 +-
 src/bin/pg_basebackup/bbstreamer_tar.c  | 2 +-
 src/bin/pg_rewind/t/007_standby_source.pl   | 2 +-
 src/bin/pg_rewind/t/009_growing_files.pl| 2 +-
 src/test/regress/expected/psql.out  | 2 +-
 src/test/regress/sql/psql.sql   | 2 +-
 src/test/ssl/t/SSL/Backend/OpenSSL.pm   | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/contrib/citext/expected/citext.out b/contrib/citext/expected/citext.out
index 5afcc50920e..1c555981363 100644
--- a/contrib/citext/expected/citext.out
+++ b/contrib/citext/expected/citext.out
@@ -2270,7 +2270,7 @@ SELECT COUNT(*) = 8::bigint AS t FROM try;
 
 INSERT INTO try
 VALUES ( to_char(  now(

Re: typos

2022-04-21 Thread Alvaro Herrera
On 2022-Apr-21, Peter Eisentraut wrote:

> It is referred to as "Zstandard" at both of those places.  Maybe we should
> use that.  That is also easier to pronounce.

Yeah, I looked at other places (such as Yann Collet's blog) and I agree
that Zstandard seems to be the accepted spelling of the product.  Pushed
that way.

-- 
Álvaro HerreraBreisgau, Deutschland  —  https://www.EnterpriseDB.com/
Tom: There seems to be something broken here.
Teodor: I'm in sackcloth and ashes...  Fixed.
http://archives.postgresql.org/message-id/482d1632.8010...@sigaev.ru




Re: typos

2022-04-21 Thread Peter Eisentraut

On 21.04.22 06:36, Michael Paquier wrote:

On Wed, Apr 20, 2022 at 11:32:08PM +0200, Alvaro Herrera wrote:

So the attached.

--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -307,9 +307,9 @@ $ENV{MSBFLAGS}="/m";
  
  
  

- ZSTD
+ Zstd
   
-  Required for supporting ZSTD compression
+  Required for supporting Zstd compression


Looking at the zstd project itself for reference or just wiki-sensei,
I don't think that this is correct:
https://github.com/facebook/zstd
https://en.wikipedia.org/wiki/Zstd

Their README uses "zstd" in lower-case, while "Zstd" (first letter
upper-case) is used at the beginning of a sentence.


It is referred to as "Zstandard" at both of those places.  Maybe we 
should use that.  That is also easier to pronounce.





Re: typos

2022-04-20 Thread Michael Paquier
On Wed, Apr 20, 2022 at 11:32:08PM +0200, Alvaro Herrera wrote:
> So the attached.
> 
> --- a/doc/src/sgml/install-windows.sgml
> +++ b/doc/src/sgml/install-windows.sgml
> @@ -307,9 +307,9 @@ $ENV{MSBFLAGS}="/m";
>  
>  
>  
> - ZSTD
> + Zstd
>   
> -  Required for supporting ZSTD compression
> +  Required for supporting Zstd compression

Looking at the zstd project itself for reference or just wiki-sensei,
I don't think that this is correct:
https://github.com/facebook/zstd
https://en.wikipedia.org/wiki/Zstd

Their README uses "zstd" in lower-case, while "Zstd" (first letter
upper-case) is used at the beginning of a sentence.
--
Michael


signature.asc
Description: PGP signature


Re: typos

2022-04-20 Thread Amit Kapila
On Wed, Apr 20, 2022 at 5:31 PM Alvaro Herrera  wrote:
>
> On 2022-Apr-20, Amit Kapila wrote:
>
> > Your proposed changes look good to me but I think all these places
> > need to mention 'column list' as well because the behavior is the same
> > for it.
>
> Hmm, you're right.  Added that, and changed the wording somewhat because
> some things read awkwardly.  Here's the result in patch form.
>

LGTM.

-- 
With Regards,
Amit Kapila.




Re: typos

2022-04-20 Thread Justin Pryzby
On Wed, Apr 20, 2022 at 11:32:08PM +0200, Alvaro Herrera wrote:
> On 2022-Apr-19, Alvaro Herrera wrote:
> 
> > I propose we standardize on Zstd everywhere.
> > Users can look it up if they're really interested.
> 
> So the attached.
> 
> There are other uses of zstd, but those are referring to 
> the
> executable program.

This one shouldn't be changed, or not like this?

> @@ -560,7 +560,7 @@ $ENV{PROVE_TESTS}='t/020*.pl t/010*.pl'
>  
>   ZSTD
>   
> -  Path to a zstd command. The default is
> +  Path to a Zstd command. The default is
>zstd, which will search for a command by that
>name in the configured PATH.
>   

Maybe it should say s/a/the/, like:

-  Path to a zstd command. The default is
+  Path to the zstd command. The default is




Re: typos

2022-04-20 Thread Alvaro Herrera
On 2022-Apr-19, Alvaro Herrera wrote:

> I propose we standardize on Zstd everywhere.
> Users can look it up if they're really interested.

So the attached.

There are other uses of zstd, but those are referring to the
executable program.

-- 
Álvaro Herrera PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"No necesitamos banderas
 No reconocemos fronteras"  (Jorge González)
>From 256904cc5a8718ac081dbf51f6263ab022e503f6 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera 
Date: Wed, 20 Apr 2022 23:26:28 +0200
Subject: [PATCH] Zstd

---
 doc/src/sgml/install-windows.sgml | 6 +++---
 doc/src/sgml/installation.sgml| 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 43cc5f6f5b..104670d295 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -307,9 +307,9 @@ $ENV{MSBFLAGS}="/m";
 
 
 
- ZSTD
+ Zstd
  
-  Required for supporting ZSTD compression
+  Required for supporting Zstd compression
   method. Binaries and source can be downloaded from
   https://github.com/facebook/zstd/releases";>.
  
@@ -560,7 +560,7 @@ $ENV{PROVE_TESTS}='t/020*.pl t/010*.pl'
 
  ZSTD
  
-  Path to a zstd command. The default is
+  Path to a Zstd command. The default is
   zstd, which will search for a command by that
   name in the configured PATH.
  
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index df32025a86..c60484e221 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -273,7 +273,7 @@ su - postgres
 
 
  
-  You need zstd, if you want to support
+  You need Zstd, if you want to support
   compression of data with that method; see
   .
   The minimum required version is 1.4.0.
@@ -996,7 +996,7 @@ build-postgresql:
--with-zstd

 
- Build with ZSTD compression support.
+ Build with Zstd compression support.
 

   
-- 
2.30.2



Re: typos

2022-04-20 Thread Alvaro Herrera
On 2022-Apr-20, Amit Kapila wrote:

> Your proposed changes look good to me but I think all these places
> need to mention 'column list' as well because the behavior is the same
> for it.

Hmm, you're right.  Added that, and changed the wording somewhat because
some things read awkwardly.  Here's the result in patch form.

Column lists seems not mentioned in logical-replication.sgml, either.

-- 
Álvaro HerreraBreisgau, Deutschland  —  https://www.EnterpriseDB.com/
"La verdad no siempre es bonita, pero el hambre de ella sí"
diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml
index 23d883c158..c58478e8f8 100644
--- a/doc/src/sgml/ref/create_publication.sgml
+++ b/doc/src/sgml/ref/create_publication.sgml
@@ -79,7 +79,8 @@ CREATE PUBLICATION name
  
 
  
-  If the optional WHERE clause is specified, rows for
+  If the optional WHERE clause is specified, it defines a
+  row filter expression. Rows for
   which the expression
   evaluates to false or null will not be published. Note that parentheses
   are required around the expression. It has no effect on
@@ -192,6 +193,11 @@ CREATE PUBLICATION name
   consisting of a different set of partitions.
  
 
+ 
+  This parameter also affects how row filters and column lists are
+  chosen for partitions; see below for details.
+ 
+
  
   If this is enabled, TRUNCATE operations performed
   directly on partitions are not replicated.
@@ -241,21 +247,28 @@ CREATE PUBLICATION name
   
 
   
-   A WHERE (i.e. row filter) expression must contain only
+   A row filter expression (i.e., the WHERE clause) must contain only
columns that are covered by the REPLICA IDENTITY, in
order for UPDATE and DELETE operations
to be published. For publication of INSERT operations,
any column may be used in the WHERE expression. The
-   WHERE clause allows simple expressions that don't have
+   row filter allows simple expressions that don't have
user-defined functions, user-defined operators, user-defined types,
user-defined collations, non-immutable built-in functions, or references to
system columns.
-   If your publication contains a partitioned table, the publication parameter
-   publish_via_partition_root determines if it uses the
-   partition's row filter (if the parameter is false, the default) or the root
-   partitioned table's row filter.
+  
+  
+  
+   For published partitioned tables, the row filter for each
+   partition is taken from the published partitioned table if the
+   publication parameter publish_via_partition_root is true,
+   or from the partition itself if it is false (the default).
See  for details about row
filters.
+   Similarly, for published partitioned tables, the column list for each
+   partition is taken from the published partitioned table if the
+   publication parameter publish_via_partition_root is true,
+   or from the partition itself if it is false.
   
 
   


Re: typos

2022-04-19 Thread Amit Kapila
On Tue, Apr 19, 2022 at 4:35 PM Alvaro Herrera  wrote:
>
> Yeah, more invasive rewording seems called for.  I propose this:
>
>For publications containing partitioned tables, the row filter for each
>partition is taken from the published partitioned table if the
>publication parameter publish_via_partition_root is 
> true,
>or from the partition itself if it is false (the default).
>
> I think we should also mention that this parameter affects row filters,
> in the  for the WITH clause.  Currently it has
>
> publish_via_partition_root 
> (boolean)
> 
>  
>   This parameter determines whether changes in a partitioned table (or
>   on its partitions) contained in the publication will be published
>   using the identity and schema of the partitioned table rather than
>   that of the individual partitions that are actually changed; the
>   latter is the default.  Enabling this allows the changes to be
>   replicated into a non-partitioned table or a partitioned table
>   consisting of a different set of partitions.
>  
>
> I propose to add
>
> publish_via_partition_root 
> (boolean)
> 
>  
>   This parameter determines whether changes in a partitioned table (or
>   on its partitions) contained in the publication will be published
>   using the identity and schema of the partitioned table rather than
>   that of the individual partitions that are actually changed; the
>   latter is the default.  Enabling this allows the changes to be
>   replicated into a non-partitioned table or a partitioned table
>   consisting of a different set of partitions.
>  
>
> 
>  This parameter also affects how row filters are chosen for 
> partitions;
>  see below for details.
> 
>

Your proposed changes look good to me but I think all these places
need to mention 'column list' as well because the behavior is the same
for it.

> More generally, I think we need to connect the WHERE keyword with "row
> filters" more explicitly.  Right now, the parameter reference says
>
>   If the optional WHERE clause is specified, rows for
>   which the expression
>   evaluates to false or null will not be published. Note that parentheses
>   are required around the expression. It has no effect on
>   TRUNCATE commands.
>
> I propose to make it "If the optional WHERE clause is specified, it
> defines a row filter expression.  Rows for which
> the row filter expression evaluates to false ..."
>

Looks good to me.

-- 
With Regards,
Amit Kapila.




  1   2   3   4   >