From: | Jasen Betts <jasen(at)xnet(dot)co(dot)nz> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: How would I get rid of trailing blank line? |
Date: | 2009-04-10 15:09:42 |
Message-ID: | grnnfm$51i$1@reversiblemaps.ath.cx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-sql |
On 2009-04-02, Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu> wrote:
> I am using postgres 8.3.4 on linux.
> I often use a line like:
> psql -tf query.sql mydatabase > query.out
>
> -t option gets rid of the heading and count
> report at the bottom. There is a blank line
> at the bottom, however. Is there any way to
> have psql not give me that blank line?
I ask postgres to format it for me instead of relying on psql
psql db_name -c "copy (select * from foo ) to stdout;"
this gives me postgres style tab separated values, but I can
have CSV (or any otther format COPY can do) if I want.
I usually use a more complex subquery with a list of columns and
expressions, where, order by clauses, etc... )
I use this in a script that pulls data from one database and inserts
in into another.
Requires postgres 8.2 or later
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2009-04-10 15:15:08 | Re: One click installer and pgInstaller collide |
Previous Message | l0rins | 2009-04-10 15:01:04 | unable to install tsearch2 on PostgreSQL 8.3.7 successfully |
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2009-04-10 18:20:20 | Re: changing multiple pk's in one update |
Previous Message | Jasen Betts | 2009-04-10 14:32:14 | Re: changing multiple pk's in one update |