Re: psql blows up on BOM character sequence - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: psql blows up on BOM character sequence
Date
Msg-id CAHyXU0zJ=_09FpkcuX1_T1rM3=XuA6WsCbn+-cdN1631qwFnWQ@mail.gmail.com
Whole thread Raw
In response to Re: psql blows up on BOM character sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: psql blows up on BOM character sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Mar 21, 2014 at 4:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'd be okay with swallowing a leading BOM if and only if client encoding
> is UTF8.  This should apply to any file psql reads, whether script or
> data.

Yeah.  The one case that doesn't solve is:

cat f1.sql f2.sql | psql ...

Which is common usage in deployment systems where combining things
inside a single transaction scope is important.

There is no way for psql to handle that case though unless you'd strip
*all* BOMs encountered.  Compounding this problem is that there's no
practical way AFAIK to send multiple file to psql via single command
line invocation.  If you pass multiple -f arguments all but one is
ignored.

merlin



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql blows up on BOM character sequence
Next
From: Jim Nasby
Date:
Subject: Why is autovacuum_freeze_max_age a postmaster setting?