Re: psql record separator

From: Charley Tiggs <lists(at)tiggs(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: psql record separator
Date: 2008-01-09 22:44:23
Message-ID: 47854E47.1060901@tiggs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom Lane wrote:
> Charley Tiggs <lists(at)tiggs(dot)net> writes:
>> I'm trying to create a CRLF record separator using the following syntax:
>> psql -R "\r\n" dbname username -c "select * from foo" > data_file.txt
>
>> But, no matter what I do, it only outputs a newline (\n). How can I
>> force the separator to be a windows line break (CRLF)?
>
> According to the code, -R only affects the output in "unaligned" output
> mode. Can you use that?

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

Charley

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2008-01-10 01:55:44 Re: psql record separator
Previous Message Tom Lane 2008-01-09 22:13:13 Re: psql record separator