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 1lqIuo-0000zZ-2h for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 17:19:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqIun-0002ht-3K for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 17:19:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqIul-0002db-Ln for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 17:19:52 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqIug-0002Go-Ij for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 17:19:51 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id CB2B15C01CC; Mon, 7 Jun 2021 13:19:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Jun 2021 13:19:43 -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=6 0dwi/g7IPOPN/Yp0RO6ErTPcR6PzVhpTjobRp2emog=; b=EUbrtpxyrMlRSxj26 qeamJ+PZLWVuGEjJkgw6I1iS3wb49TnAw28ot/8JLmx1zGdDiwJSlg8fOGYCKSIp j/syE5iMG5So9Qw03+UMP8RG4dQdlngR8+1h63HxXD5jHZKcFgoASas0r/EFEDvc ULrtqeBg5YVqGiIixw2ZQC6oSK42+/kED9xJSaE3dHOpvIczTtFIhTbVd8+Ws5EO KswesWu7oSHd4fqNYq3sAspBKhWYvjA993NAmJDA6t1MWibWKQQ3XPQFUYF+W7V6 clZq8RUnmOiiavmeYkZzquEBeLiKZXNVvrPGMvxxbSw30c5bFKZydJOQd2ekb22f cfwRQ== 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=60dwi/g7IPOPN/Yp0RO6ErTPcR6PzVhpTjobRp2em og=; b=nXs9sGM5k5JBetgyv4JnafPQyGoR9r6LKBJj8Py78wugKySCiDiiRRFkL 27GKTNNUhkFPY9cWXk8DweBPrB8unyLNwAGyXFx3RTecFne6U9F5GI/vZbyHHTeW bVHhUPUL1xIrvObIw6PSPSgaAhNK1JUN00N/oEXDa4ZoJKMv+xAsgafOwwdIi2F/ jIw6BGdDOO1Ft2REU9zRE9YAmywpKD0qox4XdwIRx9YMV9YIq8NhENlhc5MRys8A 9nkRVuNSwgFOQHEQ1+PBZEO5LLrrr31Wle3tVUdDQZr9egD5Hk8xiqOv0rMFIix2 m2dAEDFy9ShvOqDGnYXnlllJF1h6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtjedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepveevfeevfeeugeffkeekhfegieeufffgteeujedv gffhueejjefhkeejleegtdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Jun 2021 13:19:42 -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: Date: Mon, 7 Jun 2021 10:19:42 -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: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/7/21 9:00 AM, Rich Shepard wrote: > On Mon, 7 Jun 2021, Adrian Klaver wrote: > >> What Philip is suggesting is to use Python only simple script to >> connect to database and retrieve from table. Something like: >> >> import psycopg2 >> >> con = psycopg2.connect() >> cur = con.cursor() >> cur.execute('select * from activitytypes') >> rs = cur.fetchall() >> print(rs) > > Adrian, > >>>> con = psycopg2.connect(bustrac) > Traceback (most recent call last): >   File "", line 1, in > NameError: name 'bustrac' is not defined 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 > > That's because there's a problem with connecting to the database. See my > reply to Rob's message. > > Thanks, > > Rich > > > -- Adrian Klaver adrian.klaver@aklaver.com