Im trying to run the below postgres sql queries using Python.
SELECT aws_commons.create_s3_uri('data-analytics-bucket02-dev','output','ap-southeast-1') AS s3_uri_1 \gset
"SELECT * FROM aws_s3.query_export_to_s3('SELECT * FROM sample_table', :'s3_uri_1');"
The below is my Python Code:
print('PostgreSQL database version:')
# cur.execute('SELECT version()')
select_query = "SELECT aws_commons.create_s3_uri('data-analytics-bucket02-dev','output','ap-southeast-1') AS s3_uri_1 \gset"
cur.execute(select_query)
cur.execute("SELECT * FROM aws_s3.query_export_to_s3('SELECT * FROM sample_table', :'s3_uri_1');")
Getting the below error
