3

I would like to be able to separate multiple types of data in Questdb but it looks like I can't perform something like

CREATE DATABASE new_db;

But I get table expected error. Is is possible outside of SQL to add a new database?

Doncarleone512
  • 346
  • 1
  • 7

2 Answers2

2

As of writing, only one database qdb exists within QuestDB. Separating out types of data should be done using different tables

Brian Smith
  • 1,222
  • 7
  • 17
1

What you could do is to run multiple different instances of QuestDB, each containing a different database. You just have to run those instances on different ports. If you are using Docker for example you could map the QuestDB port 9000 of the container for the first DB to another host port, for example 9001.

docker run -p 9001:9000 --name=First_DB_Name questdb/questdb

If you now want to create a new DB you can run another container on another host port, like for example:

docker run -p 9002:9000 --name=new_db questdb/questdb

You can then reach the different databases via these host ports. If you are working on the host itself, then the first db is reachable via http://localhost:9001 and the new db via http://localhost:9002, etc...

It's not a beautiful solution, but it works.

WurzelseppQX
  • 520
  • 1
  • 6
  • 17
  • We migrated all of our timeseries Databases now to QuestDB and this is currently still the only way to have different Databases with QuestDB (at the time I am writing this). I contacted the developers via Slack and they confirmed this. – WurzelseppQX Jun 09 '23 at 07:37