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 1o9CIK-0005J8-Ay for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 21:10:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o9CII-0004M3-Iz for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 21:10:46 +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 1o9CII-0004GP-7h for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 21:10:46 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o9CIC-0005Xv-5C for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 21:10:45 +0000 Received: by mail-pj1-x102f.google.com with SMTP id s21so11767639pjq.4 for ; Wed, 06 Jul 2022 14:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=r1tqIRlH+f17k4If2EsRfP6yrsHF3h90Dz4Lly0weSc=; b=DzQYbsUwx8CU4kJdb0GgvSd5lEqg02fFpvN1kFjrsruUDRatxqnaVYc93MpjuGuKmI JVij+/isugZcX8Ygy9yV3G2MuCFS02RtJIhq8r6J9xvw5cYJWNmDLAj7wShXOKAm2ixf uXP2tGD4IlVn7xd82dZj4mqowwy3udBJv9YlQ0HLISYDS3j6hfmEtSVpTYMqWBLffb4H VzxFFQqNh0g4uTTLJg7NtMbBZ0ivB96PNHnVq9lktuD7wzeaC2SR5TP9ZfII94DKEqfk zF+5ye41kdz/UohuIWu5yc3E9W/rkyXd89KNWoOfLveqsfa6reDsKdpEoDeIeNYN5hFR 8Zrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=r1tqIRlH+f17k4If2EsRfP6yrsHF3h90Dz4Lly0weSc=; b=zRaAfW4TE4J9KnvwnBJ8M24WPDDFp5uTY92cq4iHopvPYcsRjgA1wgPelJykyxCvph 9cJj6FgjIp2I3EYeg/FKrP8IguDGUz/NHLq/e4LKLOs1qLOXca/rPbN5jm14wKrmT29x xiFlVKFm5k3ZWQBnJqxbkldmPy121keFqk/o1B4q67vhxPxsrR5OpSoeYUk5eFNghHS5 XB23oU5i+9UQ9OfbDD4V/O5WE67czsSFl48zgC7Vsd65BBRloSOZtzN6j8n3UrSOJ3sd FzEEXNs+8FrfqL0/xEJFbHYUkyXhbpb7pK6uW0J5a6PJld49WfLks57u5d5KriOSnBcn a42Q== X-Gm-Message-State: AJIora/VTbtv/QW0HBJeAxgNuwK/vaMn+CvSQ9dE/g4cZG0wthXlyfIx PLjTijnMhAfu+dEtJqwlXPLdjUl7eOk= X-Google-Smtp-Source: AGRyM1sARdat7Stfh5cqKMK8gWDI40SV4wr/kT83KJb5/3PkhCRZ3rsx4FPX6yWIa9SvVWmFAdy/nQ== X-Received: by 2002:a17:902:8f89:b0:168:d336:ddba with SMTP id z9-20020a1709028f8900b00168d336ddbamr47727881plo.1.1657141838588; Wed, 06 Jul 2022 14:10:38 -0700 (PDT) Received: from [192.168.1.4] (c-71-195-204-99.hsd1.ut.comcast.net. [71.195.204.99]) by smtp.gmail.com with ESMTPSA id e4-20020a17090ae4c400b001ef8fb72224sm5094810pju.53.2022.07.06.14.10.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jul 2022 14:10:37 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------JPH0gq3l5hjXSZ26FheIMbbu" Message-ID: <8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com> Date: Wed, 6 Jul 2022 15:10:35 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Seems to be impossible to set a NULL search_path Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: <4B5F24E6-2FF9-4964-BF07-C609DC38E377@yugabyte.com> From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------JPH0gq3l5hjXSZ26FheIMbbu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/6/22 14:47, Bryn Llewellyn wrote: > The problem was my stupid typo: writing « set search_path = > 'pg_catalog, pg_temp'; » when I should *not* have typed those single > quotes. Now the demo that I'd intended gets the outcome that I'd expected: > > *select count(*) from pg_class; --------------<< 399 > create temporary table pg_class(k int); > select count(*) from pg_class; --------------<<   0 > set search_path = pg_catalog, pg_temp; > select count(*) from pg_class; --------------<< 400 > * There's no surprise here.  you read the system catalogue, made a table in whatever is the current schema which hid system's table, then hid your table by the new path. --------------JPH0gq3l5hjXSZ26FheIMbbu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 7/6/22 14:47, Bryn Llewellyn wrote:
The problem was my stupid typo: writing « set search_path = 'pg_catalog, pg_temp'; » when I should *not* have typed those single quotes. Now the demo that I'd intended gets the outcome that I'd expected:

select count(*) from pg_class; --------------<< 399
create temporary table pg_class(k int);
select count(*) from pg_class; --------------<<   0
set search_path = pg_catalog, pg_temp;
select count(*) from pg_class; --------------<< 400

There's no surprise here.  you read the system catalogue, made a table in whatever is the current schema which hid system's table, then hid your table by the new path.
--------------JPH0gq3l5hjXSZ26FheIMbbu--