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 1l35Rs-0006KQ-J4 for pgsql-general@arkaria.postgresql.org; Fri, 22 Jan 2021 23:02:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l35Rr-0007zR-Cn for pgsql-general@arkaria.postgresql.org; Fri, 22 Jan 2021 23:02:35 +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 1l35Rr-0007zJ-2b for pgsql-general@lists.postgresql.org; Fri, 22 Jan 2021 23:02:35 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l35Ro-00046e-HZ for pgsql-general@lists.postgresql.org; Fri, 22 Jan 2021 23:02:34 +0000 Received: by mail-io1-xd2c.google.com with SMTP id u8so1422311ior.13 for ; Fri, 22 Jan 2021 15:02:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Tai2DWfruvv3G9VPQPuX6ATRvaCucWwB+y/jdKvk0d0=; b=hshHrCgwDW2t8c3PDn2fqWwQke2WZTfceZyDCttrQUTxKwANr147kORsw2dBF66MlO df8lfP6Z/Y4I0jlidRLcZuvSJJ1m0UgCfp3lQDGjIrN8ekp/VIXjb8AmMze1Wt/ZnqW8 9BznCO3FrVbR/TFKDrDVQ+HGKrUcrUd/UQB5TogMaZQcV00lMCSzQ3LepkbXW+hi+tHN YuSKCqyVk6ohcIXEC9r3jZe9GrdaVjQ9cK+NQDaGhUaeQJ8q/xVhTQWZCwNW6CDdLdzF 9+jZdJua5giheLYTEd5qFkqIB/3wWbAAyqIqQMrHVTwrENTirEDSlIS8edZx+AWVGMJF CyZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Tai2DWfruvv3G9VPQPuX6ATRvaCucWwB+y/jdKvk0d0=; b=kKz8PKgHvlRkKkatSxqAp/XzMwEZLCb8VcTb2ZrNsJnvd1j3w8QNcetFp+wmsXbY7d I5JPTk/3ugMKsXvUVqydUEjttI2Tt0OhbXmHXmv5m8h1gMK/IekWKPWP2ZA0efvBa4ae 3F9FpWYUyX6sysXQnpDQHwIcJHhh4uBEODoCZTjiAPVq9p1zJ8CHQcHE2A7VWgOzXJ3j OAygd7ERAoL3Uhat35K3xT92mNqm/IE+9mO+fBmtll0hMiJWo/aZRK8UCNVAIVJYqDZD r2B9PjG9MReBMgpCT1yggarByGM3ElQJlcakOtXP/7lcjMRcQvGIsbqP3ZgpdtjMRKUC 5A+Q== X-Gm-Message-State: AOAM533+nhS3aIBRcEsIkgzwg+FXF1CwarxXrJi0KA18eL4TjkExGx2b c8e4PyoWaYBU8wm8alYeLQHtrV4Q3vc= X-Google-Smtp-Source: ABdhPJwdnpbInTIt2z87mOHRsMZ80kON9qeJC7Rbii42hIhC6K1AxaAHrRWHzDOKbc3CZDz9MNb9/A== X-Received: by 2002:a92:cd47:: with SMTP id v7mr680683ilq.288.1611356550631; Fri, 22 Jan 2021 15:02:30 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:5928:5288:3618:3f11? ([2601:681:5500:dde0:5928:5288:3618:3f11]) by smtp.gmail.com with ESMTPSA id y25sm6137962ioa.5.2021.01.22.15.02.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 15:02:30 -0800 (PST) Subject: Re: localhost ssl To: Adrian Klaver , "pgsql-generallists.postgresql.org" References: <1ca17e3b-14de-69ff-5f0b-4082376571ca@aklaver.com> <73ae4494-3b65-6ecd-b610-9a9ac5c9cce1@gmail.com> <5f8db865-2f0e-6764-f2f0-b344feb42368@aklaver.com> <2f653f6c-5f27-13fd-49be-90845a45ef43@gmail.com> <4665f2de-d2a2-4623-8c61-0f42c899e8a3@aklaver.com> <8d6c56b4-ec30-bae9-c570-a80df9955582@aklaver.com> From: Rob Sargent Message-ID: <9dbb446b-8060-b571-8556-e17e76fcc399@gmail.com> Date: Fri, 22 Jan 2021 16:02:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <8d6c56b4-ec30-bae9-c570-a80df9955582@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/22/21 3:54 PM, Adrian Klaver wrote: > On 1/22/21 2:48 PM, Rob Sargent wrote: >> >> Honest, I've been reading 18.9 but as you can see it uses CN for host >> and then 20.12 suggests using CN for role. > > Difference between server certificate and client certificate. > > To get a handle on this is going to take an outline of what your > authentication needs are? > > >> >> Yes, I'm confused.  As I said in reply to Jeff, I would rather not >> need to remember to set the search_path, which I can avoid if I login >> as "role". > > I have not seen that conversation and I do not see it in the archive > either. Is that off-list, different thread, something else? > > I missed reply-all on responding to Jeff. Here is that for the list: > This is what I use. We have a user and schema per client in a multi->tenant database, as in user = bob, schema = bob, database = our_company > > alter user bob set search_path to bob,our_company_common,public; > > Not sure your use case is the same though... Yes, my case is very similar. I just want to avoid needing to remember to set the search_path every time. Since I alter the role to have a specific search_path as follows, all I need to do is login as "bob": create schema if not exists sgstemplate\p\g create role sgstemplate with login encrypted password ''\p\g alter role sgstemplate set search_path=sgstemplate,base,public\p\g grant connect on database PROJDB to sgstemplate\p\g "sgstemplate" gets reset by "sed s/sgstemplate/bob/g" I only wish I could set a default database as well, but IMHO that's a failing of JDBC as much as postgres. >