Re: psql blows up on BOM character sequence

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Jim Nasby <jim(at)nasby(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql blows up on BOM character sequence
Date: 2014-03-21 21:47:14
Message-ID: CAHyXU0zJ=_09FpkcuX1_T1rM3=XuA6WsCbn+-cdN1631qwFnWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 21, 2014 at 4:28 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2014-03-21 21:49:53 Why is autovacuum_freeze_max_age a postmaster setting?
Previous Message Tom Lane 2014-03-21 21:28:13 Re: psql blows up on BOM character sequence