pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Field Separator not working?
3+ messages / 2 participants
[nested] [flat]

* Field Separator not working?
@ 2005-10-19 10:19 Mario Splivalo <mario.splivalo@mobart.hr>
  2005-10-19 10:43 ` Re: Field Separator not working? Richard Huxton <dev@archonet.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Mario Splivalo @ 2005-10-19 10:19 UTC (permalink / raw)
  To: pgsql-sql

I'm having troubles setting the field separator. I tried this on pg7.4,
8.0 and 8.1beta, and I always get the same results.

So, from within psql i do:
pulitzer2=# select * from pg_user;
  usename  | usesysid | usecreatedb | usesuper | usecatupd |  passwd  |
valuntil | useconfig
-----------+----------+-------------+----------+-----------+----------+----------+-----------
 mario     |        1 | t           | t        | t         | ******** |
|
 postgres  |      100 | t           | t        | t         | ******** |
|
 pulitzer2 |      102 | f           | f        | f         | ******** |
infinity |
 101       |      101 | f           | f        | f         | ******** |
infinity |
(4 rows)

pulitzer2=# \t
Showing only tuples.
pulitzer2=# \f#
Field separator is "#".
pulitzer2=# select * from pg_user;
 mario     |        1 | t           | t        | t         | ******** |
|
 postgres  |      100 | t           | t        | t         | ******** |
|
 pulitzer2 |      102 | f           | f        | f         | ******** |
infinity |
 101       |      101 | f           | f        | f         | ******** |
infinity |

pulitzer2=#


psql does tell me that I changed the field separator to "#", but it
still uses "|" as separator. I'm parsing the script from bash, using
psql, and setting the field separator options on the command line, but I
get similair results, the field separator is always "|", so I need to
awk-it with -F, but sometimes I have problems because data in my tables
often contain "|" charachter.

I've been looking trough the psql source code, but just like that, it's
too big hassle for me now :)

Am I doing something wrong?

	Mike
-- 
Mario Splivalo
Mob-Art
mario.splivalo@mobart.hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Field Separator not working?
  2005-10-19 10:19 Field Separator not working? Mario Splivalo <mario.splivalo@mobart.hr>
@ 2005-10-19 10:43 ` Richard Huxton <dev@archonet.com>
  2005-10-19 12:19   ` Re: Field Separator not working? Mario Splivalo <mario.splivalo@mobart.hr>
  0 siblings, 1 reply; 3+ messages in thread

From: Richard Huxton @ 2005-10-19 10:43 UTC (permalink / raw)
  To: mario.splivalo@mobart.hr; +Cc: pgsql-sql

Mario Splivalo wrote:
> pulitzer2=# \t
> Showing only tuples.
> pulitzer2=# \f#
> Field separator is "#".
> pulitzer2=# select * from pg_user;
>  mario     |        1 | t           | t        | t         | ******** |

> psql does tell me that I changed the field separator to "#", but it
> still uses "|" as separator. I'm parsing the script from bash, using
> psql, and setting the field separator options on the command line, but I
> get similair results, the field separator is always "|", so I need to
> awk-it with -F, but sometimes I have problems because data in my tables
> often contain "|" charachter.

You'll want this too:
   \pset format unaligned

man psql or see the manual for full details
-- 
   Richard Huxton
   Archonet Ltd



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Field Separator not working?
  2005-10-19 10:19 Field Separator not working? Mario Splivalo <mario.splivalo@mobart.hr>
  2005-10-19 10:43 ` Re: Field Separator not working? Richard Huxton <dev@archonet.com>
@ 2005-10-19 12:19   ` Mario Splivalo <mario.splivalo@mobart.hr>
  0 siblings, 0 replies; 3+ messages in thread

From: Mario Splivalo @ 2005-10-19 12:19 UTC (permalink / raw)
  To: Richard Huxton <dev@archonet.com>; +Cc: pgsql-sql

On Wed, 2005-10-19 at 11:43 +0100, Richard Huxton wrote:
> Mario Splivalo wrote:
> > pulitzer2=# \t
> > Showing only tuples.
> > pulitzer2=# \f#
> > Field separator is "#".
> > pulitzer2=# select * from pg_user;
> >  mario     |        1 | t           | t        | t         | ******** |
> 
> > psql does tell me that I changed the field separator to "#", but it
> > still uses "|" as separator. I'm parsing the script from bash, using
> > psql, and setting the field separator options on the command line, but I
> > get similair results, the field separator is always "|", so I need to
> > awk-it with -F, but sometimes I have problems because data in my tables
> > often contain "|" charachter.
> 
> You'll want this too:
>    \pset format unaligned
> 
> man psql or see the manual for full details

Hopla. It works perfetcly, thnx. Sometimes we're lazy to trough-read the
manuals :)

	Mario
-- 
Mario Splivalo
Mob-Art
mario.splivalo@mobart.hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-10-19 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-19 10:19 Field Separator not working? Mario Splivalo <mario.splivalo@mobart.hr>
2005-10-19 10:43 ` Richard Huxton <dev@archonet.com>
2005-10-19 12:19   ` Mario Splivalo <mario.splivalo@mobart.hr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox