mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 02:52:13 +00:00
Merge pull request #56959 from melvynator/master
Add experimental flag for MaterializedPostgreSQL table engine.
This commit is contained in:
commit
13187bf4f1
@ -8,6 +8,14 @@ sidebar_label: MaterializedPostgreSQL
|
|||||||
|
|
||||||
Creates ClickHouse table with an initial data dump of PostgreSQL table and starts replication process, i.e. executes background job to apply new changes as they happen on PostgreSQL table in the remote PostgreSQL database.
|
Creates ClickHouse table with an initial data dump of PostgreSQL table and starts replication process, i.e. executes background job to apply new changes as they happen on PostgreSQL table in the remote PostgreSQL database.
|
||||||
|
|
||||||
|
:::note
|
||||||
|
This table engine is experimental. To use it, set `allow_experimental_materialized_postgresql_table` to 1 in your configuration files or by using the `SET` command:
|
||||||
|
```sql
|
||||||
|
SET allow_experimental_materialized_postgresql_table=1
|
||||||
|
```
|
||||||
|
:::
|
||||||
|
|
||||||
|
|
||||||
If more than one table is required, it is highly recommended to use the [MaterializedPostgreSQL](../../../engines/database-engines/materialized-postgresql.md) database engine instead of the table engine and use the `materialized_postgresql_tables_list` setting, which specifies the tables to be replicated (will also be possible to add database `schema`). It will be much better in terms of CPU, fewer connections and fewer replication slots inside the remote PostgreSQL database.
|
If more than one table is required, it is highly recommended to use the [MaterializedPostgreSQL](../../../engines/database-engines/materialized-postgresql.md) database engine instead of the table engine and use the `materialized_postgresql_tables_list` setting, which specifies the tables to be replicated (will also be possible to add database `schema`). It will be much better in terms of CPU, fewer connections and fewer replication slots inside the remote PostgreSQL database.
|
||||||
|
|
||||||
## Creating a Table {#creating-a-table}
|
## Creating a Table {#creating-a-table}
|
||||||
|
@ -800,6 +800,7 @@ class IColumn;
|
|||||||
M(Bool, optimize_uniq_to_count, true, "Rewrite uniq and its variants(except uniqUpTo) to count if subquery has distinct or group by clause.", 0) \
|
M(Bool, optimize_uniq_to_count, true, "Rewrite uniq and its variants(except uniqUpTo) to count if subquery has distinct or group by clause.", 0) \
|
||||||
\
|
\
|
||||||
/** Experimental functions */ \
|
/** Experimental functions */ \
|
||||||
|
M(Bool, allow_experimental_materialized_postgresql_table, false, "Allows to use the MaterializedPostgreSQL table engine. Disabled by default, because this feature is experimental", 0) \
|
||||||
M(Bool, allow_experimental_funnel_functions, false, "Enable experimental functions for funnel analysis.", 0) \
|
M(Bool, allow_experimental_funnel_functions, false, "Enable experimental functions for funnel analysis.", 0) \
|
||||||
M(Bool, allow_experimental_nlp_functions, false, "Enable experimental functions for natural language processing.", 0) \
|
M(Bool, allow_experimental_nlp_functions, false, "Enable experimental functions for natural language processing.", 0) \
|
||||||
M(Bool, allow_experimental_hash_functions, false, "Enable experimental hash functions", 0) \
|
M(Bool, allow_experimental_hash_functions, false, "Enable experimental hash functions", 0) \
|
||||||
|
@ -546,6 +546,10 @@ void registerStorageMaterializedPostgreSQL(StorageFactory & factory)
|
|||||||
metadata.setColumns(args.columns);
|
metadata.setColumns(args.columns);
|
||||||
metadata.setConstraints(args.constraints);
|
metadata.setConstraints(args.constraints);
|
||||||
|
|
||||||
|
if (!args.attach && !args.getLocalContext()->getSettingsRef().allow_experimental_materialized_postgresql_table)
|
||||||
|
throw Exception(ErrorCodes::BAD_ARGUMENTS, "MaterializedPostgreSQL is an experimental table engine."
|
||||||
|
" You can enable it with the `allow_experimental_materialized_postgresql_table` setting");
|
||||||
|
|
||||||
if (!args.storage_def->order_by && args.storage_def->primary_key)
|
if (!args.storage_def->order_by && args.storage_def->primary_key)
|
||||||
args.storage_def->set(args.storage_def->order_by, args.storage_def->primary_key->clone());
|
args.storage_def->set(args.storage_def->order_by, args.storage_def->primary_key->clone());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user