I cannot query from other schema's than public, also I am using supabase and connection string provided in supabase doesn't work.
Asked
Active
Viewed 187 times
0
-
2Please add your answer as an answer. Don't include answers into the question. – BDL Feb 10 '23 at 12:15
1 Answers
0
Use schema.table
in the query.
conn_string = "dbname=postgres user=postgres password=*** host=*** port=****"
with psycopg.connect(conn_string) as conn:
with conn.cursor() as cur:
cur.execute('SELECT "userId" FROM next_auth.sessions ORDER BY expires DESC LIMIT 1')
result = cur.fetchone()
I am using Supabase and the port that they provided in their "connection string" in the admin panel was wrong.