Spaces:
Paused
Paused
| import psycopg2 | |
| # Try direct connection with user "postgres" on port 5432 | |
| DIRECT_URL = "postgresql://postgres:9876607718Ppp@db.xxmvhvxeglsjbewlouqg.supabase.co:5432/postgres" | |
| print("Trying direct connection (postgres/5432)...") | |
| try: | |
| conn = psycopg2.connect(DIRECT_URL) | |
| print("Success!") | |
| conn.close() | |
| except Exception as e: | |
| print("Failed:", e) | |
| # Try pooler connection with sslmode='require' | |
| POOLER_URL_SSL = "postgresql://postgres.xxmvhvxeglsjbewlouqg:9876607718Ppp@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres?sslmode=require" | |
| print("\nTrying pooler connection with sslmode=require...") | |
| try: | |
| conn = psycopg2.connect(POOLER_URL_SSL) | |
| print("Success!") | |
| conn.close() | |
| except Exception as e: | |
| print("Failed pooler ssl:", e) | |