File size: 702 Bytes
bcf46c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import psycopg2

DATABASE_URL = "postgresql://postgres.xxmvhvxeglsjbewlouqg:9876607718Ppp@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres"

print("Trying direct connection...")
try:
    conn = psycopg2.connect(DATABASE_URL)
    print("Success!")
    conn.close()
except Exception as e:
    print("Failed direct:", e)

# Let's try without pooler (direct connection on 5432)
DIRECT_URL = "postgresql://postgres.xxmvhvxeglsjbewlouqg:9876607718Ppp@db.xxmvhvxeglsjbewlouqg.supabase.co:5432/postgres"
print("\nTrying direct connection on 5432...")
try:
    conn = psycopg2.connect(DIRECT_URL)
    print("Success!")
    conn.close()
except Exception as e:
    print("Failed direct 5432:", e)