v.21.4Improvements
Support Non-Default Table Schema for Postgres Storage
Support non-default table schema for postgres storage/table-function. Closes #21701. #21711 (Kseniia Sumarokova).
Why it matters
This feature enables users to connect to and query tables within non-default schemas in PostgreSQL using ClickHouse's Postgres storage engine and table function. Previously, only the default schema was accessible, limiting integration flexibility.How to use it
When defining a Postgres table engine or using the Postgres table function, users can now specify the desired schema explicitly by including the schema name in the table identifier or via a dedicated parameter, allowing queries to access tables in non-default PostgreSQL schemas.Example using the table function:
SELECT * FROM postgresql('host:port', 'database', 'schema.table', 'user', 'password')Or in table engine definition:
type = 'PostgreSQL',
host = 'host',
database = 'database',
table = 'schema.table',
user = 'user',
password = 'password'