select distinct table_schema from information_schema.tables;
provides something like
table_schema
--------------------
mySchema
pg_catalog
information_schema
anotherSchem
(4 rows)
How to modify the command, in order not to see the first two (table_schema and ---) nor the last line (... rows)?
I'm using a psql command in a bash script. how can I add \pset tuples ... there?
From a shell script, you can use the psql option --tuples-only (shorter -t), which is more convenient than using \pset:
psql -t -c 'SELECT ...'
If you are only interested in a single query result, it is often best to do away with alignment and status messages as well:
result="$(psql -Atq -c 'SELECT ...')"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With