From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu>, pgsql-sql(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [SQL] How would I get rid of trailing blank line? |
Date: | 2009-04-03 01:34:16 |
Message-ID: | 49D56798.3090402@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-sql |
Tom Lane wrote:
> "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu> writes:
>
>> 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?
>>
>
> Doesn't look like it --- the final fputc('\n', fout); seems to be
> done unconditionally in all the output formats. I wonder if we should
> change that? I'm afraid it might break programs that are used to it :-(
>
>
>
Right. There's a simple pipeline way to get rid of it:
psql -t -f query.sql | sed -e '$d' > query.out
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2009-04-03 02:08:40 | a few crazy ideas about hash joins |
Previous Message | Tena Sakai | 2009-04-03 01:20:44 | Re: How would I get rid of trailing blank line? |
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2009-04-03 02:53:37 | Re: How would I get rid of trailing blank line? |
Previous Message | Tena Sakai | 2009-04-03 01:20:44 | Re: How would I get rid of trailing blank line? |