From cb1599812f1749d42ce4e88bae06d9f2c7ed8b54 Mon Sep 17 00:00:00 2001 From: pashko Date: Tue, 21 Jul 2026 00:23:13 +0800 Subject: [PATCH] Add move_psql.md --- move_psql.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 move_psql.md diff --git a/move_psql.md b/move_psql.md new file mode 100644 index 0000000..246d0e3 --- /dev/null +++ b/move_psql.md @@ -0,0 +1,15 @@ +## Этап 1. Создание дампов +### 1.1. Дамп СХЕМЫ (только таблицы, без функций/триггеров) +pg_dump -p 5436 -U postgres -d edemo_ehd1 \ + --schema-only \ + --clean \ + --if-exists \ + --exclude-function \ + --exclude-trigger \ + --exclude-table="*" \ + --exclude-schema=pg_catalog,information_schema \ + 2>/dev/null | \ + grep -vE '^(CREATE|ALTER|DROP) (ROLE|TABLESPACE)' | \ + sed -E 's/OWNER TO [^;]+;/OWNER TO current_user;/g' | \ + sed -E 's/ TABLESPACE = [^;]+//g' \ + > /opt/pg_dumps/01_schema_tables.sql \ No newline at end of file