Guardians of the Postgres, The Search for Postgres, The Never Ending Postgres Part 2

Day 2

Captains Log: I accidentally came across the answer to my questions yesterday will investigating the daily catastrophe: Error: role "postgres" does not exist That sounds serious. I must have pissed off a local deity or something. .. While debugging the that error I came across this:

$ psql -l # lists out all of the databases

It actually list all of the databases on my server. HA! And I was not even trying to do find that. Let’s make sure we can accomplish the create and delete tasks from above. Apparently I have a few databases…

Wait a tic! What the? It appears that jordanpapaleo was a default database. I wonder if there is some connection to my user name for my computer… I did a little digging and it seems like the initial database connection becomes the default.

ProTip: You can use your ~/.bashrc or ~/.bash_profile to set a default data base. Just add the following line to your config file.
export PGDATABASE=whatevs

For consistency we will just open psql with the name of a database. Safer that way.

$ psql jordan

Dang, it’s getting dark. Ok let’s camp here tonight and we will figure out the other error tomorrow.