Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8d9caa

Browse files
committed
Accept invalidation messages in InitializeSessionUserId().
If the authentication method modified the system catalogs through aseparate database connection (say, to create a new role on the fly),make sure syscache sees the changes before we try to find the user.Author: Thomas MunroReviewed-by: Tom Lane, Andres FreundDiscussion:https://postgr.es/m/CAEepm%3D3_h0_cgmz5PMyab4xk_OFrg6G5VCN%3DnF4chFXM9iFOqA%40mail.gmail.com
1 parent387a5cf commite8d9caa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/utils/init/miscinit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include"storage/procarray.h"
4949
#include"utils/builtins.h"
5050
#include"utils/guc.h"
51+
#include"utils/inval.h"
5152
#include"utils/memutils.h"
5253
#include"utils/pidfile.h"
5354
#include"utils/syscache.h"
@@ -594,6 +595,13 @@ InitializeSessionUserId(const char *rolename, Oid roleid)
594595
/* call only once */
595596
AssertState(!OidIsValid(AuthenticatedUserId));
596597

598+
/*
599+
* Make sure syscache entries are flushed for recent catalog changes.
600+
* This allows us to find roles that were created on-the-fly during
601+
* authentication.
602+
*/
603+
AcceptInvalidationMessages();
604+
597605
if (rolename!=NULL)
598606
{
599607
roleTup=SearchSysCache1(AUTHNAME,PointerGetDatum(rolename));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp