On Sat, Nov 20, 2004 at 12:39:38AM +0000, Marian D Marinov wrote: > Is there a way to list all databases which belong to the current user with an > SQL query?
Such information is in the system catalogs: http://www.postgresql.org/docs/7.4/static/catalogs.html If you run psql with the -E option, you can see the queries that psql makes when you issue commands like \l to show the list of databases and their owners. You can then copy those queries and modify them to meet your needs. The name of the current user is available as CURRENT_USER and SESSION_USER -- see the Miscellaneous Functions documentation for the difference: http://www.postgresql.org/docs/7.4/static/functions-misc.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match