class_docstr: This handler handles connection and execution of the PostgreSQL statements.
docstr: Cast df dtypes basing on postgres types
  
  Note:
      Date types casting is not provided because of there is no issues (so far).
      By default pandas will cast postgres date types to:
       - date -> object
       - time -> object
       - timetz -> object
       - timestamp -> datetime64[ns]
       - timestamptz -> datetime64[ns, {tz}]
  
  Args:
      df (DataFrame)
      description (list): psycopg cursor description
docstr_tok: ["Cast","df","dtypes","basing","on","postgres","types","Note",":","Date","types","casting","is","not","provided","because","of","there","is","no","issues","(","so","far",")",".","By","default","pandas","will","cast","postgres","date","types","to",":","-","date","-",">","object","-","time","-",">","object","-","timetz","-",">","object","-","timestamp","-",">","datetime64","[","ns","]","-","timestamptz","-",">","datetime64","[","ns",",","{","tz","}","]","Args",":","df","(","DataFrame",")","description","(","list",")",":","psycopg","cursor","description"]
code: def _cast_dtypes(self, df: DataFrame, description: list) -> None:
      """Cast df dtypes basing on postgres types
  
      Note:
          Date types casting is not provided because of there is no issues (so far).
          By default pandas will cast postgres date types to:
           - date -> object
           - time -> object
           - timetz -> object
           - timestamp -> datetime64[ns]
           - timestamptz -> datetime64[ns, {tz}]
  
      Args:
          df (DataFrame)
          description (list): psycopg cursor description
      """
      types_map = {
          "int2": "int16",
          "int4": "int32",
          "int8": "int64",
          "numeric": "float64",
          "float4": "float32",
          "float8": "float64",
      }
      for column_index, column_name in enumerate(df.columns):
          if str(df[column_name].dtype) == "object":
              pg_type = types.get(description[column_index].type_code)
              if pg_type is not None and pg_type.name in types_map:
                  df[column_name] = df[column_name].astype(
                      types_map[pg_type.name]
                  )
  
imports: from collections import OrderedDict
  import psycopg
  from psycopg.postgres import types
  from psycopg.pq import ExecStatus
  from pandas import DataFrame
  from mindsdb_sql import parse_sql
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  import mindsdb.utilities.profiler
label_desc: Use image node_id 6 for calling the PostgresHandler obj's underlying member method code with example usage: obj._cast_dtypes(df, description) without return types