“use database_name” command in PostgreSQL

后端 未结 5 940
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 07:23

I am beginner to PostgreSQL.

I want to connect to another database from the query editor of Postgres - like the USE command of MySQL or MS SQL Server. <

5条回答
  •  爱一瞬间的悲伤
    2020-12-07 07:54

    When you get a connection to PostgreSQL it is always to a particular database. To access a different database, you must get a new connection.

    Using \c in psql closes the old connection and acquires a new one, using the specified database and/or credentials. You get a whole new back-end process and everything.

提交回复
热议问题