Database.check_column

Database.check_column(table_name, column_name)bool[source]

Checks if a column exists in a given table.

Parameters
  • table_name (str) – The table where the column has to be checked

  • column_name (str) – The column to be checked

Returns

True if the column exists, False otherwise.

Return type

bool

Raises

psycopg2.Error – Base exception for all kind of database errors