Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL Driver not loaded #757

Open
jeroen79 opened this issue May 31, 2023 · 3 comments
Open

PostgreSQL Driver not loaded #757

jeroen79 opened this issue May 31, 2023 · 3 comments

Comments

@jeroen79
Copy link

Hi,

I was trying to use postgres instead of sqlite, but i get a popup Driver nog loaded, and also see the following error in die console dialog:

[19:15:16.684] (4fw) WARNING : QSqlDatabase: QPSQL driver not loaded [:0]
[19:15:16.686] (4fw) WARNING : QSqlDatabase: available drivers: QIBASE QSQLITE QMARIADB QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 [:0]

Is there any additional action needed to load the driver?
I do see that the driver dll (qsqlpsql.dll) exists in the sqldrivers folder.

Thx,
Jeroen

@matty0ung
Copy link
Contributor

Sorry to hear you're having problems.

It's not the most helpful error message is it? 🥲 I have vague a feeling that it might be something to do with there being two layers through which the DB is access and the top one (internal to the Qt framework) is loaded but the bottom one (the PosgreSQL native driver) is not. But, I could be completely wrong about that!

@mikfire is our resident PostgreSQL guru, so hopefully this might be one of the things he has already encountered.

If not, it would be good to get the whole debug log prior to this warning message. (Shout if you need help on how to do that.) It might have some clues, or there might be some more diagnostics we can add in the next build.

@jeroen79
Copy link
Author

jeroen79 commented Jun 1, 2023

Here is also the entire log:

log.txt

This install is on windows, but i did also try it on linux with the same result

@matty0ung
Copy link
Contributor

Thanks. Two things to try:

  1. You need to make sure a copy of libpq.dll is placed in the same folder as the Brewtarget executable (see https://doc.qt.io/qt-6/sql-driver.html#qpsql-for-postgresql-version-7-3-and-above). You should be able to find libpq.dll somewhere in your PostgreSQL install as it's what provides the public API into PostgreSQL (see https://www.postgresql.org/docs/current/libpq.html). I believe the qsqlpsql.dll library you already found then translates between PostgreSQL public API and Qt internal API.
  2. If that doesn't work, try switching the Brewtarget log mode to debug. That should produce a much more verbose log. The "official" way to do this is to switch back to SQLite, start Brewtarget and in "Tools > Options > Logging" set the logging level to "Detailed (for debugging)". Alternatively, if you want to take a shortcut, edit your C:/Users/*/AppData/Local/brewtarget/brewtargetPersistentSettings.conf file and add LoggingLevel=DEBUG on a line by itself in the [General] section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants