theGreatKatzul
theGreatKatzul

Reputation: 447

How do I rename a database in influxdb?

  1. Looking through the influxdb website, documentation doesn't seem to cover some functionality that typical db commands would. Does anyone know how to move to a new name or outright rename a database inside of influxdb?
  2. Does anyone have a recommendation which R package to use with influxdb?
  3. Is there a way to load influx with -precision rfc3339 (human readable timestamping) automatically set within the configuration?

Upvotes: 1

Views: 8283

Answers (3)

OliK
OliK

Reputation: 265

Renaming is only possible by copying data into a new database:

SELECT * INTO "copy_NOAA_water_database"."autogen".:MEASUREMENT FROM "NOAA_water_database"."autogen"./.*/ GROUP BY *

Documentation: https://archive.docs.influxdata.com/influxdb/v1.2//query_language/data_exploration/#example-1-rename-a-database

The GROUP BY * clause is important as it preserves the tags.

Upvotes: 1

Vigneswaran
Vigneswaran

Reputation: 136

Currently renaming databases is not supported in influxDB. Discussion is going on in influxDB's github repo on the feature's need and complexity.

https://github.com/influxdata/influxdb/issues/4154

The feature was implemented and then reverted due to bugs

Upvotes: 7

Superluminal
Superluminal

Reputation: 977

I have not tried it for myself. But there are some answers in this link https://github.com/influxdata/influxdb.com/issues/384

ALTER DATABASE <db> RENAME TO <new_db>

Upvotes: -3

Related Questions