PostgreSQL.get_column_names

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

Retrieves column names of a table.

Parameters:
  • table_name (str) – Name of the table to retrieve column names from.

  • schema_name (str | None) – Name of the schema where the table is located; defaults to None.

Returns:

List of column names in the specified table in the currently-connected database.

Return type:

list

See also