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

What every programmer should know about memory

Just stumbled upon What every programmer should know about memory:

  1. Part 1 (Introduction)
  2. Part 2 (CPU Caches)
  3. Part 3 (Virtual memory)
  4. Part 4 (NUMA systems)
  5. Part 5 (Cache optimization)
  6. Part 6 (Threaded optimizations)
  7. Part 7 (Memory performance tools)
  8. Part 8 (Future technologies)
  9. Part 9 (Appendices and bibliography)

C++ Virtual Destructors and Base Classes

I’ve been wondering what happens when a derived class defines a virtual destructor. What about its base destructors? Are they called? If so, when? I finally read the right paragraph in The C++ Programming Language (pg 70):

A virtual destructor is essential for an abstract class because an object of a derived class is usually manipulated through a pointer to a base class. Then, the virtual function call mechanism ensures that the proper destructor is called. That destructor then implicitly invokes the destructors of its bases and members.

Still not sure when the bases and members are destructed, presumably after the derived virtual destructor…