This is an old revision of the document!
psql -U postgres -tA -c 'SELECT datname FROM pg_database' | sort