File size: 325 Bytes
1fce135
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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)