Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How can I use the “psql” command for listing all databases with a particular name?

Asked by Dadhija Raj May 27, 2024 844 views 1 answer
Share

About this question

 I am a senior database manager for a large enterprise. One day, my team encountered an issue where they wanted or needed to quickly identify all the databases that are hosted on the Postgresql server. I decide to use the “psql” command line tool for this purpose. However, I also want to ensure that certain databases are displayed, excluding some that are not relevant to the present task. How can I use the “psql” command for listing all the databases whose names start with “e-commerce” and exclude any database which begins with “test” from appearing in the particular list? 

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.