Skip to content

Pg patches #1587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ydb/docs/en/core/postgresql/docker-connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ To preserve the container's state, you need to remove the environment variable `
- "YDB_USE_IN_MEMORY_PDISKS=true"
- "POSTGRES_USER=${YDB_PG_USER:-root}"
- "POSTGRES_PASSWORD=${YDB_PG_PASSWORD:-1234}"
- "YDB_FEATURE_FLAGS=enable_temp_tables,enable_table_pg_types"
- "YDB_TABLE_ENABLE_PREPARED_DDL=true"
- "YDB_EXPERIMENTAL_PG=1"
```

Run:
Expand All @@ -44,7 +43,7 @@ To preserve the container's state, you need to remove the environment variable `
- Docker command:

```bash
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 -e YDB_FEATURE_FLAGS=enable_temp_tables -e YDB_TABLE_ENABLE_PREPARED_DDL=true -e YDB_USE_IN_MEMORY_PDISKS=true ghcr.io/ydb-platform/local-ydb:nightly
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 -e YDB_EXPERIMENTAL_PG=1 -e YDB_USE_IN_MEMORY_PDISKS=true ghcr.io/ydb-platform/local-ydb:nightly
```

{% endlist %}
Expand Down
5 changes: 2 additions & 3 deletions ydb/docs/ru/core/postgresql/docker-connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
- "YDB_USE_IN_MEMORY_PDISKS=true"
- "POSTGRES_USER=${YDB_PG_USER:-root}"
- "POSTGRES_PASSWORD=${YDB_PG_PASSWORD:-1234}"
- "YDB_FEATURE_FLAGS=enable_temp_tables,enable_table_pg_types"
- "YDB_TABLE_ENABLE_PREPARED_DDL=true"
- "YDB_EXPERIMENTAL_PG=1"
```

запуск:
Expand All @@ -44,7 +43,7 @@
- Docker-команда в одну строку

```bash
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 -e YDB_FEATURE_FLAGS=enable_temp_tables -e YDB_TABLE_ENABLE_PREPARED_DDL=true -e YDB_USE_IN_MEMORY_PDISKS=true ghcr.io/ydb-platform/local-ydb:nightly
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 -e YDB_EXPERIMENTAL_PG=1 -e YDB_USE_IN_MEMORY_PDISKS=true ghcr.io/ydb-platform/local-ydb:nightly
```

{% endlist %}
Expand Down
4 changes: 4 additions & 0 deletions ydb/library/yql/sql/pg/pg_sql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ class TConverter : public IPGParseEvents {
"client_min_messages", // pg_dump
"row_security", // pg_dump
"escape_string_warning", // zabbix
"bytea_output", // zabbix
NULL,
};

Expand Down Expand Up @@ -2317,6 +2318,9 @@ class TConverter : public IPGParseEvents {
if (varName == "server_version_num") {
return GetPostgresServerVersionNum();
}
if (varName == "standard_conforming_strings"){
return "on";
}
return {};
}

Expand Down
3 changes: 3 additions & 0 deletions ydb/public/tools/lib/cmds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ def deploy(arguments):
for flag_name in flags:
enable_feature_flags.append(flag_name)

if 'YDB_EXPERIMENTAL_PG' in os.environ:
optionals['pg_compatible_expirement'] = True

configuration = KikimrConfigGenerator(
parse_erasure(arguments),
arguments.ydb_binary_path,
Expand Down
11 changes: 10 additions & 1 deletion ydb/tests/library/harness/kikimr_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def __init__(
hive_config=None,
datashard_config=None,
enforce_user_token_requirement=False,
default_user_sid=None
default_user_sid=None,
pg_compatible_expirement=False,
):
if extra_feature_flags is None:
extra_feature_flags = []
Expand Down Expand Up @@ -376,6 +377,14 @@ def __init__(
if default_user_sid:
self.yaml_config["domains_config"]["security_config"]["default_user_sids"] = [default_user_sid]

if pg_compatible_expirement:
self.yaml_config["table_service_config"]["enable_prepared_ddl"] = True
# self.yaml_config["table_service_config"]["enable_ast_cache"] = True
# self.yaml_config["table_service_config"]["enable_pg_consts_to_params"] = True
self.yaml_config["table_service_config"]["index_auto_choose_mode"] = 'max_used_prefix'
self.yaml_config["feature_flags"]['enable_temp_tables'] = True
self.yaml_config["feature_flags"]['enable_table_pg_types'] = True

@property
def pdisks_info(self):
return self._pdisks_info
Expand Down