File: install.rst

package info (click to toggle)
pgcopydb 0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 30,636 kB
  • sloc: ansic: 217,474; sql: 1,654; sh: 812; makefile: 365; python: 94
file content (119 lines) | stat: -rw-r--r-- 3,881 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Installing pgcopydb
===================

Several distributions are available for pgcopydb.

debian packages
---------------

Binary packages for debian and derivatives (ubuntu) are available from
`apt.postgresql.org`__ repository, install by following the linked
documentation and then::

  $ sudo apt-get install pgcopydb

__ https://wiki.postgresql.org/wiki/Apt


RPM packages
------------

The Postgres community repository for RPM packages is `yum.postgresql.org`__
and includes binary packages for pgcopydb. The way packages are built for
RPM based systems means that the user needs to choose which version of
Postgres pgcopydb was built with. In practice, this doesn't have much
importance, because ``libpq`` is meant to be compatible with many different
Postgres server versions.

After following the instructions for installing the repository, in this
example in a Docker image for Rocky Linux (``docker run --rm -it
rockylinux:9``), then we get the following::

   # dnf search --all --quiet pgcopydb
   ======================== Name & Description & URL Matched: pgcopydb ========================
   pgcopydb.x86_64 : Automate pg_dump | pg_restore between two running Postgres servers
   pgcopydb_11.x86_64 : Automate pg_dump | pg_restore between two running Postgres servers
   pgcopydb_12.x86_64 : Automate pg_dump | pg_restore between two running Postgres servers
   pgcopydb_13.x86_64 : Automate pg_dump | pg_restore between two running Postgres servers
   pgcopydb_14.x86_64 : Automate pg_dump | pg_restore between two running Postgres servers
   pgcopydb_15.x86_64 : Automate pg_dump | pg_restore between two running Postgres servers

__ https://yum.postgresql.org

Docker Images
-------------

Docker images are maintained for each tagged release at dockerhub, and also
built from the CI/CD integration on GitHub at each commit to the `main`
branch.

The DockerHub `dimitri/pgcopydb`__ repository is where the tagged releases
are made available. The image uses the Postgres version currently in debian
stable.

To use this docker image::

  $ docker run --rm -it dimitri/pgcopydb:v0.17 pgcopydb --version

__ https://hub.docker.com/r/dimitri/pgcopydb#!


Or you can use the CI/CD integration that publishes packages from the main
branch to the GitHub docker repository::

  $ docker pull ghcr.io/dimitri/pgcopydb:latest
  $ docker run --rm -it ghcr.io/dimitri/pgcopydb:latest pgcopydb --version
  $ docker run --rm -it ghcr.io/dimitri/pgcopydb:latest pgcopydb --help


Build from sources
------------------

Building from source requires a list of build-dependencies that's comparable
to that of Postgres itself. The pgcopydb source code is written in C and the
build process uses a GNU Makefile.

See our main `Dockerfile`__ for a complete recipe to build pgcopydb as a
debian package when using a debian environment.

__ https://github.com/dimitri/pgcopydb/blob/main/Dockerfile

In particular, the following build dependencies are required to build
pgcopydb. The list is long, because pgcopydb requires a lot of the same
packages as Postgres itself:

::
   
  $ apt-get install -y --no-install-recommends \
      build-essential \
      autotools-dev \
      libedit-dev \
      libgc-dev \
      libpam0g-dev \
      libreadline-dev \
      libselinux1-dev \
      libxslt1-dev \
      libssl-dev \
      libkrb5-dev \
      zlib1g-dev \
      liblz4-dev \
      libpq5 \
      libpq-dev \
      libzstd-dev \
      postgresql-server-dev-all \
      postgresql-common \
      postgresql \
      python3-sphinx


Then the build process is pretty simple, in its simplest form you can just
use ``make clean install``.
If you want to be more fancy, you can also consider::

  $ make -s clean
  $ make -s -j12 install

Once you made it this far, it is a good idea to check our `Contribution
Guide`__.

__ https://github.com/dimitri/pgcopydb/blob/main/CONTRIBUTING.md