File tree 2 files changed +21
-11
lines changed
2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -65,21 +65,26 @@ As an example, data generated by [pgbench](https://www.postgresql.org/docs/curre
65
65
-e POSTGRES_DB=local --name postgres postgres:14
66
66
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 \
67
67
-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 \
69
69
-e YDB_USE_IN_MEMORY_PDISKS=true \
70
- ghcr.io/ydb-platform/ydb- local:latest
70
+ ghcr.io/ydb-platform/local-ydb :latest
71
71
```
72
72
73
73
2 . Generate data through [ pgbench] ( https://www.postgresql.org/docs/current/pgbench.html ) :
74
74
75
75
``` bash
76
- docker exec postgres pgbench -i postgres://root:1234@localhost/local
76
+ docker exec postgres pgbench postgres://root:1234@localhost/local -i
77
77
```
78
78
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 ) :
80
80
81
81
``` 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
85
84
```
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
+ ```
Original file line number Diff line number Diff line change 82
82
-e POSTGRES_DB=local --name postgres postgres:14
83
83
docker run --name ydb-postgres -d --pull always -p 5432:5432 -p 8765:8765 \
84
84
-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 \
86
86
-e YDB_USE_IN_MEMORY_PDISKS=true \
87
- ghcr.io/ydb-platform/local-ydb:nightly
87
+ ghcr.io/ydb-platform/local-ydb:latest
88
88
```
89
89
90
90
2. Сгенерировать данные через [pgbench](https://www.postgresql.org/docs/current/pgbench.html):
93
93
docker exec postgres pgbench postgres://root:1234@localhost/local -i
94
94
` ` `
95
95
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):
97
97
98
98
` ` ` bash
99
99
docker exec postgres pg_dump postgres://root:1234@localhost/local --inserts \
100
100
--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
102
101
` ` `
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
+ ` ` `
You can’t perform that action at this time.
0 commit comments