Administering PostgreSQL

So I found this article which said:

 $ sudo -u postgres psql
 postgres=> alter user postgres password 'apassword';
 postgres=> create user your-user createdb createuser password 'passwd';
 postgres=> create database your-db-name owner your-user;
 postgres=> \q

Note: to enable password logins for the ‘postgres’ admin account, edit: /etc/postgresql/9.4/main/pg_hba.conf and after this line:

local   all             postgres                                peer

Add this line:

local   all             postgres                                md5

psql show tables

I wanted to know what the analogue for MySQL ‘show tables’ was in PostgreSQL, and I found the answer, use the information_schema, here:

mysql: SHOW TABLES
postgresql: \d
postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';

mysql: SHOW DATABASES
postgresql: \l
postgresql: SELECT datname FROM pg_database;

mysql: SHOW COLUMNS
postgresql: \d table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';

mysql: DESCRIBE TABLE
postgresql: \d+ table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';