Re: Strange behaviour with incompatible psql/server - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: Strange behaviour with incompatible psql/server
Date
Msg-id CABOikdPwBhMpdoYNqJ8KOf0XjRmHqka_wWP1bNyJkog16NePbw@mail.gmail.com
Whole thread Raw
In response to Re: Strange behaviour with incompatible psql/server  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Strange behaviour with incompatible psql/server
List pgsql-hackers


On Wed, Nov 28, 2012 at 2:28 PM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:
On 28.11.2012 10:46, Pavan Deolasee wrote:
While I'm almost certain that this has something to do with special
characters that my naked eyes can not see, all my attempts to spot the
difference has failed. So I really have two questions:

1. What's the difference between these files ?

Compare "hexdump -C bad.sql" and "hexdump -C good.sql". There's a UTF-8 Byte-Order-Mark at the beginning of bad.sql, see https://en.wikipedia.org/wiki/Byte_Order_Mark#UTF-8


Thanks. 

2. Why 9.0 psql works fine with that difference, but 8.4 psql does not ?

Dunno, I'll let you investigate that ;-)

So seems like this commit did the trick for later releases.

commit 93d3bac5648bddfe195a9cecc45ef0a2da5e85a8
Author: Peter Eisentraut <peter_e@gmx.net>
Date:   Sat Nov 21 23:59:12 2009 +0000

    Ignore UTF-8-encoded Unicode byte-order mark at the beginning of a file if
    the client encoding is UTF-8.
   
    a limited version of a patch proposed by Itagaki Takahiro


Should this not be back patched ? The error that's coming because not having this fix is rather very strange and hard to debug for any average individual. I'd almost concluded that one should NEVER use an old psql with a new server even though the warning that comes is not too glaring.

Thanks,
Pavan


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Strange behaviour with incompatible psql/server
Next
From: Pavan Deolasee
Date:
Subject: Re: Strange behaviour with incompatible psql/server