Creating a cluster, connecting, and creating a database
Follow this quick walkthrough to configure a Postgres cluster on BigAnimal.
Step 1: Create an account and sign into the portal
If you haven't done so already, you'll need to create your EDB account.
Then, use your newly created account to access the BigAnimal portal.
Step 2: Create a cluster
On the overview page, select Create New Cluster.
You should now find yourself at the Create Cluster page.
Select the options for your cluster. See Creating a cluster for more information.
Managing your cluster
After you select Create Cluster, you return to the Clusters page with your newly configured cluster now populating the list. From the Clusters page, you can view the details, create a replica of your cluster, and edit and delete your cluster.
Step 3: Connect to your new cluster
Select your cluster to get an overview of how it has been configured. Select the Connect tab to see more information about how to connect to your cluster.
Select the Overview tab and copy the Quick Connect command. Paste it into a terminal where psql is installed. It will prompt for your password and put you on a SQL command line. For example:
Note
While psql is a good all-around option for working with Postgres databases, you can use the client of your choice. See Connect to a cluster for more ideas.
Things to try
Create a new database
We're going to create some sample math data, so we're going to create a database called math
. We could use the default edb_admin
database, but best practice is to isolate data.
Create a new
math
database.Grant the
math
role to edb_admin.Connect to the
math
database. You're prompted for the edb_admin password you provided in Step 2.
Populate a table and query it
We're going to use temporary tables to calculate prime numbers using a Sieve of Eratosthenes.
Create a table called
primes
for storing prime numbers.Populate the table with all prime numbers up to 1000. (This code is based on code from David Fetter.)
Select the largest prime number less than 1000.
Further reading
Now that you've got the basics, see what else BigAnimal offers: