Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 416
  • Last Modified:

selecting a database in postgres

Hi,
 like in mysql you have
use database db that selects the current database.

what is the equivalent in postgres ? it refuses "use database". In pg admin in the query editor how do I  write queries by not writing the name of the database all the time ?

thanks,
0
code4susant
Asked:
code4susant
1 Solution
 
earth man2Commented:
in postgresql you use schemas to partition the data.  You can use a schema path to specify the order in which schemas are interrogated for a particular entity.
0
 
gheistCommented:
There is no equivalent.
You can set PGDATABASE in your environment if you want default database other than your username.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Tackle projects and never again get stuck behind a technical roadblock.
Join Now