Foreign Table Schema
Auto Schema Creation
If no columns are specified in CREATE FOREIGN TABLE
, the appropriate Postgres schema will
automatically be created.
Configure Columns
The select
option can be used to configure the columns mapped over the underlying file(s). This is useful for renaming, modifying, or
generating additional columns. select
takes any string that can be passed to a SQL SELECT
statement. By default, it is set to *
,
which selects all columns as-is.
Preserve Casing
Whereas DuckDB preserves the casing of identifiers like column names by default, Postgres does not. In Postgres, identifiers are automatically lowercased unless wrapped in double quotation marks.
By default, auto schema creation will create column names in lowercase. This can be
changed with the preserve_casing
option, which tells auto schema creation to wrap column names in double
quotes.
Was this page helpful?