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 1lqGrC-0003n0-NI for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 15:08:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqGrB-00051Y-NU for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 15:08:01 +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 1lqGrB-00051N-Cn for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 15:08:01 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lqGr9-00079A-5J for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 15:08:00 +0000 Received: by mail-ot1-x335.google.com with SMTP id i12-20020a05683033ecb02903346fa0f74dso16992274otu.10 for ; Mon, 07 Jun 2021 08:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=pBiEVSAfOwKEse6GwifyPWfKrgAcdw0QPabfs3O+hgA=; b=FrXN54YSzjh01FG2ryGeCxDeOGE3qjEEiOP2mnebFGE/PsnCSSY6+duls6nZxa8Yw3 ivEUsRCgjd3oAi1b6W0jeVooKzBIBB6x5eXOSJVSp4mkAdcrJZylWWd4sVC0roK7no2x K5j0HAtQR3A/M4mrS1mU9dC5stlNkh9SujrgIi/yk2Puu5LCjPhh0GudEVwlgZJQu9ku MwELDhQG90tCn/hDE1P8Bq5mPePghw12j2zgBNkPPd2TG/Bj5DN5L31pZFY+g89vbzM8 BK8cLWr6tILNOSz03/oXjJAdKxKV6Ov8SnVIrWDxTgFbjWdQi9b+xf7L+b7sHqWl+Otv SM5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=pBiEVSAfOwKEse6GwifyPWfKrgAcdw0QPabfs3O+hgA=; b=JmNBJ2TbQlRanSeJbEUH7Xlv+/Efu1SmZmtgvvh0XHpWyg47TxeuZrSkMCsffKdZBX wCBNBx/2TocaXAEt4jLZJP3ORADnAAP+eXiSxWo6LcOPpw0W1uGmzNb3eo8plFoIdbbP OPVbUY37OfbPRK2fLwy07SARVaOCBNluiodNrj/EjU4uEEVXF4nTfYdfQXMGctmCiRsZ Tj9VGp4urjvOg+U1I4VrS9Ic5Ac1GqkNNjUCVQ0ngnPRCjULigNI8KCDg48VNYTRn9Ak udCjUnyFYGpbgrgbAMJkL8epkDZQ4jzelHQastOsw+TwEOTmL8ZLcZn+KzuK4vLN8XhI bDSA== X-Gm-Message-State: AOAM5337AKDiaeY47WnQAMD6dtTuUlBu7cL40mgsLURPwVV6jYNXyAMK yxEI4tmk66WJgahB85vYwToL/5aiXBqfBQ== X-Google-Smtp-Source: ABdhPJwkrOWtVtqZMzbs8zGpnQElOL5f7oBhBjMJWX41jc2Y0nmXT72LB9C/nV8uSMnvq7ulotWojA== X-Received: by 2002:a9d:4809:: with SMTP id c9mr7548859otf.154.1623078478445; Mon, 07 Jun 2021 08:07:58 -0700 (PDT) Received: from ?IPv6:2601:681:5500:dde0:f461:4d8d:3989:eea5? ([2601:681:5500:dde0:f461:4d8d:3989:eea5]) by smtp.gmail.com with ESMTPSA id n11sm2205270ooo.12.2021.06.07.08.07.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Jun 2021 08:07:58 -0700 (PDT) Subject: Re: Database issues when adding GUI To: pgsql-general@lists.postgresql.org References: From: Rob Sargent Message-ID: <48392c33-d63e-15be-e7de-d7a7c0c2fd80@gmail.com> Date: Mon, 7 Jun 2021 09:07:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-CA List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/7/21 9:02 AM, Rich Shepard wrote: > This is an unusual message and I hope someone(s) here can offer insights > into the cause of the problem I've been wrestling with for the past > couple > of weeks. > > Context: For the past decade I've run my business tracking database > from the > psql shell (currently with postgresql-12.2) and decided it's time to > add a > frontend so it's a stand-alone desktop application. I'm learning to use > PyQt5 as the widget set and application framework. > > The database contains three lookup tables: activitytypes, > industrytypes, and > statustypes, all have a single column and few rows. So I've started with > these to get python3 and PyQt5-5.13.2 to run the SELECT query and display > the results in a QTableView. > > The problem with all three is that my code produces an empty window and > hangs. There's no python error displayed and the application reports > finding > the database but not the tables. For example, the activitytypes debugging > log contains: > INFO:root:found database > DEBUG:root:Defining model/view > DEBUG:root:model error:  Unable to find table activitytypes > DEBUG:root:about to execute select query > DEBUG:root:End of Program > > I, and others on the python and pyqt mail lists and stackoverflow, can > find > nothing wrong with the python code. This suggests it's something with the > database itself. But I have no idea where to look. The database structure > is: > bustrac=# \d >                     List of relations >  Schema |           Name            |   Type   |  Owner > --------+---------------------------+----------+---------- >  public | activities                | table    | rshepard >  public | activitytypes             | table    | rshepard >  public | industrytypes             | table    | rshepard >  public | locations                 | table    | rshepard >  public | organizations             | table    | rshepard >  public | organizations_org_nbr_seq | sequence | rshepard >  public | people                    | table    | rshepard >  public | people_person_nbr_seq     | sequence | rshepard >  public | projects                  | table    | rshepard >  public | statustypes               | table    | rshepard > (10 rows) > > What might stop a front-end application from finding a table that has > been > readily accessed from the psql shell? > > All suggestions and recommendations are needed. > > TIA, > > Rich > > \ This looks like a permissions problem, as though you are connecting as a role/user without permission to select from the tables. Are these tables in a schema other than public. can you show a psql session which accesses these tables, including connection string? > >