input: Write a function to automatically refresh a given table of data in a PostgreSQL database every 5 minutes. The function should connect to the PostgreSQL database using the psycopg2 library and schedule the refresh using the schedule library. If the program is interrupted, the connection should not be terminated.
  import psycopg2
  from datetime import datetime, timedelta
  import schedule
  import time
  
  conn = psycopg2.connect(
   host="localhost", 
   database="db", 
   user="user", 
   password="password"
  )
  
  def refresh_data():
   cur = conn.cursor()
   query = 'REFRESH TABLE "TableName";'
   cur.execute(query)
   conn.commit()
  
  # run the refresh_data job every 5 minutes
  schedule.every(5).minutes.do(refresh_data)
  
  while True:
   schedule.run_pending()
   time.sleep(1)
  assert refresh_data() == None
output: def refresh_data():
      cur = conn.cursor()
      query = 'REFRESH TABLE "TableName";'
      cur.execute(query)
      conn.commit()