Ii Oo
Ii Oo

Reputation: 95

Importing a csv file from s3 into rds PostgreSQL Database > Error: schema "aws_commons does not exist

The following are the steps I have taken:

Followed the guide to create and connect PostgreSQL Database > https://aws.amazon.com/getting-started/tutorials/create-connect-postgresql-db/ > this was successful.

Followed

  1. Install the required PostgreSQL extensions. These include the aws_s3 and aws_commons extensions.
    CREATE EXTENSION aws_s3 CASCADE;
  2. Identify the database table and Amazon S3 file to use.
    CREATE TABLE t1 (col1 varchar(80), col2 varchar(80), col3 varchar(80));
  3. Use the aws_commons.create_s3_uri function to create an aws_commons._s3_uri_1 structure to hold the Amazon S3 file information.
    SELECT aws_commons.create_s3_uri( 'random', 'test.csv', 'us-east-1' ) AS s3_uri

Error: schema "aws_commons does not exist"

When I run the following code to identify extensions: Select * from pg_available_extensions where name like '%aws%'

name installed version comment
aws_commons 1.1 Common data types across AWS services
aws_s3 1.1 AWS S3 extension for importing data from s3

4.IAM

Upvotes: 1

Views: 3631

Answers (1)

Ii Oo
Ii Oo

Reputation: 95

Used the wrong guide, solved by Configuring SQL Workbench/J to use a Redshift driver.
See: https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-using-workbench.html
Then use the copy command.
see: https://docs.aws.amazon.com/redshift/latest/dg/r_COPY_command_examples.html

Upvotes: 1

Related Questions