Обсуждение: Empty bytea format - 9.1devel pg_dump and psql

Поиск
Список
Период
Сортировка

Empty bytea format - 9.1devel pg_dump and psql

От
Vladimir Kokovic
Дата:
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

Re: Empty bytea format - 9.1devel pg_dump and psql

От
Alvaro Herrera
Дата:
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

Re: Empty bytea format - 9.1devel pg_dump and psql

От
Alvaro Herrera
Дата:
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

Re: Empty bytea format - 9.1devel pg_dump and psql

От
Vladimir Kokovic
Дата:
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
>

Re: Empty bytea format - 9.1devel pg_dump and psql

От
Tom Lane
Дата:
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

Re: Empty bytea format - 9.1devel pg_dump and psql

От
Vladimir Kokovic
Дата:
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
>