psql + jq
export SQL_QUERY="SELECT firstname, lastname, email FROM users"
echo "SELECT row_to_json(x.*) FROM (${SQL_QUERY}) x;" | psql postgresql://user:mdp@hostname:5432/dbname -t -- | jq -r 'to_entries|map(.value)|@csv'
1- Copy/paste results to a new spreadsheet
2- Select imported cells
3- Menu Data
> Split text to columns
4- Add a line on top, with column description
5- Select the first line (column descriptions)
6- Menu Data
> Create a filter