| От | Andrew Dunstan |
|---|---|
| Тема | Re: [SQL] How would I get rid of trailing blank line? |
| Дата | |
| Msg-id | 49D56798.3090402@dunslane.net обсуждение исходный текст |
| Ответ на | Re: [SQL] How would I get rid of trailing blank line? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
Tom Lane wrote:
> "Tena Sakai" <tsakai@gallo.ucsf.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
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера