RE: [QUESTIONS] Using psql \f to change delimiter to space

Started by Jackson, DeJuanover 27 years ago3 messages
#1Jackson, DeJuan
djackson@cpsgroup.com

Forwarded to HACKERS list.
-DEJ

Show quoted text

When I invoke psql, the default delimiter is the pipe "|"
character. I can't find the correct syntax to
change the delimiter back to a single space. If I
type :
\f <whitespace> -- delimiter stays at |
\f \<whitespace> -- delimiter stays at |

Enclosing the space within single or double quotes produces
a delimiter that actually includes the quotes. I tried
octal specification \040 for the space which also failed.

Version 6.3.2 on Linux i386 (Redhat 4).

What's the correct syntax?

Marc Zuckman
marc@fallon.classyad.com

_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
_ Visit The Home and Condo MarketPlace _
_ http://www.ClassyAd.com _
_ _
_ FREE basic property listings/advertisements and searches. _
_ _
_ Try our premium, yet inexpensive services for a real _
_ selling or buying edge! _
_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

--
Official WWW Site: http://www.postgresql.org
Online Docs & FAQ: http://www.postgresql.org/docs
Searchable Lists: http://www.postgresql.org/mhonarc

#2Jackson, DeJuan
djackson@cpsgroup.com
In reply to: Jackson, DeJuan (#1)

When I invoke psql, the default delimiter is the pipe "|"
character. I can't find the correct syntax to
change the delimiter back to a single space. If I
type :
\f <whitespace> -- delimiter stays at |
\f \<whitespace> -- delimiter stays at |

Enclosing the space within single or double quotes produces
a delimiter that actually includes the quotes. I tried
octal specification \040 for the space which also failed.

Version 6.3.2 on Linux i386 (Redhat 4).

What's the correct syntax?

I just did

\f \
^ space here

See:

----------------------------------------------------------------------
-----

test=> \f \
field separator changed to ''
test=> select * from pg_user
test-> \g
usename usesysidusecreatedbusetraceusesuperusecatupdpasswd valuntil

----------------------------------------------------------------------
------------------
postgres 139t t t t ********Sat Jan 31
01:00:00 2037 EST
(1 row)

Sorry to correct you Bruce but that causes the delimiter to be set to
nothing ('') not space (' ').

-DEJ

#3Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Jackson, DeJuan (#2)
Re: [QUESTIONS] Using psql \f to change delimiter to space

When I invoke psql, the default delimiter is the pipe "|"
character. I can't find the correct syntax to
change the delimiter back to a single space. If I
type :
\f <whitespace> -- delimiter stays at |
\f \<whitespace> -- delimiter stays at |

Sorry to correct you Bruce but that causes the delimiter to be set to
nothing ('') not space (' ').

I stand corrected. This has been asked before, and the only solution I
know is:

psql -F ' ' testdb

Is that acceptable, or do you want it to work with \f? The problem is
that the trailing spaces are removed from all command lines, so it is not
seeing the space.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)