1
I am unable to select in the Postgresql database. Python 3.
conn = psycopg2.connect(host="localhost", dbname='postgres', user='postgres', password=postgres)
cur = conn.cursor()
cur.execute("select id_log, nm_ip, dh_chamada, nm_tipo, nm_contexto, cd_http, in_tamanho from tb_log")
cur.fetchone()
Error result:
cur.execute("select id_log, nm_ip, dh_chamada, nm_tipo, nm_contexto, cd_http, in_tamanho from tb_log") psycopg2.ProgrammingError: relation "tb_log" does not exist LINE 1: ...amada, nm_tipo, nm_contexto, cd_http, in_tamanho from tb_log ^
Base Postgres:
SELECT id_log, nm_ip, dh_chamada, nm_tipo, nm_contexto, cd_http, in_tamanho
FROM tb_log;
Upshot:
1,'12 ','2018-06-07 13:03:13','HEAD ','/FDSFDS',200 ,1000
Are you sure you selected the same database in both examples?
– Woss
Yeah. The same comic
– Alex Sandro