Re: user connection not recorded?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Melvin Davidson <melvin6925(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: user connection not recorded?
Date: 2015-07-30 14:46:14
Message-ID: 20486.1438267574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
> Eventually got around to figuring that. So just for my reference, the
> code snippet I showed from postinit.c seems to show a path where a
> username is not used but is substituted with BOOTSTRAP_SUPERUSERID.

That's single-user mode.

> Am I following that correctly and what is BOOTSTRAP_SUPERUSERID?

BOOTSTRAP_SUPERUSERID is the OID of the precreated superuser.

The reason for that hack is to ensure you can still log in, in single-user
mode, even if you've done something stupid like "delete from pg_authid".
You'll be running under a user OID that doesn't actually exist in
pg_authid, but it won't matter because the code will believe you're a
superuser and will never go looking for the missing row. Then you
can create yourself a new superuser, and resolve not to do that again.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ramesh T 2015-07-30 14:53:42 Re: instr detail
Previous Message Adrian Klaver 2015-07-30 14:36:26 Re: user connection not recorded?