0

I have created database in postgresql and want to connect database use command like use databaseName but its not working.What is the command to access specific date base in postgresql.

in my sql if want connect database we will use command like use databaseName not working in postgresql.

2 Answers 2

0

See the documentation for psql:

-d dbname

--dbname=dbname

Specifies the name of the database to connect to.

If you are already connected:

\c or \connect [ -reuse-previous=on|off ] [ dbname [ username ] [ host ] [ port ] | conninfo ]
Sign up to request clarification or add additional context in comments.

Comments

0

In shell:

psql -d postgres://dbuser:dbpwd@dbhost/databaseName

In postgresql repl:

\c databaseName

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.