Filippo Loddo
Filippo Loddo

Reputation: 1096

Is it possible to change a database (schema) name in AWS Athena?

I created a database and some tables with Data on AWS Athena and would like to rename the database without deleting and re-creating the tables and database. Is there a way to do this? I tried the standard SQL alter database but it doesn't seem to work.

thanks!

Upvotes: 2

Views: 5244

Answers (2)

singh30
singh30

Reputation: 1503

Athena doesn't support renaming database. You need to recreate database with a new name.

You can use Presto which is an open source version of Athena and Presto supports more DDL queries.

Upvotes: 0

Mikolaj
Mikolaj

Reputation: 1495

I'm afraid there is no way to do this according to this official forum thread. You would need to remove the database and re-create it. However, since Athena does not store any data by itself, deleting a table or a database won't impact your data stored on S3. Therefore, if you kept all the scripts that create external tables, re-creating a database should be fairly quick thing to do.

Upvotes: 2

Related Questions