July 2017
Intermediate to advanced
656 pages
16h 1m
English
Postgres offers slight SQL variants (along with a non-standard superset) of SQL functionalities compared to MySQL.
Accepted convention in Postgres is to expect a database named after the user account that owns a given process. This is why in the getting ready section we ran createdb `whoami` on the command line.
When we instantiate pg.Client (storing the instance to the db variable), it reads the USER (or USERNAME on Windows) environment variable and attempts to connect to a database named after the current user, as that user, on the default Postgres port. By default, the database is passwordless.
The upshot is that we don't need to supply a configuration to pg.Client.
We call pg.connect to connect to the Postgres server and ...