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 1l33ir-0002Hf-Cj for pgsql-general@arkaria.postgresql.org; Fri, 22 Jan 2021 21:12:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l33iq-0006vT-Ba for pgsql-general@arkaria.postgresql.org; Fri, 22 Jan 2021 21:12:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l33iq-0006vM-1X for pgsql-general@lists.postgresql.org; Fri, 22 Jan 2021 21:12:00 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l33in-0006YD-IB for pgsql-general@lists.postgresql.org; Fri, 22 Jan 2021 21:11:58 +0000 Received: by mail-io1-xd31.google.com with SMTP id h11so13978469ioh.11 for ; Fri, 22 Jan 2021 13:11:57 -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=h2N0xvjJqz6b+O81yw8Eti5Q1w9ArlF9hcc183Aa+xw=; b=C7EdZBcd7ue/K6YlCDR/+84VJqLooU6FXcjeGPw96AsRxv4m8W7m2GH+yG9IyQL2Ut 1n70Xz3A1c15JVP29E1bJ2TGDCIYtYSo36XV7Wg7SSGm3tWWOWdgaqpEtad4oSeOtnWA zczpJId0/2iKJ2BE2ekQOvDj+55H469cT1nGN4JTXu1OIqmm5sLY6GOLBXq0ubgX+WwP txELh9LLS0jBkf84AkBH6ypSRNkoP6Xc0oRkxkwpHQ2h5+K1pxuCCJGOqXSv+d4bVwmk oQdbLBZ+io9l3Jxpm8wpyQtYPpWaX7CWuFhdZEBZBd0GnTXavhN/87Sldh/Yz7o8ST7N RrwQ== 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=h2N0xvjJqz6b+O81yw8Eti5Q1w9ArlF9hcc183Aa+xw=; b=J5wje5i+GnmsuPx2K2HS2wBxrMbh8qy/OCVH/HfE0Lk9acx+36/cixz8vdnD9Qcbgp MA+/6WjMEMOFombZ1vdpcxoks6lgD0bC/QFnkGn0xqdxCp44iC8jdBIKg9wdsqivIdO+ yt8tfCYngQklnRNFA2NVdO1xJqajWRFA8qBUpchs0UZS2iG3Z2/ofd3m+VqfQBbmS9Go ZDARytp022xQIkLfzuZ5edxcSih/OjZTWyqJKthYl18VqFF890GYko+w5AIeVWYlreUW nAB4MEOj8wYaGCAWbGXaMjh7dXhnHO+w/T8k6HwseIlD/D6FieP6wrNvs/hZAtzy6X39 BV4Q== X-Gm-Message-State: AOAM5327eTU/zABHe6uopKx47kudvNAa/B7n+gxVvWUKZ/edJxEw6aPH iMpjf2pCuesKUOPZkwdkZD3LzHR6pO0= X-Google-Smtp-Source: ABdhPJz5eCxsIQpKsjuCMIgL82M4YIGl8rK6jNQT73WRXrCCIxEc6cJMhnXtJ30cdan1Q71hvRBE+g== X-Received: by 2002:a6b:216:: with SMTP id 22mr219587ioc.145.1611349916512; Fri, 22 Jan 2021 13:11:56 -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 f80sm7026324ilg.8.2021.01.22.13.11.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 13:11:56 -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> From: Rob Sargent Message-ID: <2f653f6c-5f27-13fd-49be-90845a45ef43@gmail.com> Date: Fri, 22 Jan 2021 14:11:55 -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: <5f8db865-2f0e-6764-f2f0-b344feb42368@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > No, as I really have no idea what: > > "In production I hope to name the role with each connection as I want > the search_path set by the connecting role. ..." > > means? My apologies: I rely on the search_path being set according to the role (--user). Perhaps what I was missing is that the connection string uses both username and certificate? > > I would point out this: > > https://www.postgresql.org/docs/12/auth-cert.html > > "User name mapping can be used to allow cn to be different from the > database user name." > Just prior to that quote is "The cn (Common Name) attribute of the certificate will be compared to the requested database user name, and if they match the login will be allowed." which leads to me to believe I would need a cert per role. > which leads to this: > > https://www.postgresql.org/docs/12/auth-username-maps.html I don't think the mapping tricks help me, but happy to be convinced otherwise. I have specific roles accessing specific schemas via sql which is not schema qualified.