'pg' is the name of an extension for Ruby that provides access to libpq, the C application programmer’s interface to the PostgreSQL RDBMS.