in reply to to get the list of schemas in postgresql db
But TMTOWTDI (SQL standard compliant):
select schema_name from information_schema.schemata where schema_name <> 'information_schema' -- exclude 'system' schemata and schema_name !~ E'^pg_' -- exclude more 'system' (pg +-specific)
In psql there is \dn to retrieve schema names. If PGPASSFILE is set (and possibly more PG* environment variables like PGDATABASE), you can just talk to the database from the commandline:
echo '\dn' | psql
|
|---|