Re: pg_upgrade check for invalid role-specific default config

2021-04-13 Thread Tom Lane
Charlie Hornsby writes: > I tested the above patch with the invalid data locally and it avoids > the restore error that we ran into previously. Also it requires no > intervention to progress with pg_upgrade unlike my initial idea of > adding an check, so it is definitely simpler from a user persp

Re: pg_upgrade check for invalid role-specific default config

2021-04-13 Thread Charlie Hornsby
Tom wrote: > I do find it interesting that we now have two reports of somebody > doing "ALTER ROLE SET role = something". In the older thread, > I was skeptical that that had any real use-case, so I wonder if > Charlie has a rationale for having done that. Unfortunately I haven't heard back from

Re: pg_upgrade check for invalid role-specific default config

2021-04-12 Thread Tom Lane
I wrote: > Another answer is that maybe the processing of the "role" case > in particular is just broken. After digging around a bit more, I think that that is indeed the right answer. Most of the GUC check functions that have database-state-dependent behavior are programmed to behave specially w

Re: pg_upgrade check for invalid role-specific default config

2021-04-12 Thread Tom Lane
I wrote: > I'm not sure I buy the premise that "it is possible to write a query > to identify these cases". It seems to me that the general problem is > that ALTER ROLE/DATABASE SET values might have become incorrect since > they were installed and would thus fail when reloaded in dump/restore. >

Re: pg_upgrade check for invalid role-specific default config

2021-04-12 Thread Tom Lane
Bruce Momjian writes: > On Mon, Apr 12, 2021 at 01:28:19PM +, Charlie Hornsby wrote: >> While troubleshooting a failed upgrade from v11 -> v12 I realised I had >> encountered a bug previously reported on the pgsql-bugs mailing list: >> #14242 Role with a setconfig "role" setting to a nonexiste

Re: pg_upgrade check for invalid role-specific default config

2021-04-12 Thread Bruce Momjian
On Mon, Apr 12, 2021 at 01:28:19PM +, Charlie Hornsby wrote: > Hi all, > > While troubleshooting a failed upgrade from v11 -> v12 I realised I had > encountered a bug previously reported on the pgsql-bugs mailing list: > > #14242 Role with a setconfig "role" setting to a nonexistent role caus

pg_upgrade check for invalid role-specific default config

2021-04-12 Thread Charlie Hornsby
Hi all, While troubleshooting a failed upgrade from v11 -> v12 I realised I had encountered a bug previously reported on the pgsql-bugs mailing list: #14242 Role with a setconfig "role" setting to a nonexistent role causes pg_upgrade to fail https://www.postgresql.org/message-id/20160711223641.1