Skip to content

postgres

etl_craft.dialects.warehouse.postgres

PostgreSQL warehouse, native tables.

PostgresWarehouse

Bases: WarehouseDialect

PostgreSQL, native tables.

present

present(profile: ConnectionProfile, secret: str, url: WarehouseUrl) -> Presented

Authenticate through psycopg's own arguments, exactly as the Engine DB does.

A setting the URL's query already names (sslmode) is left to the URL.

timestamp_text

timestamp_text(value: str, kind: str) -> str

Normalize instants to UTC; naive timestamps already represent UTC.

date_text

date_text(value: str) -> str

Use ISO dates even when DateStyle differs.

on_connect

on_connect(dbapi_connection: Any, profile: ConnectionProfile, secret: str) -> None

Pin UTC and commit the setting before PostgreSQL's first task transaction.

prepare_update_stage

prepare_update_stage(stage: str, keys: tuple[str, ...]) -> tuple[str, ...]

Give the planner merge-key access and current temporary-stage statistics.

replacement_comment

replacement_comment(conn: Connection, target: str) -> str | None

Preserve comments and refuse rebuilding a partitioned parent as an ordinary table.

full_column_types

full_column_types(conn: Connection, table: str) -> dict[str, str]

Keep PostgreSQL modifiers, array element types and timestamp precision.