Re: Add minimal C example and SQL registration example for custom table access methods.

2023-11-11 Thread Paul A Jungwirth
On Sat, Nov 11, 2023 at 1:00 PM Phil Eaton  wrote:
> I was looking into table access methods recently and found the
> existing page a bit sparse. Here's a small patch adding a little more
> example code to the table access methods page.

I agree this is a helpful addition for people exploring table AMs. The
patch applies and builds. No spelling/grammar errors. Integrates
smoothly with the surrounding text.

I didn't write a full table AM (maybe someday! :-) but I put the
example code into a new extension and made sure it builds. I don't
think this snippet is likely to go out of date, but is there anything
we do in doc examples to test that? (I'm not aware of anything.)

There is no commitfest entry yet. Phil, would you mind adding one? (It
will need to be against the Jan 2024 commitfest.) I started one myself
but I don't think you're registered yet so I couldn't enter you as the
patch author. Let me know if you have any trouble.

+1 from me!

Regards,
Paul




Streaming Replication vs Logical

2024-10-11 Thread Paul A Jungwirth
Our docs seem to contrast "streaming replication" to logical, but
these are not really opposites. Sometimes when they say "streaming"
they mean "physical".

Probably this is historical: at first physical replication was the
only kind of streaming we had.

Personally this has caused me a lot of confusion. For example,
recently when I read "Synchronous replication (see Section 26.2.8) is
only supported on replication slots used over the streaming
replication interface," I took it to mean synchronous replication only
worked for physical replication, not logical. But actually here the
contrast is between the streaming protocol and SQL commands. I think
it would help if the docs elsewhere took more care to say "physical"
not "streaming" when that is the meaning.

This patch fixes a callout note in the Logical Decoding section. It
was sort of vague before. It dates back to the original commit
documenting logical decoding, so I'm not sure of the original motive.
I think the new text is more precise and about the other use for
replication slots, and also clearly separates streaming replication
from physical-vs-logical replication. (I used the word "typically"
because you *can* have a standby with logical replication, although
elsewhere we warn it may not be as robust.)

I also tried to fix the first three paragraphs of
https://www.postgresql.org/docs/current/runtime-config-replication.html
which seem to be setting up a distinction between streaming
replication and logical. This is tricky, because (1) we are trying to
introduce how we've organized different config parameters, and some
affect both physical and logical replication (e.g.
max_replication_slots and wal_retrieve_retry_interval) (2) you can use
logical replication without streaming (e.g.
pg_logical_slot_get_changes).

While I was making edits there, I took out some language about
"built-in" and "feature", which seem like unnecessary wordiness.

I also added "physical" to a couple places in
https://www.postgresql.org/docs/current/warm-standby.html as well as a
Note callout to clarify that the whole page is really about using
physical replication. Technically you could use logical replication to
run a standby, but that seems like a separate discussion.

Yours,

-- 
Paul  ~{:-)
p...@illuminatedcomputing.com


v1-0001-Distinguish-between-streaming-replication-and-phy.patch
Description: Binary data


Document how to run only specific regress tests

2024-10-28 Thread Paul A Jungwirth
I never knew this was possible, but I ran across a note on the meson
wiki page[1]. I wish I knew about it years ago!

This patch adds a note to
https://www.postgresql.org/docs/current/regress-run.html so that other
hackers and potential hackers will know about it.

[1] https://wiki.postgresql.org/wiki/Meson

Yours,

-- 
Paul  ~{:-)
p...@illuminatedcomputing.com


v1-0001-Document-how-to-run-specific-regress-tests.patch
Description: Binary data