Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: to get the list of schemas in postgresql db

by erix (Vicar)
on Dec 04, 2011 at 11:27 UTC ( #941633=note: print w/ replies, xml ) Need Help??


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


Comment on Re: to get the list of schemas in postgresql db
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://941633]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2014-08-29 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls