RE: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Jeff Davis' <pgsql@j-davis.com>, Amit Kapila <amit.kapila16@gmail.com>, Chao Li <li.evan.chao@gmail.com>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>, Ajin Cherian <itsajin@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-06-24T02:18:20Z
Lists: pgsql-hackers
Dear Jeff,

I went through the 0003 patch. Apart from HINT message, I found that error code
ERRCODE_CONNECTION_FAILURE is always used. Should we report the original errcode
of the root cause? Or it's OK because the observed outcome is the cannot-connect
error?

Another comment:


```
+               conninfo = ForeignServerConnectionString(subowner, server);
+               Assert(conninfo != NULL);
```

Do we have to consider the case that ForeignServerConnectionString() returns NULL
without any ERRORs? For the production build, the Assert() would be skipped and
the segmentation fault would happen in the `if (!conninfo)` part.
I checked the doc [1] but there are no specifications for it.

[1]: https://www.postgresql.org/docs/devel/sql-createforeigndatawrapper.html#:~:text=ereport(ERROR)%20function.-,CONNECTION%20connection_function,-connection_function%20is%20the

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Avoid errors during DROP SUBSCRIPTION when slot_name is NONE.

  2. Avoid errors during ALTER SUBSCRIPTION.

  3. Check retain_dead_tuples for ALTER SUBSCRIPTION ... SERVER.

  4. Allow multiple xacts during table sync in logical replication.