Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qUp0j-00EwCl-Fj for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Aug 2023 13:50:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qUp0h-000Q1u-7c for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Aug 2023 13:50:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qUp0g-000Q1l-Uw for pgsql-hackers@lists.postgresql.org; Sat, 12 Aug 2023 13:50:31 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qUp0e-0024hJ-AI for pgsql-hackers@postgresql.org; Sat, 12 Aug 2023 13:50:30 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-58419517920so30738557b3.0 for ; Sat, 12 Aug 2023 06:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; t=1691848226; x=1692453026; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HkSTEtwSjeNg/sdn0d7BdPJw5WN3X2cHGh0QGK0F49M=; b=QIhYL4V/x3GgGZ2OmSdX8oME58hffalSJJyK5+Ot6nv5zSYiYdCgNqAfXuZsai3h8M WWFFEF05IydVEyL0O8kPaJxoZk71NqE0tJBtIRQKrZF+4n6CiQNxP0OyzYYnIYfAZHK1 xxxBPLYfUM4EqTQEf9EjOFGFwyI2ep1T3bmyFCj/cKPPNF7cy06DRRsp0bhVBJST21qu UVfuLclKPR6bdL/stBfRYl4JUqqhy0HefOrbePk2hnmG5XV79jXlUKg08hdAVCMZP2SQ J54fYNc8hhJ0xipDXpiAyA7eZhySysWvfRIdJQGQDmJPd0ZJ0smffMims7I9IHAoh2vo K3iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691848226; x=1692453026; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HkSTEtwSjeNg/sdn0d7BdPJw5WN3X2cHGh0QGK0F49M=; b=RPCzlTSa3PnUhc+Kbpji6SxtZAjJTbBu8vZOfMEGB01ts4ZftpFUyXs+fda2KA3tYk CEv1RdMgr4I000Kunjp1jTiV7RXoRdt4X3iHW7adh2DHjxLyJcIIbuQ9+P4cc3JjjoSx umNXFdycVRS2mUSNpP9juRYfuo3f/QKYM0WDJP/cxJOPv91HG3Wj15QoHu9L6DldH50U ljKcIYoDYieiO4qlMirNrLO7Uu5FzchEKUtlcbcIk/jFbGfoaUNJXBjO7t9mCR1/dfER vtzG9NeL+XIwuEe5WmRxfsWlQSz2QG44BTiEHRKBkn5Jy5HGj8Ss++hp6gElFzsDKb3o Kz1g== X-Gm-Message-State: AOJu0YxBkow7z69HOonku7JLdfGDur6F1/++Nk1OLrm3z2qDcNufj3Z3 3OSRyjUuJ1HEbcBpHtxvxMHkVg== X-Google-Smtp-Source: AGHT+IE2OP42os992FT1kJ0qSD5TraYwe0zzcj39B9qTa9+GYGCLjxcWyUbj65z3xPsK9zfaubjF8Q== X-Received: by 2002:a81:8302:0:b0:561:c5d4:ee31 with SMTP id t2-20020a818302000000b00561c5d4ee31mr4389498ywf.38.1691848226161; Sat, 12 Aug 2023 06:50:26 -0700 (PDT) Received: from [192.168.4.41] (162-239-31-113.lightspeed.dybhfl.sbcglobal.net. [162.239.31.113]) by smtp.gmail.com with ESMTPSA id z125-20020a0dd783000000b00561e7639ee8sm1634401ywd.57.2023.08.12.06.50.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Aug 2023 06:50:25 -0700 (PDT) Message-ID: <53f0b7f1-6290-3b99-5040-ac3541df1475@joeconway.com> Date: Sat, 12 Aug 2023 09:50:25 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION } Content-Language: en-US From: Joe Conway To: Jeff Davis , pgsql-hackers@postgresql.org References: <2710f56add351a1ed553efb677408e51b060e67c.camel@j-davis.com> <0e51f9e2-9272-ccb3-9219-39d7695f7c50@joeconway.com> In-Reply-To: <0e51f9e2-9272-ccb3-9219-39d7695f7c50@joeconway.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/12/23 09:15, Joe Conway wrote: > On 8/11/23 22:35, Jeff Davis wrote: >> 2. We can more accurately serve the user's intent. For instance, the >> safe search_path of "pg_catalog, pg_temp" is arcane and seems to be >> there just because we don't have a way to specify that pg_temp be >> excluded entirely. But perhaps in the future we *do* want to exclude >> pg_temp entirely. Knowing that the user just wants "SEARCH SYSTEM" >> allows us some freedom to do that. > > Personally I think having pg_temp in the SYSTEM search path makes sense > for temp tables, but I find it easy to forget that functions can be > created by unprivileged users in pg_temp, and therefore having pg_temp > in the search path for functions is dangerous. Hmm, I guess I was too hasty -- seems we have some magic related to this already. -- Joe Conway PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com