Database Onboarding
- Software requirement: pgAdmin 4 > v7
Most CORI Computer are Mac: https://www.postgresql.org/ftp/pgadmin/pgadmin4/v7.8/macos/
- Your IP address should have been whitelisted, if not contact John or Olivier.
First: in pgAdmin
- Right clic on
Server
-> Register -> Server - New windows pop up:
Name
: cori-adIn the Connection tab
Host name/address
:cori-risi-ad-postgresql.c6zaibvi9wyg.us-east-1.rds.amazonaws.com
Username
: your username (your email)Password
: your passwordWhat do you have in
Parameters
’s tab? if not add SSL mode as prefer
- Open the “Query tool” and enter:
The “Query tool” look like a small silo:
To turn the “Query Tool” from “grey” to “black” select the postgres
DB.
Then enter:
ALTER USER "your_username" WITH PASSWORD 'my_secret_pwd';
Your username need to be double quoted.
When it displays “Query returned successfully” you should be able to save this password.
Then you can disconnect from the server and when you reconnect it will ask for your password and you can save it from here:
Second: in R
Refer to the coriverse wiki and cori.db readme for more details instructions on installing this package.
::install_github("ruralinnovation/cori.db")
remotespackageVersion("cori.db")
# [1] ‘0.2.0’
::set_db_credentials("your_username", "my_secret_pwd")
cori.db# Restart the R session
Creating a schema
mda_team
users do not have permission to create schema
.
When creating a new schema to allow everyone in a team to access it the ownership need to be changed.
ALTER SCHEMA "my_schema" OWNER TO mda_team;