input: def refresh_table_periodically(host: str, database: str, user: str, password: str, table_name: str) -> None:
      """
      Write a Python script to refresh a given table of data in a PostgreSQL database every 5 minutes.
      >>> refresh_table_periodically("localhost", "db", "user", "password", "TableName")
      
      """
output:     import psycopg2
      import time
  
      def refresh_table(conn, table_name):
          with conn.cursor() as cursor:
              cursor.execute(f"REFRESH MATERIALIZED VIEW {table_name};")
          conn.commit()
  
      while True:
          try:
              conn = psycopg2.connect(host=host, database=database, user=user, password=password)
              refresh_table(conn, table_name)
              conn.close()
          except Exception as e:
              print(f"Error refreshing table: {e}")
          time.sleep(300)