Subject: pg_dump not dumping the run_as_owner setting from version 16?

From: Philip Warner <[email-masked]>
Date: Fri, 27 Oct 2023 15:25:30 +1100

Hi,

I as far as I can tell, pg_dump does not dup the ‘run_as_owner` setting for a subscription.

Should it? Should I submit a patch? It seems pretty trivial to fix if anyone else is working on it.

Sent from Mail for Windows

---

From: Philip Warner <[email-masked]>
Date: Fri, 27 Oct 2023 18:05:30 +1100

Further to this: it seems that `Alter Subscription X Set(Run_As_Owner=True);` has no influence on the `subrunasowner` column of pg_subscriptions.

From: Philip Warner
Sent: Friday, 27 October 2023 3:26 PM
To: [email-masked]
Subject: pg_dump not dumping the run_as_owner setting from version 16?

Hi,

---

From: Laurenz Albe <[email-masked]>
Date: Fri, 27 Oct 2023 09:52:31 +0200

> Should it? Should I submit a patch? It seems pretty trivial to fix if anyone else is working on it.

Yes, it certainly should.  That is an omission in 482675987b.
Go ahead and write a fix!

> Further to this: it seems that `Alter Subscription X Set(Run_As_Owner=True);`
> has no influence on the `subrunasowner` column of pg_subscriptions.

This seems to have been fixed in f062cddafe.

Yours,
Laurenz Albe

---

From: Philip Warner <[email-masked]>
Date: Sat, 28 Oct 2023 19:54:18 +1100

...patch actually attached this time...

> Go ahead and write a fix!

Please find attached a patch for pg_dump to honour the setting of `run_as_owner`; I believe that effective pre-16 behavious was to run as owner, so I have set the flag to ‘t’ for pre-16 versions. Please let me know if you would prefer the opposite.

> This seems to have been fixed in f062cddafe.

Yes, I can confirm that in the current head `pg_subscriptions` reflects the setting correctly.

---

From: Tom Lane <[email-masked]>
Date: Sun, 29 Oct 2023 12:57:38 -0400

> Please find attached a patch for pg_dump to honour the setting of `run_as_owner`; I believe that effective pre-16 behavious was to run as owner, so I have set the flag to ‘t’ for pre-16 versions. P…

I think that's the correct choice.  Fix pushed, thanks.

			regards, tom lane