You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% include [./_includes/alert.md](./_includes/alert_preview.md) %}
4
+
3
5
This section contains PostgreSQL functions supported in the {{ ydb-short-name }} mode of compatibility with PostgreSQL. The original structure of the PostgreSQL documentation and examples of function application are preserved in the section. This article is automatically supplemented and tested.
4
6
5
7
{% include [functions](./_includes/functions.md) %}
Copy file name to clipboardExpand all lines: ydb/docs/en/core/postgresql/import.md
+42-20
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Dump data form PostgreSQL
2
2
3
+
{% include [./_includes/alert.md](./_includes/alert_preview.md) %}
4
+
3
5
Data from PostgreSQL can be migrated to {{ ydb-short-name }} using utilities such as [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html), [psql](https://www.postgresql.org/docs/current/app-psql.html), and [{{ ydb-short-name }} CLI](../reference/ydb-cli/index.md). The [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) and [psql](https://www.postgresql.org/docs/current/app-psql.html) utilities are installed with PostgreSQL. [{{ ydb-short-name }} CLI](../reference/ydb-cli/index.md) is {{ ydb-short-name }}'s command-line client, which is [installed separately](../reference/ydb-cli/install.md).
4
6
5
7
To do this, you need to:
@@ -26,8 +28,8 @@ The `ydb tools pg-convert` command reads a dump file or standard input created b
26
28
* Deleting the `WITH (...)` section in `CREATE TABLE`.
27
29
* Commenting out unsupported constructs (optionally):
28
30
29
-
*`SELECT pg_catalog.set_config.*`
30
-
*`ALTER TABLE`
31
+
*`SELECT pg_catalog.set_config.*`
32
+
*`ALTER TABLE`
31
33
32
34
If the CLI cannot find a table's primary key, it will automatically create a [BIGSERIAL](https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL) column named `__ydb_stub_id` as the primary key.
33
35
@@ -60,26 +62,46 @@ As an example, data generated by [pgbench](https://www.postgresql.org/docs/curre
60
62
61
63
1. Start Docker containers with PostgreSQL and {{ ydb-short-name }}:
62
64
63
-
```bash
64
-
docker run -d --rm -e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 \
This command uses {{ ydb-short-name }} CLI to convert the dump.sql file to the format readable by the {{ ydb-short-name }} PostgreSQL compatibility layer. The converted dump file is then redirected to the `psql` utility for loading the data into {{ ydb-short-name }} via PostgreSQL protocol.
{% include [./_includes/alert.md](./_includes/alert_preview.md) %}
4
+
3
5
В данном разделе содержатся PostgreSQL функции, поддерживаемые в режиме совместимости {{ ydb-short-name }} с PostgreSQL. В разделе сохранены оригинальная структура документации PostgreSQL и примеры применения функций. Данная статья автоматически пополняется и тестируется, поэтому текст представлен только на английском языке.
4
6
5
7
{% include [functions](./_includes/functions.md) %}
Эта команда использует {{ ydb-short-name }} CLI для преобразования файла `dump.sql` в формат, поддерживаемый {{ ydb-short-name }} в режиме совместимости с PostgreSQL. Затем преобразованный файл перенаправляется в утилиту `psql` для загрузки данных в {{ ydb-short-name }} по протоколу PostgreSQL.
0 commit comments