PostgresDest
class PostgresDest(
tables: PostgresTableNamesSpec,
if_table_exists: IfTableExistsSpec = 'append',
transactional: bool = True,
schema_evolution: SchemaEvolutionSpec = 'strict',
dest_cfg: DestCfgSpec | None = None,
)
Bases: Dest
Categories: destination
Postgres destination for @subscriber -- one target table per slot.
Parameters
tablesPostgresTableNamesSpec (list[str])Target table names, qualified or bare (see
PostgresTableNameSpec); one input slot per table, in
order.
if_table_existsIfTableExistsSpec (Literal['append', 'replace'])"append" (default) adds rows; "replace"
truncates the table before inserting.
schema_evolutionSchemaEvolutionSpec (Literal['strict', 'update'])What a write does when the batch's columns differ from
the table's. "replace" makes the table the batch's own, so it is
not affected. "strict" (the default) refuses a batch with a column
the table lacks; "update" adds the column and widens a number
column the batch has outgrown (a larger integer, double precision, a
decimal that keeps every digit); other type differences are left to
the database, where a value a column cannot hold fails the write. A
column the batch lacks is written NULL either way.
dest_cfgDestCfgSpec | None (Mapping[Literal['postgres.logging_level', 'postgres.schema_evolution_engine', 'tabsdata.sql.write_engine', 'tabsdata.sql.chunk_size'], Any] | None)Optional config mapping over the allowed keys only
(postgres.logging_level,
tabsdata.sql.write_engine, tabsdata.sql.chunk_size).
postgres.schema_evolution_engine takes only "iceberg", the
default.