Problem setting FIELDSEP variable

Moderator: NorbertKrupa

Post Reply
billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

Problem setting FIELDSEP variable

Post by billykopecki » Mon Jan 28, 2013 1:19 pm

Hi guys,

For some reason I can't get the filed separator to work. I'm using 6.1.

Code: Select all

dbadmin=> \pset fieldsep ','
Field separator is ",".
dbadmin=> select * from x;
   y   |   z
-------+-------
 data1 | data2
 data3 | data3
(2 rows)

Code: Select all

dbadmin=> \pset tuples_only
Showing only tuples.
dbadmin=> select * from x;
 data1 | data2
 data3 | data3
I expected to get this result set:

Code: Select all

dbadmin=> select * from x;
data1,data2
data3,data3
Thanks.

sarah
Intermediate
Intermediate
Posts: 77
Joined: Mon Aug 27, 2012 1:34 pm

Re: Problem setting FIELDSEP variable

Post by sarah » Mon Jan 28, 2013 2:09 pm

Billy,

You also need to use th the \a meta-command which will change the alignment.

Code: Select all

dbadmin=> \a
Output format is unaligned.
Have a GREAT day!

billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

Re: Problem setting FIELDSEP variable

Post by billykopecki » Mon Jan 28, 2013 2:33 pm

Thanks, Sarah! That did the trick :D

Code: Select all

dbadmin=> \a
Output format is unaligned.
dbadmin=> \t
Showing only tuples.
dbadmin=> \pset fieldsep ','
Field separator is ",".
dbadmin=> select * from x;
data1,data2
data3,data3

Post Reply

Return to “vSQL”