Skip site navigation (1) Skip section navigation (2)

Re: psql record separator

From: Charley Tiggs <lists(at)tiggs(dot)net>
To: Andrej Ricnik-Bay <andrej(dot)groups(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: psql record separator
Date: 2008-01-10 13:58:33
Message-ID: 47862489.4020407@tiggs.net (view raw or flat)
Thread:
Lists: pgsql-novice
Andrej Ricnik-Bay wrote:
> On 10/01/2008, Charley Tiggs <lists(at)tiggs(dot)net> wrote:
> 
>> I added the "-A" switch and it output the string "\r\n" instead of an
>> actual CRLF.
>>
>> psql -A -R "\r\n" -t dbname username -c "select * from foo" > data_file.txt
> I can't tell you what the proper incantation is (I didn't manage to get
> it to play nice within 10 minutes), but how about a hackish solution like:
> psql -A -t dbname username -c "select * from foo"|todos > data_file.txt

I got it to work by using the actual character surrounded by quotes. 
That's not ideal but at least I got the line endings I needed.

Charley

In response to

pgsql-novice by date

Next:From: Oeschey, Lars (I/EK-142, extern)Date: 2008-01-10 15:29:12
Subject: Re: Problem restoring database
Previous:From: kenneth d'souzaDate: 2008-01-10 12:15:28
Subject: Re: two postgres binaries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group