code: def to_postgres_columns(self, columns):
      result = []
  
      database = (
          None
          if self.session.database == ""
          else self.session.database.lower()
      )
      for column_record in columns:
          field_type = column_record.type
  
          column_type = POSTGRES_TYPES.VARCHAR
          # is already in mysql protocol type?
          if isinstance(field_type, int):
              column_type = POSTGRES_TYPES.INT
          # pandas checks
          elif isinstance(field_type, np_dtype):
              if pd_types.is_integer_dtype(field_type):
                  column_type = POSTGRES_TYPES.LONG
              elif pd_types.is_numeric_dtype(field_type):
                  column_type = POSTGRES_TYPES.DOUBLE
              elif pd_types.is_datetime64_any_dtype(field_type):
                  column_type = POSTGRES_TYPES.DATETIME
          # lightwood checks
          elif field_type == dtype.date:
              column_type = POSTGRES_TYPES.DATE
          elif field_type == dtype.datetime:
              column_type = POSTGRES_TYPES.DATETIME
          elif field_type == dtype.float:
              column_type = POSTGRES_TYPES.DOUBLE
          elif field_type == dtype.integer:
              column_type = POSTGRES_TYPES.LONG
  
          if "()" in column_record.alias:
              column_record.alias = column_record.alias.strip("()")
          if "()" in column_record.name:
              column_record.name = column_record.name.strip("()")
  
          result.append(
              {
                  "database": column_record.database or database,
                  #  TODO add 'original_table'
                  "table_name": column_record.table_name,
                  "name": column_record.name,
                  "alias": column_record.alias or column_record.name,
                  # NOTE all work with text-type, but if/when wanted change types to real,
                  # it will need to check all types casts in BinaryResultsetRowPacket
                  "type": column_type,
              }
          )
      return result
  
imports: from typing import Union
  from mindsdb_sql import parse_sql
  from mindsdb_sql.planner import utils
  from numpy import dtype
  from pandas.api import types
  from mindsdb.api.executor import SQLQuery, Column
  from mindsdb.api.mysql.mysql_proxy.utilities.lightwood_dtype import dtype
  from mindsdb.api.executor.command_executor import ExecuteCommands
  from mindsdb.api.mysql.mysql_proxy.utilities import SqlApiException
  from mindsdb.api.postgres.postgres_proxy.postgres_packets.postgres_fields import POSTGRES_TYPES
  from mindsdb.utilities import log
label_desc: Use image node_id 8 for calling the Executor obj's underlying member method code with example usage: obj.to_postgres_columns(columns) and returns: result