I am running some Vertica SQL queries from the command line and saving them to CSVs.
I want to keep column names, so I do not use the -t option. The problem is that I now am also left with the footer which gives the row count (e.g. (20 rows). I know that I could remove this footer in a separate command (as it will always be in the last row), but I was wondering if there is a more elegant solution.
I have been looking at the documentation here:
Use \pset footer off
.
More info on the metacommand is available at the documentation.
Example:
dbadmin=> select count(*) from sessions;
count
-------
5
(1 row)
dbadmin=> \pset footer off
Default footer is off.
dbadmin=> select count(*) from sessions;
count
-------
5