Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id AFF5C14D8291 for ; Mon, 30 Jul 2012 23:19:26 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sw23Q-000567-Kd for pgsql-bugs@postgresql.org; Tue, 31 Jul 2012 02:19:25 +0000 Received: by pbbrp8 with SMTP id rp8so10830477pbb.19 for ; Mon, 30 Jul 2012 19:19:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=UnZgdl1C8zUEqeoOQ9G2YeAg2c1WHK3XzOcpWEAy43k=; b=EoOGSPaJQe1hB+om0iaCszUYblTkwjxEoXLf/hp4xQko12ePzRUcmTux03cPTqfYW2 IZpatZaE3KX/2zLDMhqPhwxXJnalfn0v5IFUrlErwz5zNA0wcuIXoAAtOsdY8lCNGKu4 Nn9vO+t7Kn+c2utxtssPOJrWdfRXV0CvcnmeP7X+M/d4lXa3JcXZ4VFT1dUwxEx9g6kl xObErkUsZooU1WB0eQY5LDwEuaIRJ2YHlzT1O1QjEb54LXhOWYs4xoM93tzRpEwRgzOD MPbXLiGJo9exfcRtA+xbcvCHsWoj4geXG89r9fgpSjLZfcfqPH5gSMu1v+4OHV6NX+Rd SkSg== Received: by 10.66.75.228 with SMTP id f4mr28727700paw.52.1343701150592; Mon, 30 Jul 2012 19:19:10 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id of1sm9050452pbb.15.2012.07.30.19.19.07 (version=SSLv3 cipher=OTHER); Mon, 30 Jul 2012 19:19:09 -0700 (PDT) Message-ID: <50174099.1050701@ringerc.id.au> Date: Tue, 31 Jul 2012 10:19:05 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: "Emcisc (JinWei) Zhao" CC: pgsql-bugs@postgresql.org Subject: Re: Error on pg_settings.bytea_output for pg9.1 References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------060906040000060309030801" X-Gm-Message-State: ALoCoQmFK0RZcUwpbH6/hmCWPw7y+Mb7OFMrWu9CC8+MySjOTTD+Gz4CmCX2e1NzCAPxK0PSNA6w X-Pg-Spam-Score: -1.8 (-) X-Archive-Number: 201207/237 X-Sequence-Number: 33713 This is a multi-part message in MIME format. --------------060906040000060309030801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. 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. -- Craig Ringer --------------060906040000060309030801 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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 <postgresql.conf> 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.

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.

--
Craig Ringer
--------------060906040000060309030801--