Search Postgresql Archives

Re: Database issues when adding GUI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(<connection_str>)
cur = con.cursor()
cur.execute('select * from activitytypes')
rs = cur.fetchall()
print(rs)

Adrian,

con = psycopg2.connect(bustrac)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux