Re: Aw: Re: Database issues when adding GUI

2021-06-08 Thread Rich Shepard
On Tue, 8 Jun 2021, Karsten Hilbert wrote: The problem source is postgres telling me it cannot connect to the database via TCP/IP but I can do so directly using psql: via UNIX domain sockets. Karsten, That's because psql is direct while PyQt5-5.12.3 cannot access postgres-12.x tables. I'm wor

Re: Database issues when adding GUI

2021-06-08 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: 2021-06-07 10:36:38.330 PDT [29537] LOG: database system is ready to accept connections 2021-06-07 14:19:45.491 PDT [31353] ERROR: column pg_attrdef.adsrc does not exist at character 128 " Adrian, Postgres dropped the pg_attrdev.adsrc column from t

Aw: Re: Database issues when adding GUI

2021-06-07 Thread Karsten Hilbert
> The problem source is postgres telling me it cannot connect to the database via TCP/IP > but I can do so directly using psql: via UNIX domain sockets. That makes a difference. See pg_hba.conf. Karsten

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 6:47 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, Rich Shepard wrote: The only use of 127.0.1.1 is for slrn, a newsreader I've not used in years. The thing is this post: https://www.postgresql.org/message-id/alpine.LNX.2.20.2106071424401.1822%40salmo.appl-ecosys.com and this: "2021

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Rich Shepard wrote: The only use of 127.0.1.1 is for slrn, a newsreader I've not used in years. Ah, I was looking in the wrong directory. /usr/share/postgresql-12/ should have only the templates. The conf file postgres uses is in /var/lib/pgsql/12/data/ and has this content

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Sam Gendler wrote: It still looks a lot like the salmo hostname is going to be a problem once you have the client version sorted out. Postgresql is listening only on 127.0.0.1:5432 and pg_hba.conf only has entries for 127.0.0.1:5432, not 127.0.1.1 You can tell it to listen on

Re: Database issues when adding GUI

2021-06-07 Thread Sam Gendler
On Mon, Jun 7, 2021 at 9:24 AM Alan Hodgson wrote: > On Mon, 2021-06-07 at 09:22 -0700, Rich Shepard wrote: > > > salmo, 127.0.0.1 is the server/workstation that has everything installed. > It > is localhost. > 127.0.0.1 localhost.localdomain localhost > 127.0.1.1 salmo.appl-ecosys.

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, David G. Johnston wrote: The version 12 compatibility commit was done in 5.15 only (5.12 works up to v11). David, Thanks for that information. I'll see if I can upgrade to 5.15. Regards, Rich

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: I'm guessing qt5-5.12.8 is not recent enough to deal with the changes in Postgres 11+. Adrian, I agree. I've overlooked that PyQt is a wrapper around Qt and that's where the drivers are installed. Does your version of Slackware allow you to upgrade t

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 4:19 PM, David G. Johnston wrote: On Monday, June 7, 2021, Adrian Klaver > wrote: I'm guessing qt5-5.12.8 is not recent enough to deal with the changes in Postgres 11+. You might want to ask this on the Qt list(s). I have tried to determine

Re: Database issues when adding GUI

2021-06-07 Thread David G. Johnston
On Monday, June 7, 2021, Adrian Klaver wrote: > I'm guessing qt5-5.12.8 is not recent enough to deal with the changes in > Postgres 11+. You might want to ask this on the Qt list(s). I have tried to > determine this, but the Qt repo structure is lets say interesting and I > can't find any relevan

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 3:58 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, Adrian Klaver wrote: That will show what is currently installed, not what has been installed over time. The bottom line is that this is Qt issue and to solve it is going to require working from the Qt side and that is only going to wor

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: That will show what is currently installed, not what has been installed over time. The bottom line is that this is Qt issue and to solve it is going to require working from the Qt side and that is only going to work by knowing what version of Qt(not PyQt

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 3:45 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, Adrian Klaver wrote: Alright. What is the version of Qt installed on the machine. Do in terminal: $ ls /var/log/packages/ | grep qt qt5-5.12.8-x86_64-1_SBo among others. That is why asked you to do in a terminal: qtdiag That will

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: Alright. What is the version of Qt installed on the machine. Do in terminal: $ ls /var/log/packages/ | grep qt qt5-5.12.8-x86_64-1_SBo among others. Rich

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 3:12 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, Adrian Klaver wrote: How did you upgrade? Exact command please. Adrian, Because slackware64-14.2 had python3-PyQt-5.13.2 and the latest version in -current64 is PyQt5-5.15.2-x86_64-3, I removed the former and installed the latter. T

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: How did you upgrade? Exact command please. Adrian, Because slackware64-14.2 had python3-PyQt-5.13.2 and the latest version in -current64 is PyQt5-5.15.2-x86_64-3, I removed the former and installed the latter. The commands are 'removepkg ' and 'instal

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 3:04 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, David G. Johnston wrote: If all you did was upgrade the server, and not the client that is issuing the query, then, yes, you will get the same error, since the server isn't the problem. David, I also upgraded the client from PyQt5-5.

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, David G. Johnston wrote: If all you did was upgrade the server, and not the client that is issuing the query, then, yes, you will get the same error, since the server isn't the problem. David, I also upgraded the client from PyQt5-5.13.2 to PyQt5-5.15.2. I'm hoping for an

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: See: https://www.postgresql.org/docs/11/catalog-pg-attrdef.html https://www.postgresql.org/docs/12/catalog-pg-attrdef.html So in version 12. Adrian, Then it doesn't matter which minor version's installed. I've asked on the PyQt mail list about this b

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 2:26 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, Tom Lane wrote: We removed the pg_attrdef.adsrc catalog column a couple versions back. You're evidently using quite an old version of whichever client-side library is issuing this command. You need to get a more up-to-date copy that kno

Re: Database issues when adding GUI

2021-06-07 Thread David G. Johnston
On Mon, Jun 7, 2021 at 10:20 AM Rich Shepard wrote: > On Mon, 7 Jun 2021, David G. Johnston wrote: > > > Those are PostgreSQL versions...but it's your non-psql client software > > that needs upgrading, not PostgreSQL. > > David, > > Ah! Now I understand. > Apparently you do not...? David J.

Re: Database issues when adding GUI

2021-06-07 Thread David G. Johnston
On Mon, Jun 7, 2021 at 2:26 PM Rich Shepard wrote: > On Mon, 7 Jun 2021, Tom Lane wrote: > > > We removed the pg_attrdef.adsrc catalog column a couple versions back. > > You're evidently using quite an old version of whichever client-side > > library is issuing this command. You need to get a mor

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 2:26 PM, Rich Shepard wrote: On Mon, 7 Jun 2021, Tom Lane wrote: We removed the pg_attrdef.adsrc catalog column a couple versions back. You're evidently using quite an old version of whichever client-side library is issuing this command. You need to get a more up-to-date copy that kno

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Tom Lane wrote: We removed the pg_attrdef.adsrc catalog column a couple versions back. You're evidently using quite an old version of whichever client-side library is issuing this command. You need to get a more up-to-date copy that knows what to do instead. Tom, In what v

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Adrian Klaver wrote: 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. Adrian, Yes, it's a PyQt5 version issue. Thanks, Rich

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
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

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
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

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, David G. Johnston wrote: Those are PostgreSQL versions...but it's your non-psql client software that needs upgrading, not PostgreSQL. David, Ah! Now I understand. Given that the messages above indicate you are presently running 12.2 you should be upgrading to the current

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
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

Re: Database issues when adding GUI

2021-06-07 Thread David G. Johnston
On Mon, Jun 7, 2021 at 9:36 AM Rich Shepard wrote: > On Mon, 7 Jun 2021, Tom Lane wrote: > > > We removed the pg_attrdef.adsrc catalog column a couple versions back. > > You're evidently using quite an old version of whichever client-side > > library is issuing this command. You need to get a mor

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Tom Lane wrote: We removed the pg_attrdef.adsrc catalog column a couple versions back. You're evidently using quite an old version of whichever client-side library is issuing this command. You need to get a more up-to-date copy that knows what to do instead. Tom, I appear

Re: Database issues when adding GUI

2021-06-07 Thread Alan Hodgson
On Mon, 2021-06-07 at 09:22 -0700, Rich Shepard wrote: > On Mon, 7 Jun 2021, Edson Carlos Ericksson Richter wrote: > > > Are you sure it should be 127.0.1.1, not 127.0.0.1? AFAIK, localhost > > should be 127.0.0.1 > > May be an issue in /etc/hosts for "salmo" host? > > Edson, > > salmo, 127.0.0.

Re: Database issues when adding GUI

2021-06-07 Thread Tom Lane
Rich Shepard writes: > 2021-06-07 08:47:21.108 PDT [6734] ERROR: column pg_attrdef.adsrc does not > exist at character 128 > 2021-06-07 08:47:21.108 PDT [6734] STATEMENT: select pg_attribute.attname, > pg_attribute.atttypid::int, pg_attribute.attnotnull, pg_attribute.attlen, > pg_attribute.attt

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Edson Carlos Ericksson Richter wrote: Are you sure it should be 127.0.1.1, not 127.0.0.1? AFAIK, localhost should be 127.0.0.1 May be an issue in /etc/hosts for "salmo" host? Edson, salmo, 127.0.0.1 is the server/workstation that has everything installed. It is localhost.

Re: Database issues when adding GUI

2021-06-07 Thread Edson Carlos Ericksson Richter
Em 07/06/2021 13:08, Alan Hodgson escreveu: On Mon, 2021-06-07 at 09:03 -0700, Rich Shepard wrote: The problem source is postgres telling me it cannot connect to the database but I can do so directly using psql: $ psql --host salmo --user rshepard --dbname bustrac psql: error: could not conn

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Alan Hodgson wrote: If you don't specify a host name, psql/libpq connects using the UNIX domain socket in /tmp. If you do specify a host name it connects using a TCP socket. Your PostgreSQL doesn't seem to be listening on TCP, or possibly you have a firewall issue. Alan, T

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Tom Lane wrote: I think you could clarify things quite a bit by enabling log_connections and log_statement, and then watching the postmaster log while you run the app. Tom, In /var/log/postgresql-12 the shut-down and restart so an error I don't understand: 2021-06-07 08:4

Re: Database issues when adding GUI

2021-06-07 Thread Tom Lane
Rich Shepard writes: > On Mon, 7 Jun 2021, Tom Lane wrote: >> What you've got there is that Unix-socket connections work, but TCP >> connections do not. Check the server's listen_addresses setting. If that >> says to allow connections on these IP addresses, next check your kernel >> firewall. > W

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Tom Lane wrote: What you've got there is that Unix-socket connections work, but TCP connections do not. Check the server's listen_addresses setting. If that says to allow connections on these IP addresses, next check your kernel firewall. Tom, What I read on

Re: Database issues when adding GUI

2021-06-07 Thread Tom Lane
Rich Shepard writes: > On Mon, 7 Jun 2021, Tom Lane wrote: >> Are you sure the app is connecting to the right database? > The problem source is postgres telling me it cannot connect to the database > but I can do so directly using psql: If the app is indeed failing to connect at all, those are s

Re: Database issues when adding GUI

2021-06-07 Thread Alan Hodgson
On Mon, 2021-06-07 at 09:03 -0700, Rich Shepard wrote: > The problem source is postgres telling me it cannot connect to the database > but I can do so directly using psql: > > $ psql --host salmo --user rshepard --dbname bustrac > psql: error: could not connect to server: could not connect to serv

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Tom Lane wrote: Are you sure the app is connecting to the right database? Tom, The problem source is postgres telling me it cannot connect to the database but I can do so directly using psql: $ psql --host salmo --user rshepard --dbname bustrac psql: error: could not con

Re: Database issues when adding GUI

2021-06-07 Thread Tom Lane
Rich Shepard writes: > $ psql --host salmo --user rshepard --dbname bustrac > psql: error: could not connect to server: could not connect to server: > Connection refused > Is the server running on host "salmo" (127.0.1.1) and accepting > TCP/IP connections on port 5432? > could not co

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
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() pri

Re: Database issues when adding GUI

2021-06-07 Thread Tom Lane
Rich Shepard writes: > Must be something else, Are you sure the app is connecting to the right database? regards, tom lane

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Rob Sargent wrote: psql --host machine --user role --dbname something For your app it might be a config file with corresponding entries, or perhaps you command line invocation? I suspect there's a mis-match between the two. Rob, $ psql --host salmo --user rshepard --dbna

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Rob Sargent wrote: Sorry, I see they are in public.  Still need you conection setttings, for both psql and app.  And any ~/.pg* files. Rob, et al.: Somehow pg_hba.conf got lost. Only the sample is present in /usr/share/postgresql-12. I edited pg_hba.conf set DATABASE and

Re: Database issues when adding GUI

2021-06-07 Thread Adrian Klaver
On 6/7/21 8:32 AM, Rich Shepard wrote: On Mon, 7 Jun 2021, Philip Semanchuk wrote: I agree with Rich. Permissions, or you’re connecting as the wrong user. You might find it helpful to simplify and not use a GUI application until you get your connection issues sorted out. A simple command line P

Re: Database issues when adding GUI

2021-06-07 Thread Rob Sargent
can you show a psql session which accesses these tables, including connection string? Not sure about the 'connection string' part but: bustrac=# select * from activitytypes; psql --host machine --user role --dbname something For your app it might be a config file with corresponding entries,

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Philip Semanchuk wrote: I agree with Rich. Permissions, or you’re connecting as the wrong user. You might find it helpful to simplify and not use a GUI application until you get your connection issues sorted out. A simple command line Python app that connects to the database

Re: Database issues when adding GUI

2021-06-07 Thread Rich Shepard
On Mon, 7 Jun 2021, Rob Sargent wrote: This looks like a permissions problem, as though you are connecting as a role/user without permission to select from the tables. Rob, I'm a trusted user for all my databases as I'm the only one using them. bustrac=# \d List of relati

Re: Database issues when adding GUI

2021-06-07 Thread Philip Semanchuk
> On Jun 7, 2021, at 11:07 AM, Rob Sargent wrote: > > 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 decad

Re: Database issues when adding GUI

2021-06-07 Thread Rob Sargent
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 (current

Re: Database issues when adding GUI

2021-06-07 Thread Rob Sargent
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 (current

Database issues when adding GUI

2021-06-07 Thread Rich Shepard
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 t