Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 11DF46576F for ; Tue, 31 Jul 2012 02:51:03 -0300 (ADT) Received: from sd-17937.dedibox.fr ([88.191.100.74]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sw5ME-0004x0-8s for pgsql-bugs@postgresql.org; Tue, 31 Jul 2012 05:51:03 +0000 Received: from [192.168.10.3] (AMontsouris-552-1-53-50.w92-140.abo.wanadoo.fr [92.140.28.50]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 4291E3B8F5; Tue, 31 Jul 2012 07:55:13 +0200 (CEST) Message-ID: <1343713848.2011.105.camel@localhost.localdomain> Subject: Re: Error on pg_settings.bytea_output for pg9.1 From: Guillaume Lelarge To: Craig Ringer Cc: "Emcisc (JinWei) Zhao" , pgsql-bugs@postgresql.org Date: Tue, 31 Jul 2012 07:50:48 +0200 In-Reply-To: <50174099.1050701@ringerc.id.au> References: <50174099.1050701@ringerc.id.au> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.3 (3.4.3-2.fc17) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/241 X-Sequence-Number: 33717 On Tue, 2012-07-31 at 10:19 +0800, Craig Ringer wrote: > On 07/30/2012 11:49 AM, Emcisc (JinWei) Zhao wrote: > > 5.Run the SQL query: "SELECT setting FROM pg_settings WHERE name = > > 'bytea_output'; " in pgAdmin3. It will show you the value 'escape'. > > > > 6.Run the client application 'psql' to connect to the same DB server > > and database with the same user account. And in psql interactive > > terminal, run the same SQL: > > > > "SELECT setting FROM pg_settings WHERE name = 'bytea_output'; ". It > > will show you the value 'hex', NOT the previous value 'escape'. > > > > 7.That means, the same environment, the same SQL query, but different > > output. And I don't touch the file any more ever before. > > > > Is this a bug of pgAdmin3? > > > > I don't know if it's a bug as such, but it's certainly a curious > decision if what you describe is the intended behaviour. It sounds like > PgAdmin-III might be sending a SET bytea_output = 'escape' query during > connection setup. > Yes, pgAdmin sets bytea_output, and also DateStyle, and client_min_messages, right after the connection is done. > bytea_output is a per-session parameter. Each session (connection) to > PostgreSQL can have a different value, and it can be changed within the > session. > > Check the PgAdmin-III preferences; there may be an option to control its > preferred bytea format. It may also be worth turning on log_statement = > 'all' in postgresql.conf, starting PgAdmin-III, then looking at the > PostgreSQL logs to see if PgAdmin-III is in fact sending a `SET > bytea_output` command. > There's no option to control this. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com