2

I am quite new to postgresql and I am looking to timprove. I mostly use MySQL and from what I see already there are a few differences. Under mysql i would want to use or change my database (d1), i simply say the command

use d1;

What do I do under postgres?

I can view the databases and roles using commands such as:

select * from pg_roles;
select datname from pg_database;

Also are there comprehensive online resouces that I can point to?

Thanks

1 Answers1

3

Psql uses short commands prefixed by a backslash to identify 'meta-commmands'; inputs that are for the command shell and not commands to be sent to the database.

You can get a list of these by typing \?

You can change databases in psql by using \c databasename

Here's the psql documentation for the newest release

cms
  • 5,864
  • 2
  • 28
  • 31