Re: How would I get rid of trailing blank line?

From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How would I get rid of trailing blank line?
Date: 2009-04-03 01:20:44
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C04E84A66@egcrc-ex01.egcrc.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Hi Tom,

I am a bit surprised to hear that that '\n'
is there unconditionally. But I am sure
there are more pressing things for you to
work on. It's something I can live with.

Regards,

Tena Sakai
tsakai(at)gallo(dot)ucsf(dot)edu

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thu 4/2/2009 4:01 PM
To: Tena Sakai
Cc: pgsql-sql(at)postgresql(dot)org; pgsql-hackers(at)postgresql(dot)org
Subject: Re: [SQL] How would I get rid of trailing blank line?

"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 :-(

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-04-03 01:34:16 Re: [SQL] How would I get rid of trailing blank line?
Previous Message Sam Mason 2009-04-03 00:33:56 Re: [HACKERS] string_to_array with empty input

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Dunstan 2009-04-03 01:34:16 Re: [SQL] How would I get rid of trailing blank line?
Previous Message Adrian Klaver 2009-04-03 01:16:44 Re: FUNCTION problem