사용자 도구

사이트 도구


psql

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
psql [2019/09/27 08:21]
gsjung
psql [2019/10/02 02:22]
gsjung
줄 27: 줄 27:
 nmap -Pnv -p 5432 ec2-54-251-188-3.ap-southeast-1.compute.amazonaws.com nmap -Pnv -p 5432 ec2-54-251-188-3.ap-southeast-1.compute.amazonaws.com
  
 +</code>
 +Get tables
 +<code>
 +with pg.connect(connect_string) as conn:
 +  with conn.cursor() as cur:
 +    cur.execute("""SELECT table_name FROM information_schema.tables
 +       WHERE table_schema = 'public'""")
 +    for table in cur.fetchall():
 +        print(table)
 </code> </code>
psql.txt · 마지막으로 수정됨: 2021/04/13 06:54 (바깥 편집)