Skip to main content

pg to git converter

Project description

pg-export - pg to git converter

Export structure of database to object files for control version system

structure of result directories

casts:
  ...
data:
  schema1:
    table1.sql
  schema2:
    ...
extensions:
  ...
publications:
  ...
schemas:
  schema1:
    aggregate:
      ...
    domains:
      ...
    functions:
      ...
    operators:
      ...
    sequences:
      ...
    tables:
      ...
    triggers:
      ...
    types:
      ...
    views:
      ...
  schema2
    ...

installation

pip install pg-export

usage

usage: pg_export [--help] [--version] [--clean] [--ignore-version] [--echo-queries] [-h HOST] [-p PORT] [-U USER] [-W PASSWORD] [-j JOBS] [-z TIMEZONE] [-n SCHEMA] [-N EXCLUDE_SCHEMA] database out_dir

Export structure of database to object files for control version system

positional arguments:
  database              source database name
  out_dir               directory for object files

options:
  --help                show this help message and exit
  --version             show program's version number and exit
  --clean               clean out_dir if not empty (env variable PG_EXPORT_AUTOCLEAN=true)
  --ignore-version      try exporting an unsupported server version
  --echo-queries        echo commands sent to server
  -h HOST, --host HOST  host for connect db (env variable PG_HOST=<host>)
  -p PORT, --port PORT  port for connect db (env variable PG_PORT=<port>)
  -U USER, --user USER  user for connect db (env variable PG_USER=<user>)
  -W PASSWORD, --password PASSWORD
                        password for connect db (env variable PG_PASSWORD=<password>)
  -j JOBS, --jobs JOBS  number of connections
  -z TIMEZONE, --timezone TIMEZONE
                        timezone for constraints, partitions etc.
  -n SCHEMA, --schema SCHEMA
                        dump the specified schema(s) only
  -N EXCLUDE_SCHEMA, --exclude-schema EXCLUDE_SCHEMA
                        do NOT dump the specified schema(s)

examples

pg_export -h 127.0.0.1 -p 5432 -U postgres -j 4 my_database /tmp/my_database_structure/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pg-export-3.9.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

pg_export-3.9.0-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file pg-export-3.9.0.tar.gz.

File metadata

  • Download URL: pg-export-3.9.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pg-export-3.9.0.tar.gz
Algorithm Hash digest
SHA256 a9234378f152a628904f7a80134c1bd8978df84cdb433f03807814a7846a0071
MD5 7f9130fa13abd5b2beb9381f16ef3446
BLAKE2b-256 2a77b0b8076a3d59cd4f47c3583ab5001698943ff48cee4d6a999ef078fa3ae0

See more details on using hashes here.

File details

Details for the file pg_export-3.9.0-py3-none-any.whl.

File metadata

  • Download URL: pg_export-3.9.0-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pg_export-3.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d90ca6e426e2da4b441b3b2ae81d1a042e6da7ffcd914b2e89f03da209e203e0
MD5 fff8d6b93194b6316c333f15a742de52
BLAKE2b-256 f0a88abddfb9d0e947de500c233ac3bee478dff3be06c24e92b69ef1d2ca47d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page