Fix possible logical replication crash.
authorRobert Haas <[email protected]>
Mon, 3 Apr 2023 17:11:00 +0000 (13:11 -0400)
committerRobert Haas <[email protected]>
Mon, 3 Apr 2023 17:54:21 +0000 (13:54 -0400)
commite7e7da2f8d57bbe6c8fb463a9eec51486000ba2e
treeff333d6a9643e8568ffc65ba49a192ea02ad0200
parenta8a00124f1ddb9c8506ff75317f6dd64cc480e61
Fix possible logical replication crash.

Commit c3afe8cf5a1e465bd71e48e4bc717f5bfdc7a7d6 added a new
password_required option but forgot that you need database access
to check whether an arbitrary role ID is a superuser.

Report and  by Hou Zhijie. I added a comment. Thanks to
Alexander Lakhin for devising a way to reproduce the crash.

Discussion: http://postgr.es/m/OS0PR01MB5716BFD7EC44284C89F40808948F9@OS0PR01MB5716.jpnprd01.prod.outlook.com
src/backend/replication/logical/worker.c