Обсуждение: Setting the table separator in psql command mode

Поиск
Список
Период
Сортировка

Setting the table separator in psql command mode

От
Mehrdad Ghassempoory
Дата:
I am trying to set up the table separator (Default "|") to TAB
caharcter.

I have tried :

\f\t
\f \t
\f '\t'

Without any luck.
How is it done?


Re: [GENERAL] Setting the table separator in psql command mode

От
Herouth Maoz
Дата:
At 15:59 +0300 on 9/6/98, Mehrdad Ghassempoory wrote:


> I am trying to set up the table separator (Default "|") to TAB
> caharcter.
>
> I have tried :
>
> \f\t
> \f \t
> \f '\t'
>
> Without any luck.
> How is it done?

Seems impossible, for some reason. Why do you want to do that? The header
separator will be misaligned with the fields.

If you just want the data separated by tabs, you can use \copy. If you want
only some of the data, you can select it into a temporary table and then
use \copy.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



Re: [GENERAL] Setting the table separator in psql command mode

От
JohnDz
Дата:
Mehrdad Ghassempoory wrote:
>
> I am trying to set up the table separator (Default "|") to TAB
> caharcter.
>
> I have tried :
>
> \f\t
> \f \t
> \f '\t'
>
> Without any luck.
> How is it done?

I found that the following works:

psql -F '    ' yourdatabasename

where a tab character is inserted in between the ' '



--
-----------------------------------------------------------------
|John Dzilvelis                                                 |
-----------------------------------------------------------------

Re: [GENERAL] Setting the table separator in psql command mode

От
"Jose' Soares Da Silva"
Дата:
On Tue, 9 Jun 1998, Mehrdad Ghassempoory wrote:

> I am trying to set up the table separator (Default "|") to TAB
> caharcter.
>
> I have tried :
>
> \f\t
> \f \t
> \f '\t'
>
> Without any luck.
> How is it done?
Try psql -F"    "
            ^^^^ this mean ^I

       Jose'


Re: [GENERAL] Setting the table separator in psql command mode

От
Bruce Momjian
Дата:
>
> Mehrdad Ghassempoory wrote:
> >
> > I am trying to set up the table separator (Default "|") to TAB
> > caharcter.
> >
> > I have tried :
> >
> > \f\t
> > \f \t
> > \f '\t'
> >
> > Without any luck.
> > How is it done?
>
> I found that the following works:
>
> psql -F '    ' yourdatabasename
>
> where a tab character is inserted in between the ' '

6.4 will have this working as your originally expected.

--
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)

HELP

От
Ricardo Romero
Дата:
Somebody, HELP-ME PLEASE.

Tks, Romero

Using FreeBSD 2.2.5, postgreSQL 6.3.2

When i connect to PostgreSQL with pgsql ( user ) everything is fine.

But with root, no chances.

# who am i
root     ttyp2   Jun 10 18:54   (:0.0)
# perl romero.pl
Can't load '/usr/local/lib/perl5/site_perl/i386-freebsd/auto/Pg/Pg.so' for
module Pg: Can't find shared library "libpq.so.1.1" at
/usr/local/lib/perl5/i386-freebsd/5.00404/DynaLoader.pm line 166.

 at romero.pl line 3
BEGIN failed--compilation aborted at romero.pl line 3.
# cat romero.pl
#!/usr/local/bin/perl -w

use Pg;

$conn = Pg::connectdb("dbname=template1");
if(!$conn) {
print "Houve erro\n";
exit(1);
}


print "Vou fazer a query \n\n";
Pg::doQuery($conn, "select eu from eumesmo",\@ary);
print "Fiz a query \n\n";

#Pg::doQuery($conn, "select eu from eumesmo", \@ary);

#write;

 for $j ( 0 .. $#ary ) {
             print "Ai o que voce queria garotinho : $ary[$j][00]\n";
 }

#$tot=$#ary+1;
$~ = 'PIEDE';
#write;

exit(0);
# psql template1
ld.so failed: Can't find shared library "libpq.so.1.1"
#