

How to Create PostgreSQL Custom Builds and Debian Packages
source link: https://www.percona.com/blog/2021/01/28/how-to-create-postgresql-custom-builds-and-debian-packages/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Some time ago, I required a specific version of PostgreSQL. After searching on all the repositories, I was unable to find that specific version. It seems that the PostgreSQL community removes the old package when a new minor version comes. For example, if you need the 12.2 version but the 12.3 version is out, it’s really hard to find out the exact version. I am a developer, so I always can build that specific version for myself, but for the user, they have two major issues. The first issue is they require the “deb” package, not the binaries, and the second issue is they don’t want a complete development environment on their production/staging server. So, I have decided to write a blog to explain how to make a custom build for Debian or ubuntu and make Debian packages.
1 – Download PostgreSQL from this FTP site (https://www.postgresql.org/ftp/source/). There are multiple archives available to download the desired version. After downloading you need to untar the archive.
2 – Download the Debian PostgreSQL’s package generator scripts from the site (https://salsa.debian.org/postgresql/postgresql).
3 – Copy the “debian” folder to postgresql-$PGVER
4 – Change the directory to PostgreSQL code.
5 – The command will generate the Debian packages. This will compile the source code and run the test cases. After that, it will generate the Debian packages.
You may face some issues based on what PostgreSQL version you are building and what version of Debian you are using.
Issue – 1: You may see some dependency unmet error messages, something like this below. In that case, you need to install all of these packages using the apt-get command.
Issue – 2: There is no debhelper-compat on LTS Debian.
You need to modify the control file:
Then you need to create a compact file:
Issue – 3: You may not find llvm on Debian 9, so there you need to add these lines in /etc/apt/sources.list. The complete list of the repo can be found here (https://apt.llvm.org/).
After fixing the issue you can restart from step 5.
Following is the list generated by the last step, which can be copied to the machine where you want to install that.
Conclusion
Most people have some misconception that a custom build is a hard way, but it only requires a little bit of managed effort.
The Percona Distribution for PostgreSQL is free to download and use. It is the best and most critical enterprise-level components from the open-source community, designed and tested to work together in one single source.
Recommend
-
6
Upgrade postgresql-8.4 to postgresql-9.1 on debian Posted: 2011-11-22 - Last updated: 2019-06-05 Tagged
-
10
How to: Compile packages on Debian/Ubuntu by hand Posted: 2008-05-04 - Last updated: 2019-06-05 Tagged
-
5
Debian Packages that Need Lovin'
-
44
First Packages for Debian 11 “bullseye” Now Available Back to the Blog
-
6
Thousands of Debian packages updated from their upstream Git repository meta = {'category': debian, 'date': Wed 25 August 2...
-
9
Debian Packages of mod_dnssd and mod_mime_xattr Due to the great work of Sebastien Estienne there are now Debian packag...
-
10
How to Create DEB Packages for Debian/Ubuntu By Fatih Küçükkarakurt Published 10 hours ago...
-
5
Find errors in packages through mass builds Skip to main content ...
-
9
Packages Autocomplete with apt in Debian or Ubuntu Docker Container Post author:Christos Pontikis
-
6
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK