Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqJ7f-0001Ww-D6 for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 17:33:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqJ7e-0005vQ-6Y for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 17:33:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqJ7d-0005uS-Tq for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 17:33:09 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqJ7b-0008My-8G for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 17:33:08 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id BBCF95C0085; Mon, 7 Jun 2021 13:33:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 07 Jun 2021 13:33:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=U oZG1V3OgnBsLJgCIgtXSElcfKtuRTSqe8+j05IgDhQ=; b=tY+XWD4Vl4ueHoStO uxv6Do0y4CauI8+iYh5KhKHzIs8uQ5SQ8fiU/McLvMkbJJyG1BohuSp+h0NUu6SF wjOeAgmHBdbl6jZntkGq8NOSMOOLuiWrbjkuiYxknHHOVg/mRyT+V6Wq2gdbpx/6 MOxgNjJAoYwzTsYSaY3U3ewnZ5LuOmt7omREERvYxHIryqNmMJX+Q75YrB7lyny5 uWolf+NU8DIjlq1uE9isl2AQeTx75UUch1FaVwx4jEmoTDbjN+WNnH+vljz7yHFT /6dPnUWml8NqkU5QTbr3IUHwoQQKeSM3Pm5twyX7sosmrPhzkn4P+F2I/YGnjh9w bHVsQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=UoZG1V3OgnBsLJgCIgtXSElcfKtuRTSqe8+j05IgD hQ=; b=RdjPb0MvNqkN69asCMeroKgGQjg89fafcdXJWBTrjCLrQJu6KxwwOhcGM s2uoQg/eU4qLWz+0rvlgmBmCe2lu9IsU0tkkuNHPv11el3m8CPhrCCcVl3AJs4Ir 5Q2cjS0OZrCAvwRUQMql2NAoABFlVI3RHHkzlMS4hV+X7FM3Br5HbMoOcfawiRpW yDou2eCl9woePkQE/zkr3WJNHYZdOPYNJsWlHK3cjsj3qugwDHyWB4+h/VkBnQjq UKkwZh3p4oibSz6wfJqYieu0Zk8F4oSnAX6tu2Hn97TF3TfArUxBpQ5rh5GM7m1p hkJWQATJise5VSNSwKofS958UybgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtjedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepteehkeekkeeikeduieevhffgudefffeggfegtdeh keehjeetfedvheevffetkeejnecuffhomhgrihhnpehqthdrihhopdhrihhvvghrsggrnh hktghomhhpuhhtihhnghdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Jun 2021 13:33:04 -0400 (EDT) Subject: Re: Database issues when adding GUI To: Rich Shepard , pgsql-general@lists.postgresql.org References: <48392c33-d63e-15be-e7de-d7a7c0c2fd80@gmail.com> <34B90F57-654D-4170-A7E9-613EB40A952C@americanefficient.com> From: Adrian Klaver Message-ID: <0ce89c8a-43fe-f0f5-afa7-c3587ffd332c@aklaver.com> Date: Mon, 7 Jun 2021 10:33:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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