Полезности для Postgres

Category: Python Tags: Postgres, python 6 views

pip install "psycopg[binary]"

Перенос из MariaDB/MySQL в postgres:

  1. Средствами jango:
    python manage.py dumpdata --natural-primary --natural-foreign --indent 2 > data.json
    createdb имя_базы
    python manage.py migrate
    python manage.py loaddata data.json
  2. Средствами pgloader (https://github.com/dimitri/pgloader.git):
    pgloader mysql://user:pass@localhost/old_db postgresql://user:pass@localhost/new_db
Read more →