pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Database issues when adding GUI
Date: Mon, 7 Jun 2021 10:33:03 -0700
Message-ID: <0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com> (raw)
In-Reply-To: <alpine.LNX.2.20.2106071021130.1822@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.2106070748380.1822@salmo.appl-ecosys.com>
	<48392c33-d63e-15be-e7de-d7a7c0c2fd80@gmail.com>
	<34B90F57-654D-4170-A7E9-613EB40A952C@americanefficient.com>
	<alpine.LNX.2.20.2106070831360.1822@salmo.appl-ecosys.com>
	<d6ebeb4b-d4f6-0d8d-1582-dba827ec9376@aklaver.com>
	<alpine.LNX.2.20.2106070857400.1822@salmo.appl-ecosys.com>
	<f4c2c51e-675e-3cf8-c06b-3091fe903e0b@aklaver.com>
	<alpine.LNX.2.20.2106071021130.1822@salmo.appl-ecosys.com>

On 6/7/21 10:21 AM, Rich Shepard wrote:
> On Mon, 7 Jun 2021, Adrian Klaver wrote:
> 
>> No this is because you did not use an actual connection string e.g:
>> psycopg2.connect("host=salmo user=rshepard dbname=bustrac")
>> Instead you used an undefined variable bustrac per the error message:
>> NameError: name 'bustrac' is not defined
> 
> Adrian,
> 
> First I'll upgrade 12.2 to 12.7, then I'll upgrade PyQt5.

The code snippet I showed is not tied to PyQt5, it is using psycopg2 and 
was just a way of seeing if you could connect to the database via Python 
and get results.

The issue seems to be with the QT driver for the Postgres. This is 
supplied by QT itself:

https://doc.qt.io/qt-5/sql-driver.html
https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtsql/qsqldatabase.html

Not sure if a PyQt5 upgrade will by itself do an upgrade of the drivers. 
That may require an update of QT5.

> 
> Thanks,
> 
> Rich
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (54+ messages)  latest in thread

Message-ID: <0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com>
Permalink:  ../0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com/
Also on:    postgresql.org/message-id/0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, rshepard@appl-ecosys.com
  Subject: Re: Database issues when adding GUI
  In-Reply-To: <0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com>
  References: <alpine.LNX.2.20.2106070748380.1822@salmo.appl-ecosys.com> <48392c33-d63e-15be-e7de-d7a7c0c2fd80@gmail.com> <34B90F57-654D-4170-A7E9-613EB40A952C@americanefficient.com> <alpine.LNX.2.20.2106070831360.1822@salmo.appl-ecosys.com> <d6ebeb4b-d4f6-0d8d-1582-dba827ec9376@aklaver.com> <alpine.LNX.2.20.2106070857400.1822@salmo.appl-ecosys.com> <f4c2c51e-675e-3cf8-c06b-3091fe903e0b@aklaver.com> <alpine.LNX.2.20.2106071021130.1822@salmo.appl-ecosys.com> <0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox