eryk918 / postgis_toolbox

Plugin for QGIS implementing selected PostGIS functions
GNU General Public License v3.0
3 stars 0 forks source link

can't connect #2

Closed GO1984 closed 1 year ago

GO1984 commented 1 year ago

Unfortunatelly i can't connect: PostgreSQL version 13.12 with PostGIS 3.4.0 Screenshot_1

eryk918 commented 1 year ago

Hi, you need to specify the port to connect to the database (default is 5432). In the next version of the tool, I will protect the connection creation dialog and add messages to warn against such errors.

GO1984 commented 1 year ago

Thank you for the fast reply. I use a service configured in a _.pgservice.conf service file on Win 11 so i cant add an additional service port. do you think the next version will cover this issue too?

GO1984 commented 1 year ago

I can see already the databases in the drop-down list but cant connect when clicking on the connect button

eryk918 commented 1 year ago

You probably need to fill in the following fields with correct authentication data. image

NyakudyaA commented 1 year ago

Hi @eryk918 Please fix the issue as it is a blocker to using the tool, otherwise I will have to flag it as unapproved in the plugin list

GO1984 commented 1 year ago

You probably need to fill in the following fields with correct authentication data. image

This doesn't fix it.

NyakudyaA commented 1 year ago

Peek 2023-09-19 16-23

This doesn't work

eryk918 commented 1 year ago

Peek 2023-09-19 16-23

This doesn't work

Thanks for the test scenario, I will analyze the situation in a moment and make a fix.

eryk918 commented 1 year ago

I made a correction to the PostgreSQL connection management dialog - so that it does not throw python errors, I also added error logging for establishing a connection - they will be displayed in the Log messages panel. Thanks to this, we will find out what errors the database client returns to us and we will be able to solve them. Several people tested this plugin and none received this specific error. I've uploaded this patch to the QGIS Repository and am waiting for approve. When it is available, download the update and send us the logs, we will solve this problem. 😄 Link to manual update file: https://github.com/eryk918/postgis_toolbox/releases/download/v1.1/postgis_toolbox.zip

I added a new connection to the database as a test and everything seems OK (PostgreSQL 15.4, PostGIS 3.4, Windows 10 Pro, QGIS 3.32.3). image

GO1984 commented 1 year ago

Thank you for your fast action.

With version 1.10 i now can connect to the databases, by credentials in details. What still do not work, is the connection to the already in QGIS connected databases (wich connected by Postgresql services (here by .pg_service.conf). Information about the connection file you can find here: [https://www.postgresql.org/docs/current/libpq-pgservice.html] There is still an error message:

Screenshot_1

Maybe you want to fix this too?

NyakudyaA commented 1 year ago

The issue is that in the code https://github.com/eryk918/postgis_toolbox/blob/main/utils.py#L469-L486 there is no logic to handle service files logic.

eryk918 commented 1 year ago

Thank you for your fast action.

With version 1.10 i now can connect to the databases, by credentials in details. What still do not work, is the connection to the already in QGIS connected databases (wich connected by Postgresql services (here by .pg_service.conf). Information about the connection file you can find here: [https://www.postgresql.org/docs/current/libpq-pgservice.html] There is still an error message:

Screenshot_1

Maybe you want to fix this too?

To prevent this python error from being thrown, you need to edit and save old connections via Database Manager in PostGIS Toolbox. After yesterday's fixes, this action should automatically fix old - bad connections. .pg_service.conf files will not be supported for now, it will be necessary to manually fill in the dialogue with authentication credentials.

NyakudyaA commented 1 year ago

On Ubuntu, this is caused by missing driver QPSQL. I saw the following error Qt: QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QSPATIALITE QTDS QTDS7 And I resolved it by running sudo apt install libqt5sql5-psql