pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Igal @ Lucee.org <igal@lucee.org>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: pg_dump and search_path
Date: Tue, 9 Jul 2019 08:48:44 -0700
Message-ID: <7dab1f15-0602-1350-23f7-1b01f2d36e45@lucee.org> (raw)
In-Reply-To: <CAKFQuwZ+s3chtdwhNPG5HZSaKx55qkfCWLY+q1LDdWpw2FGkLA@mail.gmail.com>
References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org>
	<94e28e8c-e5cf-f0b5-a148-43452446d9ec@aklaver.com>
	<fbe59d2f-79ce-1b8e-c96a-ef665f18f747@lucee.org>
	<CAKFQuwZ+s3chtdwhNPG5HZSaKx55qkfCWLY+q1LDdWpw2FGkLA@mail.gmail.com>

David,

On 7/9/2019 7:49 AM, David G. Johnston wrote:

> On Tue, Jul 9, 2019 at 7:41 AM Igal @ Lucee.org <igal@lucee.org 
> <mailto:igal@lucee.org>> wrote:
>
>     search_path is not set int he config, but rather with ALTER
>     DATABASE SET
>     search_path TO ... but I have executed that prior to the RESTORE
>     on the
>     target database.  Would it make a difference if I set it in the
>     config?
>
>
> What is your restore command then?  Because if you are dropping and 
> recreating the same named database the ALTER DATABASE SET command is 
> going to be lost with the drop since it is associated to an OID and 
> not just the name.  By placing the search_path into postgres.conf you 
> avoid that issue altogether.

The restore command is:

pg_restore.exe --verbose --single-transaction -h <ip> -p <port> -d 
<dbname> -U postgres <path-to-pgdump-file>

But how will I avoid the issue if the command  `SELECT 
pg_catalog.set_config('search_path', '', false);` is part of the pgdump 
file?  Wouldn't that override the config file setting during the restore 
process?

> But, yes, objects saved to the database should usually have schema 
> qualifications (which gets a bit messy with custom operators).  
> search_path reliance should probably be reserved to interactive use or 
> at worse client supplied queries.

In my case I use a separate Postgres cluster for each database and the 
roles, absent of any successful hacking, are all limited to trusted 
users, so the risk mentioned in the CVE is non-existent and it would be 
great if there was an option to turn off that "feature".

Thanks,

Igal

view thread (17+ messages)  latest in thread

Message-ID: <7dab1f15-0602-1350-23f7-1b01f2d36e45@lucee.org>
Permalink:  ../7dab1f15-0602-1350-23f7-1b01f2d36e45@lucee.org/
Also on:    postgresql.org/message-id/7dab1f15-0602-1350-23f7-1b01f2d36e45@lucee.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: igal@lucee.org, david.g.johnston@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: pg_dump and search_path
  In-Reply-To: <7dab1f15-0602-1350-23f7-1b01f2d36e45@lucee.org>
  References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org> <94e28e8c-e5cf-f0b5-a148-43452446d9ec@aklaver.com> <fbe59d2f-79ce-1b8e-c96a-ef665f18f747@lucee.org> <CAKFQuwZ+s3chtdwhNPG5HZSaKx55qkfCWLY+q1LDdWpw2FGkLA@mail.gmail.com> <7dab1f15-0602-1350-23f7-1b01f2d36e45@lucee.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox