pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Matthias Apitz <guru@unixarea.de>
Cc: Postgres general <pgsql-general@postgresql.org>
Subject: Re: Two small questions re/ COPY CSV data into table
Date: Tue, 04 Jun 2019 18:51:26 +0100
Message-ID: <877ea18cli.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <20190604172054.GA4376@sh4-5.1blu.de>
References: <20190604100247.GA2800@c720-r342378>
	<877ea1aby6.fsf@news-spur.riddles.org.uk>
	<20190604150318.GA13915@sh4-5.1blu.de>
	<87sgsp8ikd.fsf@news-spur.riddles.org.uk>
	<20190604162650.GA15928@sh4-5.1blu.de>
	<87blzd8fdq.fsf@news-spur.riddles.org.uk>
	<20190604172054.GA4376@sh4-5.1blu.de>

>>>>> "Matthias" == Matthias Apitz <guru@unixarea.de> writes:

 Matthias> it is exported into the file as

 Matthias> 	cmd \| lpr ...

 Matthias> because the export delimiter is set to '|';

 Matthias> the COPY in text mode was complaining because it interpreted
 Matthias> the | of the sequence \| as an delimiter and the number of
 Matthias> columns did not matched.

 Matthias> I will provide tomorrow the exact input line, the exact COPY
 Matthias> command and the error.

This worked for me:

postgres=# copy ct(a,b,c,d,e) from stdin with delimiter '|';
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> 0|1| cat $1 \| lpr -Pprinter |3|4
>> \.
COPY 1

-- 
Andrew (irc:RhodiumToad)





view thread (10+ messages)  latest in thread

Message-ID: <877ea18cli.fsf@news-spur.riddles.org.uk>
Permalink:  ../877ea18cli.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/877ea18cli.fsf@news-spur.riddles.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, guru@unixarea.de
  Subject: Re: Two small questions re/ COPY CSV data into table
  In-Reply-To: <877ea18cli.fsf@news-spur.riddles.org.uk>
  References: <20190604100247.GA2800@c720-r342378> <877ea1aby6.fsf@news-spur.riddles.org.uk> <20190604150318.GA13915@sh4-5.1blu.de> <87sgsp8ikd.fsf@news-spur.riddles.org.uk> <20190604162650.GA15928@sh4-5.1blu.de> <87blzd8fdq.fsf@news-spur.riddles.org.uk> <20190604172054.GA4376@sh4-5.1blu.de> <877ea18cli.fsf@news-spur.riddles.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox