Empty bytea format - 9.1devel pg_dump and psql

Started by Vladimir Kokovicover 15 years ago6 messagesbugs
Jump to latest
#1Vladimir Kokovic
kokovic.vladimir@gmail.com

Hi,

I'm not sure whether it is OK, a blank format for bytea, which is presented
in 9.1devel (pg_dump and psql)

Earlier versions (7, 8):
psql - signature bytea not null default '':: bytea
pg_dump - signature bytea default ''::bytea not null

postgresql.conf:
standard_conforming_strings = off
bytea_output = 'hex'

9.1devel:
psql - signature bytea not null default '\ x':: bytea
pg_dump - signature bytea default '\\x'::bytea not null

Best regards
Vladimir Kokovic, DP senior, Belgrade, Serbia

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Vladimir Kokovic (#1)
Re: Empty bytea format - 9.1devel pg_dump and psql

Excerpts from Vladimir Kokovic's message of sáb oct 16 15:45:02 -0300 2010:

Hi,

I'm not sure whether it is OK, a blank format for bytea, which is presented
in 9.1devel (pg_dump and psql)

Yeah, an empty bytea is now output differently by default (just like any
other bytea). The \x means "this bytea is output as a sequence of hex
pairs"; followed by no other chars, it represents an empty bytea.

Is this a problem? I find it slightly funny on stuff like \d default
values and such, but not enough to merit a special case.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#3Vladimir Kokovic
kokovic.vladimir@gmail.com
In reply to: Alvaro Herrera (#2)
Re: Empty bytea format - 9.1devel pg_dump and psql

Hi,

Yes, pgdiff shows the difference for a table that has fields with empty
bytea comparing 9.1devel and 8.4 pg_dump files!

Best regards,
Vladimir Kokovic, DP senior, Belgrade, Serbia

On Mon, Oct 18, 2010 at 5:45 PM, Alvaro Herrera
<alvherre@commandprompt.com>wrote:

Show quoted text

Excerpts from Vladimir Kokovic's message of sáb oct 16 15:45:02 -0300 2010:

Hi,

I'm not sure whether it is OK, a blank format for bytea, which is

presented

in 9.1devel (pg_dump and psql)

Yeah, an empty bytea is now output differently by default (just like any
other bytea). The \x means "this bytea is output as a sequence of hex
pairs"; followed by no other chars, it represents an empty bytea.

Is this a problem? I find it slightly funny on stuff like \d default
values and such, but not enough to merit a special case.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Vladimir Kokovic (#3)
Re: Empty bytea format - 9.1devel pg_dump and psql

Excerpts from Vladimir Kokovic's message of lun oct 18 14:50:30 -0300 2010:

Hi,

Yes, pgdiff shows the difference for a table that has fields with empty
bytea comparing 9.1devel and 8.4 pg_dump files!

Would it be enough to flip bytea_output?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#5Vladimir Kokovic
kokovic.vladimir@gmail.com
In reply to: Alvaro Herrera (#4)
Re: Empty bytea format - 9.1devel pg_dump and psql

Hi,

I think that empty bytea shoukd be like in 8.4, without \\x !

Best regards,
Vladimir Kokovic, DP senior, Belgrade, Serbia

On Mon, Oct 18, 2010 at 8:02 PM, Alvaro Herrera
<alvherre@commandprompt.com>wrote:

Show quoted text

Excerpts from Vladimir Kokovic's message of lun oct 18 14:50:30 -0300 2010:

Hi,

Yes, pgdiff shows the difference for a table that has fields with empty
bytea comparing 9.1devel and 8.4 pg_dump files!

Would it be enough to flip bytea_output?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vladimir Kokovic (#5)
Re: Empty bytea format - 9.1devel pg_dump and psql

Vladimir Kokovic <kokovic.vladimir@gmail.com> writes:

I think that empty bytea shoukd be like in 8.4, without \\x !

We could do that, but it seems completely cosmetic. The real problem
here is that you've got client-side code that doesn't understand the
hex-based format. It's going to break as soon as it sees a non-empty
bytea, so what's the use of trying to make the empty-string case
backwards compatible? It's probably better you find out about the
incompatibility sooner, so you can get on with fixing the real problem.

regards, tom lane