0

I cannot query from other schema's than public, also I am using supabase and connection string provided in supabase doesn't work.

dejoma
  • 394
  • 1
  • 6
  • 18
  • 2
    Please add your answer as an answer. Don't include answers into the question. – BDL Feb 10 '23 at 12:15

1 Answers1

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.

Adriaan
  • 17,741
  • 7
  • 42
  • 75
dejoma
  • 394
  • 1
  • 6
  • 18