Spaces:
Running
Running
import psycopg2 | |
connection = psycopg2.connect(database="hf_fundamentals", user="postgres", password="4x?S3nR", host="localhost", port=5432) | |
cursor = connection.cursor() | |
cursor.execute("SELECT * FROM pg_catalog.pg_tables;") | |
# Fetch all rows from database | |
record = cursor.fetchall() | |
print("Data from Database:- ", record) | |