• how to disable the '(xx rows)' message

    From Luuk@21:1/5 to Luuk on Sat May 13 20:14:42 2017
    On 13-05-17 20:07, Luuk wrote:
    I have created a script to email some results from a query to meself..

    Basically something like this:

    (
    echo "To: luuk@inalid.lan"
    echo "Subject: TEST"
    echo "Content-Type: text/html; charset=us-ascii"
    echo
    echo "<html>"
    psql -H -f test.sql postgresql://user:passwd@here@test
    echo "</html>"
    ) | /usr/sbin/sendmail -f luuk@invalid.lan

    This works OK, but at the end of the email i always see a line like:
    (10 rows)

    Is it possible to remove this line with the help of postgresql?

    I know there are ways to do it with 'sed', but .... ;)



    i do not like the 'psql -t' optopn, because it also remove the headers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to All on Sat May 13 20:07:51 2017
    I have created a script to email some results from a query to meself..

    Basically something like this:

    (
    echo "To: luuk@inalid.lan"
    echo "Subject: TEST"
    echo "Content-Type: text/html; charset=us-ascii"
    echo
    echo "<html>"
    psql -H -f test.sql postgresql://user:passwd@here@test
    echo "</html>"
    ) | /usr/sbin/sendmail -f luuk@invalid.lan

    This works OK, but at the end of the email i always see a line like:
    (10 rows)

    Is it possible to remove this line with the help of postgresql?

    I know there are ways to do it with 'sed', but .... ;)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John-Paul Stewart@21:1/5 to Luuk on Sat May 13 15:08:05 2017
    On 13/05/17 02:07 PM, Luuk wrote:
    I have created a script to email some results from a query to meself..

    Basically something like this:

    (
    echo "To: luuk@inalid.lan"
    echo "Subject: TEST"
    echo "Content-Type: text/html; charset=us-ascii"
    echo
    echo "<html>"
    psql -H -f test.sql postgresql://user:passwd@here@test
    echo "</html>"
    ) | /usr/sbin/sendmail -f luuk@invalid.lan

    This works OK, but at the end of the email i always see a line like:
    (10 rows)

    Is it possible to remove this line with the help of postgresql?

    Yes. In psql the \pset meta-command can do all sorts of things. In
    your specific case, adding '\pset footer off' to the SQL before any
    queries will omit the undesired line.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to John-Paul Stewart on Sat May 13 21:55:51 2017
    On 13-05-17 21:08, John-Paul Stewart wrote:
    On 13/05/17 02:07 PM, Luuk wrote:
    I have created a script to email some results from a query to meself..

    Basically something like this:

    (
    echo "To: luuk@inalid.lan"
    echo "Subject: TEST"
    echo "Content-Type: text/html; charset=us-ascii"
    echo
    echo "<html>"
    psql -H -f test.sql postgresql://user:passwd@here@test
    echo "</html>"
    ) | /usr/sbin/sendmail -f luuk@invalid.lan

    This works OK, but at the end of the email i always see a line like:
    (10 rows)

    Is it possible to remove this line with the help of postgresql?

    Yes. In psql the \pset meta-command can do all sorts of things. In
    your specific case, adding '\pset footer off' to the SQL before any
    queries will omit the undesired line.


    Thanks, hard to find, that option... ;)
    Google did not find it when searching for:
    'postgresql do not show number of rows'
    But now it does.... how was i using Google 1 hour ago ....?


    Now i use
    $ psql -P border=0 -P footer=off -P title="something"

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)