Обсуждение: Empty bytea format - 9.1devel pg_dump and psql
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
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
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
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: > Excerpts from Vladimir Kokovic's message of lun oct 18 14:50:30 -0300 201= 0: > > 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? > > -- > =C1lvaro Herrera <alvherre@commandprompt.com> > The PostgreSQL Company - Command Prompt, Inc. > PostgreSQL Replication, Consulting, Custom Development, 24x7 support >
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
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: > Excerpts from Vladimir Kokovic's message of s=E1b oct 16 15:45:02 -0300 2= 010: > > 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. > > -- > =C1lvaro Herrera <alvherre@commandprompt.com> > The PostgreSQL Company - Command Prompt, Inc. > PostgreSQL Replication, Consulting, Custom Development, 24x7 support >