George V. Reilly

Creating a New PostgreSQL Database at RDS

Many of us are guilty of saying “database” when we mean a database server or a DBMS. A database is a collection of tables storing related data, schemas, stored procs, and per­mis­sions. Most database servers are capable of managing many databases si­mul­ta­ne­ous­ly.

I needed to create a new PostgreSQL database at Amazon's RDS last week. I already had an RDS instance; I needed a new database on that instance. My Google searches turned up various recipes for creating a new RDS instance.

The following worked for me:

psql --host=SOME-DBMS-HOST --dbname 
continue.

psql: could not connect to server

I wanted to clean out my local PostgreSQL database today so that I could restore a database dump taken on another system, but every time I ran the psql utility, I got:

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I tried various things, including restarting Postgres several times, but nothing helped. Eventually, I thought to look in /usr/local/var/postgres/server.log, where I saw several error messages indicating that Postgres 9.5 couldn't read data files created with 9.4. At that point, I realized that during my most recent brew continue.