# Quest Database connection

**URL:** <https://forum.inductiveautomation.com/t/quest-database-connection/78246>\
**Category:** Ignition\
**Tags:** ignition80, database, ignition81\
**Created:** [August 22, 2023, 5:35pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246 "2023-08-22T17:35:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [August 22, 2023, 5:35pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/1 "2023-08-22T17:35:09Z")

</div>

Trying to use Quest Database as Historian DB . i am able to build connection using JDBC drive .able to read from preconfigured Table .

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7aab038a3a8248a9a74c7c44aa7e81fba93beb21.jpeg)

But , Ignition failed to write to the DB showing below errors when Ignition trying to create Tables for Historian . any advise on that .. Do we need to create special translator for Quest DB ?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/c/ac952df6a2a55a2a7cae12677d3c331ff33d2b35.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 22, 2023, 6:09pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/2 "2023-08-22T18:09:52Z")

</div>

Not familiar with QuestDB in particular but - was Ignition able to create the initial tables or no? If not, I suspect you have to grant some roles to whatever user you have Ignition logging in as to be allowed to create tables/write to them.

Usually DB also have separate roles for data writer/reader. You may need to grant writer permissions to your user to write to the table as well.

---

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [August 22, 2023, 6:26pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/3 "2023-08-22T18:26:59Z")

</div>

Ignition unable to create table due to below error , it seems we have to create special translator

> java.lang.Exception: Error running query: CREATE TABLE sqlth\_drv ("id" SERIAL NOT NULL,"name" varchar(255),"provider" varchar(255),PRIMARY KEY ("id"))
> 
> at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.executeCommandSet(DBTableSchema.java:140)
> 
> at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.createTable(DBTableSchema.java:109)
> 
> at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.verifyAndUpdate(DBTableSchema.java:91)
> 
> at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.checkTables(TagHistoryDatasourceSink.java:1659)
> 
> at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.initialize(TagHistoryDatasourceSink.java:299)
> 
> at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:544)
> 
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
> 
> at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
> 
> at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
> 
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 
> at java.base/java.lang.Thread.run(Unknown Source)
> 
> Caused by: org.postgresql.util.PSQLException: ERROR: unsupported column type: SERIAL Position: 30
> 
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
> 
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
> 
> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
> 
> at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
> 
> at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
> 
> at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
> 
> at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
> 
> at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
> 
> at org.postgresql.jdbc.PgStatement.executeUpdate(PgStatement.java:265)
> 
> at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
> 
> at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
> 
> at com.inductiveautomation.ignition.gateway.datasource.DelegatingStatement.executeUpdate(DelegatingStatement.java:80)
> 
> at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRStatement.executeUpdate(SRConnectionWrapper.java:867)
> 
> at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.executeCommandSet(DBTableSchema.java:138)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 22, 2023, 6:32pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/4 "2023-08-22T18:32:48Z")

</div>

> [@tamerplc](#):
>
> Caused by: org.postgresql.util.PSQLException: ERROR: unsupported column type: SERIAL Position: 30

There's the problem. Don't know what the solution would be unfortunately. Your Quest Database doesn't like the `SERIAL` part of `CREATE TABLE sqlth_drv ("id" SERIAL NOT NULL`.

Are you using the built-in Postgres SQL Driver? Or did you find a Quest JDBC driver and install that? Postgres uses SERIAL as a keyword but seems like Quest does not, at least not out of the box. You should see if there is a JDBC driver for Quest Databases specifically and install / use that for your gateway instead of using the Postgres driver.

---

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [August 22, 2023, 6:48pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/5 "2023-08-22T18:48:05Z")

</div>

There's no official JDBC driver but using Postgress as it should work ..  
I can read and able to connect to QuestDB but for auto table vreation for Historian table e ignition used Postgress syntax which is wrong with Quest DB.  
But when using ignition Query Browser tools and write using CREAT Table

query it's working fine using Quest Syntax

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37bd6d933d28abf868cf7dfd8bed8027cd108805.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 22, 2023, 6:56pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/6 "2023-08-22T18:56:49Z")

</div>

I believe the issue is that when you have Ignition auto-create these tables, it defers to the driver for their particular DB's syntax and Postgres wants to use SERIAL for the primary keys which Quest does not seem to have. In fact a little research seems to imply QuestDB doesn't have PK or FKs - [Does QuestDB supports Foreign key, Primary key, references? - Stack Overflow](https://stackoverflow.com/questions/69375175/does-questdb-supports-foreign-key-primary-key-references)

Is QuestDB not a RDBMS? If not, I do not think you will have much luck with making it with Ignition and the auto-create tables for things like historian as I believe those are expecting a RBDMS database like MySQL, Postgres, SQL Server etc.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 22, 2023, 7:32pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/7 "2023-08-22T19:32:58Z")

</div>

> [@bkarabinchak.psi](#):
>
> imply QuestDB doesn't have PK or FKs

Ewww! That means performance is likely to suck, too.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 22, 2023, 7:36pm UTC](https://forum.inductiveautomation.com/t/quest-database-connection/78246/8 "2023-08-22T19:36:35Z")

</div>

Yea I never heard of it before now. I know in some situations NoSQL databases can have better performance that RDBMS but they also tend to be a bit looser with data constraints. I much prefer the fixed schemas of RDBMS over how NoSQL does things.
