PostgreSQL.get_column_dtype

PostgreSQL.get_column_dtype(table_name, column_names=None, schema_name=None)[source]

Retrieve information about data types of all or specific columns of a table.

Parameters:
  • table_name (str) – Name of the table.

  • column_names (str | list | None) – (List of) column name(s); if column_names=None (default), data types of all available columns are retrieved.

  • schema_name – Name of the schema; if schema_name=None (default), it defaults to DEFAULT_SCHEMA (i.e. 'public').

Returns:

Data types of all or specific columns of a table.

Return type:

dict | None

See also