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