Re: Support UTF-8 files with BOM in COPY FROM
Peter Eisentraut <peter_e@gmx.net>
From: Peter Eisentraut <peter_e@gmx.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Tatsuo Ishii <ishii@postgresql.org>, david@kineticode.com, itagaki.takahiro@gmail.com, pgsql-hackers@postgresql.org
Date: 2011-09-26T18:49:16Z
Lists: pgsql-hackers
On mån, 2011-09-26 at 14:44 -0400, Robert Haas wrote: > > We did recently accept a patch for psql -f to skip over a UTF-8 > > byte-order mark. We had a lot of this same discussion there. > > But that case is different, because zero-width, non-breaking space has > no particular meaning in an SQL script - it's either going to be > ignored as a BOM, ignored as whitespace, or an error. But inside a > file being subjected to COPY it might be confusable with data that the > user wanted to end up in some table. Yes, my point was more directed toward the discussion about whether BOM in UTF-8 are valid at all. But your point pretty much kills this altogether. If I store a BOM in row 1, column 1 of my table, because, well, maybe it's an XML document or something, then it needs to be able to survive a copy out and in. The only way we could proceed with this would be if we prohibited BOMs in all user-data.