PostgreSQL.psql_insert_copy

static PostgreSQL.psql_insert_copy(sql_table, sql_db_engine, column_names, data_iter)[source]

Callable function using PostgreSQL COPY clause for executing data insertion.

Parameters:
  • sql_table (pandas.io.sql.SQLTable) – Object that represents the table to insert into.

  • sql_db_engine (sqlalchemy.engine.Connection | sqlalchemy.engine.Engine) – Object that represents the database engine or connection.

  • column_names (list[str]) – List of column names to insert data into.

  • data_iter (Iterable) – Iterable that iterates over the values to be inserted.

Note

This function is modified from the source code available at [DBMS-PS-PIC-1].