Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga3HR-0000SA-G4 for pgsql-docs@arkaria.postgresql.org; Thu, 20 Dec 2018 18:42:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ga3HP-0006Kw-1q for pgsql-docs@arkaria.postgresql.org; Thu, 20 Dec 2018 18:42:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga3HO-0006Ko-Ok for pgsql-docs@lists.postgresql.org; Thu, 20 Dec 2018 18:42:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga3HH-0001hy-NG for pgsql-docs@postgresql.org; Thu, 20 Dec 2018 18:42:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wBKIgWoJ009733; Thu, 20 Dec 2018 13:42:32 -0500 From: Tom Lane To: antonov@stdpr.ru cc: pgsql-docs@postgresql.org Subject: Re: "$user" and SESSION_USER and CURRENT_USER In-reply-to: <159151fb45d490c8d31ea9707e9ba99d@stdpr.ru> References: <159151fb45d490c8d31ea9707e9ba99d@stdpr.ru> Comments: In-reply-to antonov@stdpr.ru message dated "Thu, 20 Dec 2018 18:38:26 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9731.1545331352.1@sss.pgh.pa.us> Date: Thu, 20 Dec 2018 13:42:32 -0500 Message-ID: <9732.1545331352@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk antonov@stdpr.ru writes: > here -- https://www.postgresql.org/docs/11/runtime-config-client.html > there is the text """If one of the list items is the special name $user, > then the schema having the name returned by SESSION_USER is substituted, > if there is such a schema and the user has USAGE permission for it. (If > not, $user is ignored.)""". > but actualy "$user" substitutes CURRENT_USER-value (not > SESSION_USER-value). Huh. Digging in the commit history, SESSION_USER was the original implementation (commit 838fe25a9 of 2002-04-01) but it was changed later that month (ccfaf9067 of 2002-04-29) when we added schema permissions checks. Evidently I forgot to update the docs to match :-( Will fix, thanks for noticing! regards, tom lane