Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJK1Q-0007zx-VW for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Nov 2017 14:04:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJK1P-0005jj-8V for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Nov 2017 14:04:31 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJK1P-0005jZ-2y for pgsql-bugs@lists.postgresql.org; Mon, 27 Nov 2017 14:04:31 +0000 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eJK1H-0004a1-65 for pgsql-bugs@postgresql.org; Mon, 27 Nov 2017 14:04:30 +0000 Received: from storagefox.foxi ([IPv6:2001:41f0:3160::5]) by smtp-cloud7.xs4all.net with ESMTPA id JK1EedZUpVNbYJK1Fe1dCR; Mon, 27 Nov 2017 15:04:22 +0100 Received: from techfox.localnet (techfox.foxi [192.168.0.31]) by storagefox.foxi (8.14.9/8.14.9) with ESMTP id vARE4Jlu035627 for ; Mon, 27 Nov 2017 15:04:19 +0100 From: Frank van Vugt To: pgsql-bugs@postgresql.org Subject: minor annoyance - search_path not reset in/after dump/restore Date: Mon, 27 Nov 2017 15:04:19 +0100 Message-ID: <3103514.ugGH0nFkBt@techfox> Organization: Foxi Group MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-CMAE-Envelope: MS4wfJ327PD+IlZwUAheMxcrsIeGBo32jL+PgZaf1NoBztJ2qkfscN+THvCmO+pIxZ/CdA5svD8/AsRyWtLRkPjs36ZpLOjRoVnCI41xneCbGoRz+eiUiWw9 +I52HOXxDNZyzCwv92pjm1a3C2GR4Mh+lsBgja+fG3g7Xc2YS562OnkYj6DOkxzbs8IDKhGNrqIAdw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk L.S. I'm not sure the following qualifies as a 'real' bug, but since it suprised me, I'd like to raise it here, just in case it surprises others as well. Postgresql version 9.6.6 The default value for the search_path is "$user", public. Since I'm using schema's, my pg_dump files contain lines like this: SET search_path = cnt_user, pg_catalog; for each particular schema part in the dump. However, at the end of the dump file, there's nothing to restore the search_path to the default / last value. This means that after restoring a dump via a psql console using a line like: \i /tmp/daily-db-backup the search_path value will be equal to that of the last schema restored... This causes unexpected output of commands like '\d' afterwards. Obviously, disconnecting/reconnecting 'fixes' things. -- Thanks, Frank.