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 1lqGt6-0003ts-I6 for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 15:10:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqGt5-00017v-I9 for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 15:09:59 +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 1lqGt5-00017X-9K for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 15:09:59 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lqGt3-00019h-8e for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 15:09:58 +0000 Received: by mail-ot1-x332.google.com with SMTP id 6-20020a9d07860000b02903e83bf8f8fcso4001145oto.12 for ; Mon, 07 Jun 2021 08:09:57 -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=pJen7BHjMRCjQGfsIRVw41GzRLwTAvfRhDKceYSU/MM=; b=jDd6UKRLIqc4FDfWuQfoEeS6GOfDu/s0kecRNID7n36J6JpNLq7GPppA5ZrB2jqzMy XC4cc+XoV+GsLQWA+gaBU3e6eleH1dZnxw/Jqi9SSnJ7D8nZQgM6YXefck25pjqDKVIu V/4Amsu513vwxhQdUCjFuTwW6g5f+l+qDQJnMyxghFNByeE4WW8nEGnXpbBUqwPDLpI+ mATOd/PTpgk8QzkSFEoKroYm4p9DnrFMA10VoyYGBaJninZ086MeMsCpRDl/qooTaV2r QWsGfSyPnxHWAJtnDUMb53fqJ94u6j94lemL2tzxVaiCW7FYm5nsbB0g5y8YOdBN6scW nUFg== 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=pJen7BHjMRCjQGfsIRVw41GzRLwTAvfRhDKceYSU/MM=; b=NBa/Ozg46MVybNbnS6HKOrVq8p2pdN43X7x+el3VaHPj1uQM35N0JHq/OpXbr+Ott6 Ui/70vpinOPBV07otxtdmBL+LfbqiI5OhlwM2xsCSD4y189Z+w3ZCr0ZUo65zEliIgrv YdVbkxsPEDBNFIKtIn3Y7rTRJEDTVsgW9KXDoKdNKZPj1cdkgGcx2zQxIbHR9vfwrjjZ PW3INRHNi8T08WezwQ1wtKLfnkqYSw/yvvgNgLTkbgRWXuO4tSSUm6dYyGrIMxHcamqF FGZbHgvhmVn6R3Y5T1i4re72muIUBlYcMoIgVJb4ueKHVE+6ISro0n2VvP+TklMqiUDG SfyQ== X-Gm-Message-State: AOAM532/1DG9Et75S7hIkKDgHwXI47xP2Uqz6m+i7oLILE5a2X4BIIkF upU8wAe20Lv/qNGOtrPIqCGut3+bfIg4eg== X-Google-Smtp-Source: ABdhPJy5XwIeVsOutbpDXK2363yC+1jvnxDJLOVc3z4vsVQIGGHZMLgag1hhYxdW1pcSD3wuzeuLxw== X-Received: by 2002:a05:6830:1191:: with SMTP id u17mr6805272otq.43.1623078595053; Mon, 07 Jun 2021 08:09:55 -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 f7sm2222374oot.36.2021.06.07.08.09.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Jun 2021 08:09:54 -0700 (PDT) Subject: Re: Database issues when adding GUI To: pgsql-general@lists.postgresql.org References: From: Rob Sargent Message-ID: <3c1ed25a-8924-d27b-bb97-d79984390290@gmail.com> Date: Mon, 7 Jun 2021 09:09:54 -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 > > > Sorry, I see they are in public.  Still need you conection setttings, for both psql and app.  And any ~/.pg* files.