Re: Insertion of large xml files into PostgreSQL 10beta1

From: Jan de Visser <jan(at)de-visser(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Alain Toussaint <atoussaint1976(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: Insertion of large xml files into PostgreSQL 10beta1
Date: 2017-06-29 02:32:33
Message-ID: 4873209.fKVuGm9KQG@coyote
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, June 25, 2017 11:02:41 PM EDT Alain Toussaint wrote:
> > Narrowing down the entire file to a small problem region and posting a
> > self-contained example,
>
> The url here contain the set of xml records from a publication I
> worked on many years ago:
>
> https://www.ncbi.nlm.nih.gov/pubmed/21833294?report=xml&format=text
>
> The particularly problematic region of the xml content is this:
>
> <CommentsCorrectionsList>
> <CommentsCorrections RefType="Cites">
> <RefSource>Neuroreport. 2000 Sep
> 11;11(13):2969-72</RefSource> <PMID Version="1">11006976</PMID>
> </CommentsCorrections>
> <CommentsCorrections RefType="Cites">
> <RefSource>J Neurosci. 2005 May
> 25;25(21):5148-58</RefSource> <PMID Version="1">15917455</PMID>
> </CommentsCorrections>
> <CommentsCorrections RefType="Cites">
> <RefSource>Neuroimage. 2003 Dec;20(4):1944-54</RefSource>
> <PMID Version="1">14683700</PMID>
> </CommentsCorrections>
>
> There is more of these type of comments in an given citation.
>
> > or at least providing the error messages and
> > content, might help elicit good responses.
>
> here it is:
>
> ERROR: syntax error at or near "44"
> LINE 1: 44(1):37-43</RefSources>

This string does not appear in your link above. Please match your example data
with your error message.

>
> the command I used is this one:
>
> echo "INSERT INTO samples (xmldata) VALUES $(cat
> /srv/pgsql/pubmed/medline17n0001.xml)" | /usr/bin/psql medline
> 1>/dev/null 2>error.log

I'm going to go out on a limb and assume the problem is unescaped quote
characters, or some other escape/quote problem. Hard to say though without
having the right data to look at.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-06-29 04:13:07 Re: Insertion of large xml files into PostgreSQL 10beta1
Previous Message Merlin Moncure 2017-06-28 20:34:19 Re: Is the row version available in SQL?