How to list databases in PostgreSQL

Ads
 

How to list databases in PostgreSQL

Hi,

I want to connect to Postgresql database and see all the databases stored in the database. How to list databases in PostgreSQL?

View Answers

February 7, 2019 at 3:13 AM

Hi,

You can do all these with the psql prompt of postgresql.

change user to postgres

su - postgres

The open psql tool by typing psql on the console:

psql

Now you can list the database names with the '\l' command. Here is example of listing databases in postgresql database server. List databases on the server:

\l

Then connect to database with the command:

\c template1

Thanks

Ads









Related Tutorials/Questions & Answers:
How to list databases in PostgreSQL
How to list databases in PostgreSQL  Hi, I want to connect to Postgresql database and see all the databases stored in the database. How to list databases in PostgreSQL?   Hi, You can do all these with the psql prompt
Hibernate 4 Supported Databases List
Hibernate 4 Supported Databases List In this tutorial you will learn that how many databases are supported by Hibernate. You must be looking for the list... the list of Hibernate supported databases with the name of Dialect to be used
Advertisements
Version of postgresql>postgresql dependency
List of Version of postgresql>postgresql dependency
Artifacts of postgresql
List of Artifacts of postgresql maven depenency
How to Install and Use PostgreSQL on Ubuntu 18.04
How to Install and Use PostgreSQL on Ubuntu 18.04  Hi, I want to install PostgreSQL on Ubuntu 18.04. I have Ubuntu 18.04 desktop installed on my system and need to install it. What are the process of installing PostgreSQL
How to Install and Use PostgreSQL on Ubuntu 18.04
How to Install and Use PostgreSQL on Ubuntu 18.04  Hi, I want to install PostgreSQL on Ubuntu 18.04. I have Ubuntu 18.04 desktop installed on my system and need to install it. What are the process of installing PostgreSQL
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql  i am working on a project... to know that how to query multiple databases(databases created in my mysql) so
Databases
Databases  how to add data dynamically into the database table?? i used back end is mysql....   1)form.jsp: <html> <form method="post" action="insertdata.jsp"> <table> <tr><td>Name:<
Version of cocoon>cocoon-databases dependency
List of Version of cocoon>cocoon-databases dependency
Version of com.dripower>postgresql-async_2.11 dependency
List of Version of com.dripower>postgresql-async_2.11 dependency
Version of com.eventsourcing>eventsourcing-postgresql dependency
List of Version of com.eventsourcing>eventsourcing-postgresql dependency
Version of postgresql>pljava-public dependency
List of Version of postgresql>pljava-public dependency
Version of com.snacktrace>storm-postgresql dependency
List of Version of com.snacktrace>storm-postgresql dependency
Switch databases
Switch databases  How do you inter-change between relational databases without code changes
how to list volumes in docker
how to list volumes in docker  Hi, I have docker and i want to list all the volumes. how to list volumes in docker? After listing i want to delete...; Hi, To list the volumes in docker you can use following command: docker
how to list environments in conda
how to list environments in conda  Hi, I am using Anaconda Python... want to get list of all the how environments in Anaconda Python. How to list... Anaconda Python for their work. You can use the following command to get list
how to list environments in conda
how to list environments in conda  Hi, I am using Anaconda Python... want to get list of all the how environments in Anaconda Python. How to list... Anaconda Python for their work. You can use the following command to get list
ModuleNotFoundError: No module named 'databases'
'databases' How to remove the ModuleNotFoundError: No module named 'databases' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'databases'  Hi, My Python
ModuleNotFoundError: No module named 'databases'
'databases' How to remove the ModuleNotFoundError: No module named 'databases' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'databases'  Hi, My Python
How to list files in hadoop?
How to list files in hadoop?  Hi, I want to list the files from a directory in HDFS. How to list files in hadoop? Thanks   Hi, Hadoop... provides commands to interact with the HDFS. To list down all the file
How to view a list of MySQL users and their privileges?
How to view a list of MySQL users and their privileges?  Hi, How to view a list of MySQL users and their privileges? It want to view these two... many users and databases on production server then you can easily view list
databases
databases
databases
databases
databases
Video Tutorial: Hibernate 4 Supported Databases List
Hibernate 4 Supported Databases List Hibernate being an object relational... databases. Here, the list of Hibernate 4 was compiled which supports the MySQL... tutorial of "Hibernate 4 Supported Databases List": There are several tutorials
How to get a list of MySQL user accounts?
How to get a list of MySQL user accounts?  Hi, I have MySQL database and I created many users for different databases. I want to see the names of all the users. How to get a list of MySQL user accounts? Thanks   Hi
How to get a list of MySQL user accounts?
How to get a list of MySQL user accounts?  Hi, I have MySQL database and I created many users for different databases. I want to see the names of all the users. How to get a list of MySQL user accounts? Thanks   Hi
How to make a new List in Java
How to make a new List in Java  Hi, I have to create list object in Java. How to make a new List in Java? Thanks   Hi, The easiest way is to use the new operator as shown below: List list = new ArrayList
How to use List in velocity
How to use List in velocity       This Example shows you how to use List in velocity. ...;new VelocityContext();   context.put("stuList", list);  

Ads