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 1l3EpL-000662-7a for pgsql-general@arkaria.postgresql.org; Sat, 23 Jan 2021 09:03:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l3EpI-0000v9-Au for pgsql-general@arkaria.postgresql.org; Sat, 23 Jan 2021 09:03:24 +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 1l3EpI-0000v0-0J for pgsql-general@lists.postgresql.org; Sat, 23 Jan 2021 09:03:24 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l3EpF-0003XW-C6 for pgsql-general@lists.postgresql.org; Sat, 23 Jan 2021 09:03:22 +0000 Received: by mail-wr1-x436.google.com with SMTP id c12so7309523wrc.7 for ; Sat, 23 Jan 2021 01:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E2iFdRA+OVdOsw8268iZ/ioBOc3A64MY0ETplJmQNXs=; b=qT5Ae2lFZHuk6q1B+hBCkmEYx8V8EaQhiXomhT+TdAsml2uzhZFKjn4wQ6dQNYkcth rxMb9RzeUIhwiC+5/jAhfYW16w3lHGexlyuJjO0a0TgUfbR2AJxgui1/DJVPTlpvRnPB nuTHvDybp+Vo6dx9kksYkplbkO6RlaCJDFdbXJNOUbzguPqFg4E6d3fmqWOZYlxLASmR sUmuGdoEITBbpHyH1KrEU+/1FhwketyRlJrXllYcDqW0VSesGVdwTRaeFu1WLEPh4+o6 XcbNiTmIKlqJdplSxBMm1ZTZ2LQfzIGMOWv7XJf8mEWV235otcjzxz+GeTrKdbC5zQNm 8+VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E2iFdRA+OVdOsw8268iZ/ioBOc3A64MY0ETplJmQNXs=; b=BK16N6P0e1CIaA/wHxskED8u5vqXIKzaBbA4WpXDe7hdXCnGZPWGhFzQ6TvlcQJcMh n5pN/pwrChg84xzvXtIVeMpelXEMow7uH69BzkqQYCegOfU+zTq629FA3y646pA3TBXZ 68CaKjysSYtfZZPVRXUqbOCMFIiu1Xx59QLJ25iR3lIwOuEe3IzjpLIKwigAALxH7Hl9 UcKBB2EuMndtVqfKYk6B3P4zsaAGsidNCo6Wja2RjPIQhaekheT72ZjnWcXIYD3vS+bn kTDcyoHvwrqePSaBxojIO/161DNbmDlJZVEQEmZbq1dJUuUwf2jVU+1OOwz1GlcKP2Q4 R5aQ== X-Gm-Message-State: AOAM531wHJ42Hg5XTtbcodlv//nsl/mKKSciiluRALFZ4WCAfQdVuydd 4wuchEYpyW890hX0sBdHS2Q= X-Google-Smtp-Source: ABdhPJyoTj6MgnR/5NjrJWt0Ts0+aZiaqgr4KxzRhn6hbNy/tSm0GYG8HlDAZOy7KD7ro0iyvqilnA== X-Received: by 2002:a5d:61c4:: with SMTP id q4mr8253414wrv.304.1611392599938; Sat, 23 Jan 2021 01:03:19 -0800 (PST) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id g9sm14388182wmh.3.2021.01.23.01.03.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jan 2021 01:03:19 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: localhost ssl From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: Date: Sat, 23 Jan 2021 10:03:18 +0100 Cc: Adrian Klaver , "pgsql-generallists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <0583B416-4A3B-44DE-8C1B-3345775B1180@gmail.com> 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> To: Rob Sargent X-Mailer: Apple Mail (2.3654.40.0.2.32) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Rob, > On 22. Jan, 2021, at 23:48, Rob Sargent wrote: >=20 > 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 didn't follow the whole discussion, so sorry, to just jump in here. You don't need to remember the search_path once your role is set up = correctly. The following example demonstrates that you can set a default = search_path for a role. But keep in mind that it is a *default* = search_path for that role, which means a) it's for that role only and b) = since it's a default, it is in effect only after the next login to that = role. db01=3D# \conninfo=20 You are connected to database "db01" as user "paul" on host ... db01=3D# show search_path; search_path =20 ----------------- "$user", public (1 row) db01=3D# \dn List of schemas Name | Owner =20 --------+---------- public | postgres (1 row) db01=3D# create schema s1; CREATE SCHEMA db01=3D# create schema s2; CREATE SCHEMA db01=3D# create schema s3; CREATE SCHEMA db01=3D# \dn List of schemas Name | Owner =20 --------+---------- public | postgres s1 | paul s2 | paul s3 | paul (4 rows) Now comes the crucial part. Notice that the search path still shows the = old value until I reconnect: db01=3D# alter role paul set search_path to s2, s3; ALTER ROLE db01=3D# show search_path; search_path =20 ----------------- "$user", public (1 row) db01=3D# \c db01 psql (13.1, server 12.5) You are now connected to database "db01" as user "paul". db01=3D# show search_path; search_path=20 ------------- s2, s3 (1 row) See? No $user, public or s1 after connecting to the database, only s2 = and s3 as specified by me. The same applies to resetting it to its default values "$user", public: db01=3D# alter role paul reset search_path; ALTER ROLE db01=3D# show search_path; search_path=20 ------------- s2, s3 (1 row) db01=3D# \c db01 psql (13.1, server 12.5) You are now connected to database "db01" as user "paul". db01=3D# show search_path; search_path =20 ----------------- "$user", public (1 row) There's a lot of descriptions on how this works. Just google for = something like "postgres set default search path". Also, see chapter 5.9.3 of the docs: The Schema Search Path = https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH Hope this helps. Cheers, Paul=