I am taking a course in DataCamp on databases and there is a part where I access the census database in AWS using SQLalchemy.
The code is:
engine = \
create_engine('postgresql+psycopg2://student:datacamp@postgresql.csrrinzqubik.us-east-1.rds.amazonaws.com:5432/census')
When I run this code and then try to access the data from my Jupyter Notebook I get a message that tells me that access is denied.
metadata = MetaData()
census = Table('census', metadata, autoload = True, autoload_with = engine)
connection = engine.connect()
stmt = select([census])
stmt = stmt.where(census.columns.state == 'New York')
results = connection.execute(stmt).fetchall()
ProgrammingError: (psycopg2.ProgrammingError) permission denied for relation census
[SQL: 'SELECT census.state, census.sex, census.age, census.pop2000, census.pop2008 \nFROM census \nWHERE census.state = %(state_1)s'] [parameters: {'state_1': 'New York'}]
I have an account in AWS. What should I do to access the census database from my Jupyter Notebook?