PostgreSQL.get_column_dtype

PostgreSQL.get_column_dtype(table_name, column_names=None, schema_name=None)

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

Parameters
  • table_name (str) – name of a table

  • column_names (str or list or None) – (list of) column name(s); when column_names=None (default), all available columns are included

  • schema_name – name of a schema; when 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 or None

See also