RE: [Bug] pg_upgrade could fail for non-superuser subscriptions using foreign servers

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Subject: RE: [Bug] pg_upgrade could fail for non-superuser subscriptions using foreign servers
Date: 2026-07-23 03:00:18
Message-ID: OS9PR01MB121493DA4C1A7748B11A646D8F5C02@OS9PR01MB12149.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

> My primitive idea for fix is to introduce a new TOC entry to record the OWNER
> command, in the pg_dump. Unlike the normal CREATE SUBSCRIPTION, this entry
> can be handled as RESTORE_PASS_POST_ACL.
> I'm locally working on the idea and will post tomorrow.

So here is a patch. While coding, I found another issue that TOC entry for
"SUBSCRIPTION TABLE" may not be skipped in case of --no-subscriptions.
This can be an issue when:

1) there are tuples in pg_subscription_rel,
2) pg_dump is done with --binary-upgrade then
3) pg_restore is done with --no-subscription.

I think it seldom happens, but I could not find reasons to retain.

How do you feel?

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
0001-ignore-SUBSCRIPTION-TABLE-in-case-of-no-subscription.patch application/octet-stream 979 bytes
0002-Fix-pg_upgrade-failure-with-subscriptions-using-fore.patch application/octet-stream 4.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-07-23 04:14:34 Re: sequencesync worker race with REFRESH SEQUENCES
Previous Message Peter Smith 2026-07-23 02:55:43 Re: DOCS: Describe some missing parameters on CREATE/ALTER PUBLICATION pages