Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o43Dl-0000Lh-Ak for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jun 2022 16:28:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o43Dk-0007TL-3b for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jun 2022 16:28:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o43Dj-0007TC-Qz for pgsql-hackers@lists.postgresql.org; Wed, 22 Jun 2022 16:28:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o43Dh-0007BX-PK for pgsql-hackers@lists.postgresql.org; Wed, 22 Jun 2022 16:28:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25MGShJb3523130; Wed, 22 Jun 2022 12:28:43 -0400 From: Tom Lane To: Joe Conway cc: Jacob Champion , "Drouvot, Bertrand" , PostgreSQL Hackers Subject: Re: SYSTEM_USER reserved word implementation In-reply-to: References: <7e692b8c-0b11-45db-1cad-3afc5b57409f@amazon.com> <3338921.1655905757@sss.pgh.pa.us> <28b4a9ef-5103-f117-99e1-99ae5a86a6e8@joeconway.com> <3361134.1655909496@sss.pgh.pa.us> <89d0577e-b9f8-4d8a-224d-b336a5fe08af@joeconway.com> <3484653.1655913147@sss.pgh.pa.us> Comments: In-reply-to Joe Conway message dated "Wed, 22 Jun 2022 12:22:36 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3523128.1655915323.1@sss.pgh.pa.us> Date: Wed, 22 Jun 2022 12:28:43 -0400 Message-ID: <3523129.1655915323@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Joe Conway writes: > On 6/22/22 11:52, Tom Lane wrote: >> I think a case could be made for ONLY returning non-null when authn_id >> represents some externally-verified identifier (OS user ID gotten via >> peer identification, Kerberos principal, etc). > But -1 on that. > I think any time we have a non-null authn_id we should expose it. Are > there examples of cases when we have authn_id but for some reason don't > trust the value of it? I'm more concerned about whether we have a consistent story about what SYSTEM_USER means (another way of saying "what type is it"). If it's just the same as SESSION_USER it doesn't seem like we've added much. Maybe, instead of just being the raw user identifier, it should be something like "auth_method:user_identifier" so that one can tell what the identifier actually is and how it was verified. regards, tom lane