Обсуждение: BUG #14116: Character with value 0x0a must be escaped. using COPY FROM
The following bug has been logged on the website: Bug reference: 14116 Logged by: Mohammad alodadi Email address: mso1830@gmail.com PostgreSQL version: 9.5.2 Operating system: ubuntu Description: I tried to inserte large json rows from text file into postgres DB. however, there is error message says: ERROR: invalid input syntax for type json DETAIL: Character with value 0x0a must be escaped. CONTEXT: JSON data, line 1: ...at is closer rather than farther from the HQ?** COPY comments_full, line 1, column comment: "{"subreddit":"EliteDangerous","controversiality":0,"author_flair_css_class":null,"body":"**Power Pla..."
Re: BUG #14116: Character with value 0x0a must be escaped. using COPY FROM
От
Francisco Olarte
Дата:
On Wed, Apr 27, 2016 at 10:02 AM, <mso1830@gmail.com> wrote: > I tried to inserte large json rows from text file into postgres DB. however, > there is error message says: > ERROR: invalid input syntax for type json > DETAIL: Character with value 0x0a must be escaped. > CONTEXT: JSON data, line 1: ...at is closer rather than farther from the Seems right, all the json documents I have read say, more or less "A string is a sequence of Unicode code points wrapped with quotation marks (U+0022). All characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark (U+0022), reverse solidus (U+005C), and the control characters U+0000 to U+001F." ( Copied from http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf, which may not be the correct one but seems right for me ). In fact, noneof the software I presently use to read or generate json does accept OR PRODUCE unescaped 0x0A. Are you generating the json manually? Francisco Olarte.