Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkqDB-0006tw-6Y for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 13:31:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkqD7-00030g-47 for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 13:31:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkqB5-0002YF-Eg for pgsql-general@lists.postgresql.org; Tue, 09 Jul 2019 13:29:03 +0000 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkqB2-0006uj-Kk for pgsql-general@lists.postgresql.org; Tue, 09 Jul 2019 13:29:02 +0000 Received: by mail-ot1-x342.google.com with SMTP id q20so19944074otl.0 for ; Tue, 09 Jul 2019 06:29:00 -0700 (PDT) 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-transfer-encoding:content-language; bh=jpnAZDkN0JwGhIv7DMduVGddfZnTSIJijqX6FHXuDiw=; b=FU5RYh6GL09SvlMozRZ4tAxRwhr895kwljKWMmqumjNCXHRFNgL4WGi/JSGHeJpZpe V4GovRndkBbd+G0v07p7ttqbHo7Ba4AJHe33AAKfw3FyHn2YgJ3At3VYlOY90zjUQIeK UpfVsjh48S6eFGHuCYZriPztrSClHgmSaZlSZWI15Vv0YtedJTS4t+Dazdb6YZRoclu2 pMfiFM4Y6Ymh9vquFjptnqgeRjAWaAO89vthln5dVXts0HvwElalvtoE9b50oCVG0lPK +nJArTVV05I2JKH/UmEVDLYHVBlrbWOa0MIMkpYcH0IkCy22mFlHByQrTDnAY97EWDMg k7MQ== 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-transfer-encoding :content-language; bh=jpnAZDkN0JwGhIv7DMduVGddfZnTSIJijqX6FHXuDiw=; b=rdUNiq+FJmS94Y+JHHUjtqhN7Kl/g+jC/rjxx0AJXD6hVXo4QQ8nQllB0lZOAi8xNA U09Ua5u+cG6Q5akHXjsYiZ2CDWYaME9R+CHRrCQWxM3MFgOd0ZCc+UIBa3qxFPvq8PfY OTz48UShI1v/UpprjGo8UlKrQNgE6WdMTLUyLr5owtzt6NnWF+zITCaL9oUxxu7LSbxW AF7w2VnMzWZZuNCu2HPFVTi0lM3D+C62z8eMpY6yE5JstzLtbJQuQy3lsebGBZQYEIoD wuMniftvSd+m8wgKV9SCn8j58Mvzt/U1+R0TGc+SiLPPT4tfAK2UOC4fGsFv/Hm+OyNI GkdA== X-Gm-Message-State: APjAAAUF5f0H+0tZwBNKw2lEjRtGZhshB/OHmk9FpeFh9lKLCiF+InUc WtcdKz4KHdNhzyC662eYpymhQngcvH9R7w== X-Google-Smtp-Source: APXvYqx1iCSGTRd7q36bOVJCTjjk7tfQkwzWgRn3gPV1WgxcSt2gXn42BlLrk52eGDJE2jbUPyJCjA== X-Received: by 2002:a9d:66c8:: with SMTP id t8mr19499676otm.94.1562678938438; Tue, 09 Jul 2019 06:28:58 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id o23sm6591293oie.20.2019.07.09.06.28.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jul 2019 06:28:57 -0700 (PDT) Subject: Re: pg_dump and search_path To: pgsql-general@lists.postgresql.org References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org> <6e3e7900f9d470c6927112818c0aec59e1f91ac8.camel@cybertec.at> From: Ron Message-ID: <64b7168a-7fb4-ddb0-f7aa-298638fb64af@gmail.com> Date: Tue, 9 Jul 2019 08:28:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <6e3e7900f9d470c6927112818c0aec59e1f91ac8.camel@cybertec.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/9/19 2:22 AM, Laurenz Albe wrote: > On Mon, 2019-07-08 at 23:54 -0700, Igal @ Lucee.org wrote: >>> I have a custom search_path: >>> >>> # show search_path; >>> search_path >>> ---------------------------------- >>> "staging, transient, pg_catalog" >>> (1 row) >>> >>> I ran `pg_dump --schema-only` and the only reference in the output to >>> search_path is: >>> >>> SELECT pg_catalog.set_config('search_path', '', false); >>> >>> Then one of my functions which does not reference the full name of a >>> table with its schema fails with "relation [rel-name] does not exist". >>> >>> Is that a bug? I have seen some old posts about this issue but am not >>> sure if there is a ticket or why it still is an issue. >>> >> Looks like this might be by design. I will follow the links at >> https://www.postgresql.org/message-id/flat/MWHPR14MB160079A6D9DC64A2F60E9004C0D00%40MWHPR14MB1600.namprd14.prod.outlook.com >> and ask more questions if I have them. >> >> I might need to add the schema name to the table in my function. > Right. > > Allowing object lookup along the search_path during pg_restore opens > doors to abuse, because it can make a superuser inadvertedly execute > code crafted by an attacker. Then should search_path be set at the end of pg_restore? -- Angular momentum makes the world go 'round.