diff options
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r-- | src/backend/utils/init/postinit.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 2eb456df45e..b87ec6c4822 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -627,6 +627,19 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username, errhint("You should immediately run CREATE USER \"%s\" SUPERUSER;.", username))); } + else if (IsBackgroundWorker) + { + if (username == NULL) + { + InitializeSessionUserIdStandalone(); + am_superuser = true; + } + else + { + InitializeSessionUserId(username); + am_superuser = superuser(); + } + } else { /* normal multiuser case */ |