Avoids a network roundtrip at connection to set the search path when possible.
We decide whether we do that roundtrip based on the Postgres flavour set with the URL. In the QE, that flavour is set based on the provider used in the schema.
The different behaviours are:
PostgresFlavour::Postgres: Avoid a network roundtrip by setting the search path through client connection parameters.
PostgresFlavour::Cockroach: Avoid a network roundtrip if the schema name is deemed "safe" (i.e. no escape quoting required). Otherwise, set the search path through a database query. We do that because Cockroach has issues when parsing schema names https://github.com/cockroachdb/cockroach/issues/101394
PostgresFlavour::Unknown: Always add a network roundtrip by setting the search path through a database query. This ensures backward compatibility for the Migration Engine. The default flavour is set to Unknown, thus always setting the search_path through a database query, ensuring that it works fine both on PG & CRDB. Note: Since the ME makes it possible to create a connector either via the schema or via an URL, it felt complicated to ensure that the correct flavour was always set so that the search path would be correctly applied.
Note: This is a breaking change for CRDB users that use Postgres as a provider in their schema and who have a schema named that requires to be escaped quoted.
Overview
Avoids a network roundtrip at connection to set the search path when possible.
We decide whether we do that roundtrip based on the Postgres flavour set with the URL. In the QE, that flavour is set based on the provider used in the schema.
The different behaviours are:
PostgresFlavour::Postgres
: Avoid a network roundtrip by setting the search path through client connection parameters.PostgresFlavour::Cockroach
: Avoid a network roundtrip if the schema name is deemed "safe" (i.e. no escape quoting required). Otherwise, set the search path through a database query. We do that because Cockroach has issues when parsing schema names https://github.com/cockroachdb/cockroach/issues/101394PostgresFlavour::Unknown
: Always add a network roundtrip by setting the search path through a database query. This ensures backward compatibility for the Migration Engine. The default flavour is set toUnknown
, thus always setting the search_path through a database query, ensuring that it works fine both on PG & CRDB. Note: Since the ME makes it possible to create a connector either via the schema or via an URL, it felt complicated to ensure that the correct flavour was always set so that the search path would be correctly applied.Note: This is a breaking change for CRDB users that use Postgres as a provider in their schema and who have a schema named that requires to be escaped quoted.