Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PSQL and -R (record separator)

Status
Not open for further replies.

gacaccia

Technical User
May 15, 2002
258
0
0
US
my understanding is that when outputting a select statment to file, the default record separator is a newline character (LF). i need to change this to CR/LF. i see documentation about the -R option when running a query from PSQL, but i can't find any documentation on what valid values are for the -R option. anyone know how to specify CR/LF for the record separator?

for example, i have something like...

Code:
psql -h localhost -p 5555 -U puser -d pdatabase -o c:\tabledump.txt -A -t -c "select * from ptable"

i want to add the -R option to specify CR/LF for record separator.

thanks,

glenn
 
Hi

On Linux/Unix using [tt]bash[/tt] :
Bash:
psql -h localhost -p 5555 -U puser -d pdatabase -o c:\tabledump.txt -A -t [red]-R $'\r\n'[/red] -c "select * from ptable"
If nobody else knows the answer, then ask in a Windows forum for [tt]'\r\n'[/tt]'s alternative.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top