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] [-d DBNAME] [--skip-sequence-increment] [dbname] out_dir

Export structure of database to object files for control version system

positional arguments:
  dbname                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 PGHOST=<host>)
  -p PORT, --port PORT  port for connect db (env variable PGPORT=<port>)
  -U USER, --user USER  user for connect db (env variable PGUSER=<user>)
  -W PASSWORD, --password PASSWORD
                        password for connect db (env variable PGPASSWORD=<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)
  -d DBNAME, --dbname DBNAME
                        source database name (env variable PGDATABASE=<dbname>)
  --skip-sequence-increment
                        do not export sequences increment (env variable PG_EXPORT_SKIP_SEQUENCE_INCREMENT=true)

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.13.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pg_export-3.13.0-py3-none-any.whl (54.3 kB view details)

Uploaded Python 3

File details

Details for the file pg_export-3.13.0.tar.gz.

File metadata

  • Download URL: pg_export-3.13.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for pg_export-3.13.0.tar.gz
Algorithm Hash digest
SHA256 2eca09e9c69bb546360d462c6a5707758ed41f9f89e7746443b7ffe09d00c723
MD5 2ac8e80f4ba730c9a82cde75358f184b
BLAKE2b-256 1d673de7919bee9d3422a9bb204b2b39fe4a082156d19f0fac7cbbb170b91f2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pg_export-3.13.0-py3-none-any.whl
  • Upload date:
  • Size: 54.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for pg_export-3.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90f4f6a8d864d86b3899af277e08767461e947867d59d40640a2025a54391075
MD5 060509663fb8660dd3c9ce3d694a68f6
BLAKE2b-256 b6796af5f8b615946ecbf101dc590d54dc324b704fd785610c5833234497322b

See more details on using hashes here.

Supported by

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