Skip to content

Commit 94d65b1

Browse files
committed
Updated commands in the example
1 parent 8d25dd3 commit 94d65b1

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

ydb/docs/en/core/postgresql/import.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,26 @@ As an example, data generated by [pgbench](https://www.postgresql.org/docs/curre
6565
-e POSTGRES_DB=local --name postgres postgres:14
6666
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 \
6767
-e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 \
68-
-e YDB_FEATURE_FLAGS=enable_temp_tables \
68+
-e YDB_FEATURE_FLAGS=enable_temp_tables,enable_table_pg_types \
6969
-e YDB_USE_IN_MEMORY_PDISKS=true \
70-
ghcr.io/ydb-platform/ydb-local:latest
70+
ghcr.io/ydb-platform/local-ydb:latest
7171
```
7272

7373
2. Generate data through [pgbench](https://www.postgresql.org/docs/current/pgbench.html):
7474

7575
```bash
76-
docker exec postgres pgbench -i postgres://root:1234@localhost/local
76+
docker exec postgres pgbench postgres://root:1234@localhost/local -i
7777
```
7878

79-
3. Create a dump of the database using [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) and load it into {{ ydb-short-name }}:
79+
3. Create a dump of the database using [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html):
8080

8181
```bash
82-
docker exec postgres pg_dump -U root --format=c --file=/var/lib/postgresql/data/dump.sql local
83-
docker cp postgres:/var/lib/postgresql/data/dump.sql .
84-
cat dump.sql | docker exec -i ydb-postgres psql -U root -d local
82+
docker exec postgres pg_dump postgres://root:1234@localhost/local --inserts \
83+
--column-inserts --encoding=utf_8 --rows-per-insert=1000 > dump.sql
8584
```
85+
86+
4. Load the dump into {{ ydb-short-name }}:
87+
88+
```bash
89+
ydb tools pg-convert --ignore-unsupported -i dump.sql | psql postgresql://root:1234@localhost/local
90+
```

ydb/docs/ru/core/postgresql/import.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@
8282
-e POSTGRES_DB=local --name postgres postgres:14
8383
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 \
8484
-e POSTGRES_USER=root -e POSTGRES_PASSWORD=1234 \
85-
-e YDB_FEATURE_FLAGS=enable_temp_tables \
85+
-e YDB_FEATURE_FLAGS=enable_temp_tables,enable_table_pg_types \
8686
-e YDB_USE_IN_MEMORY_PDISKS=true \
87-
ghcr.io/ydb-platform/local-ydb:nightly
87+
ghcr.io/ydb-platform/local-ydb:latest
8888
```
8989

9090
2. Сгенерировать данные через [pgbench](https://www.postgresql.org/docs/current/pgbench.html):
@@ -93,10 +93,15 @@
9393
docker exec postgres pgbench postgres://root:1234@localhost/local -i
9494
```
9595

96-
3. Сделать дамп базы через [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) и загрузить его в {{ ydb-short-name }}:
96+
3. Сделать дамп базы через [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html):
9797

9898
```bash
9999
docker exec postgres pg_dump postgres://root:1234@localhost/local --inserts \
100100
--column-inserts --encoding=utf_8 --rows-per-insert=1000 > dump.sql
101-
ydb tools pg-convert -i dump.sql | psql postgresql://root:1234@localhost/local
102101
```
102+
103+
4. Загрузить дамп базы в {{ ydb-short-name }}:
104+
105+
```bash
106+
ydb tools pg-convert --ignore-unsupported -i dump.sql | psql postgresql://root:1234@localhost/local
107+
```

0 commit comments

Comments
 (0)