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 1o424o-0006Gd-7b for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jun 2022 15:15:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o424m-0005Km-QE for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jun 2022 15:15:28 +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 1o424m-0005Kd-Gh for pgsql-hackers@lists.postgresql.org; Wed, 22 Jun 2022 15:15:28 +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 1o424k-0006dJ-Dj for pgsql-hackers@lists.postgresql.org; Wed, 22 Jun 2022 15:15:28 +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 25MFFNl43373221; Wed, 22 Jun 2022 11:15:23 -0400 From: Tom Lane To: Joe Conway cc: "Drouvot, Bertrand" , PostgreSQL Hackers Subject: Re: SYSTEM_USER reserved word implementation In-reply-to: <89d0577e-b9f8-4d8a-224d-b336a5fe08af@joeconway.com> 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> Comments: In-reply-to Joe Conway message dated "Wed, 22 Jun 2022 11:10:26 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3373219.1655910923.1@sss.pgh.pa.us> Date: Wed, 22 Jun 2022 11:15:23 -0400 Message-ID: <3373220.1655910923@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 10:51, Tom Lane wrote: >> My immediate guess would be that the SQL committee only intends >> to deal in SQL role names and therefore SYSTEM_USER is defined >> to return one of those, but I've not gone looking in the spec >> to be sure. > I only have a draft copy, but in SQL 2016 I find relatively thin > documentation for what SYSTEM_USER is supposed to represent: > The value specified by SYSTEM_USER is equal to an > implementation-defined string that represents the > operating system user who executed the SQL-client > module that contains the externally-invoked procedure > whose execution caused the SYSTEM_USER specification> to be evaluated. Huh. Okay, if it's implementation-defined then we can define it as "whatever auth.c put into authn_id". Objection withdrawn. regards, tom lane