Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fksXx-00063x-6T for pgsql-general@arkaria.postgresql.org; Wed, 01 Aug 2018 14:56:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fksXv-0005tJ-Is for pgsql-general@arkaria.postgresql.org; Wed, 01 Aug 2018 14:56:15 +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.89) (envelope-from ) id 1fksXv-0005tB-B6 for pgsql-general@lists.postgresql.org; Wed, 01 Aug 2018 14:56:15 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fksXs-0008Gg-D0 for pgsql-general@lists.postgresql.org; Wed, 01 Aug 2018 14:56:14 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id w71Eu4On031483 for ; Wed, 1 Aug 2018 17:56:09 +0300 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id w71Eu4AD067565 for ; Wed, 1 Aug 2018 17:56:04 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: ALTER ROLE SET search_path produced by pg_dumpall gives : ERROR: syntax error at or near "$" . To: pgsql-general@lists.postgresql.org References: <25259.1532958693@sss.pgh.pa.us> <3632eeb3-d655-606c-ce31-c3035043a5b1@matrix.gatewaynet.com> <25764.1532959236@sss.pgh.pa.us> From: Achilleas Mantzios Message-ID: <44a9ab3c-8bde-6a27-cd99-1f2889288a6d@matrix.gatewaynet.com> Date: Wed, 1 Aug 2018 17:56:04 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <25764.1532959236@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-37.9 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_IT_PARTNERS,DYN_HAM_NAUTICAL,DYN_HAM_SIGNAT1,TW_PG, WEIRD_QUOTING autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 30/07/2018 17:00, Tom Lane wrote: > Achilleas Mantzios writes: >> On 30/07/2018 16:51, Tom Lane wrote: >>> Hm, that's not happening for me: >> You (and Adrian) are right. This is due to our own tweaking (which I had forgotten). Sorry for the false alarm. > It looks like your hack was to work around the bug that was fixed > properly in 742869946. You should be able to undo that now ... Hello Tom, On pgsql 10.4 , I reverted (undid) this patch/hack : root@smadev:/usr/local/src/postgresql-10.4# diff -u ./src/backend/utils/misc/guc.c ./src/backend/utils/misc/guc.c.hack --- ./src/backend/utils/misc/guc.c      2018-08-01 16:22:30.901629000 +0300 +++ ./src/backend/utils/misc/guc.c.hack 2018-08-01 15:45:15.893348000 +0300 @@ -3266,7 +3266,7 @@                 {"search_path", PGC_USERSET, CLIENT_CONN_STATEMENT,                         gettext_noop("Sets the schema search order for names that are not schema-qualified."),                         NULL, -                       GUC_LIST_INPUT | GUC_LIST_QUOTE +                       GUC_LIST_INPUT | GUC_REPORT                 },                 &namespace_search_path,                 "\"$user\", public", And (i.e. with stock 10.4) I tested with pgbouncer again in transaction mode, and still, (i.e. without GUC_REPORT) , pgbouncer client does not get from server and does not store the search path after the first server connection, and therefore, after server disconnects , the second time the client tries to connect it does not set the search_path . I tested with : GUC_LIST_INPUT | GUC_LIST_QUOTE | GUC_REPORT as well, but then I get the re-quote problem I was telling about : At first connection the search path is set correctly : bdynacom,epaybdynacom,epay,"$user", public but after server disconnection and re-connection the search path becomes : "bdynacom,epaybdynacom,epay,""$user"", public" which is wrong. So in order to retain all the benefits of transaction mode in pgbouncer I had to re-apply the first patch/hack, at the expense of the nuisance at pg_dumpall and search paths. > > regards, tom lane > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt