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