PostgreSQL 15 源码安装
简单安装流程:
./configure
make
su
make install
adduser postgres
mkdir -p /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile
start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
支持的系统平台:
平台 (即CPU架构和操作系统的组合) 如果代码包含了在该平台上工作的条款,并且它最近已经被验证在该平台上构建并通过了回归测试,将被PostgreSQL开发社区认为是支持的。目前,大多数平台兼容性测试都是由PostgreSQL Build中的测试机器自动完成的。如果对PostgreSQL在一个平台上的使用感兴趣,而这个平台没有出现在构建场中,但是代码可以在这个平台上工作,那么强烈建议加入我们,以便我们可以提供更好的兼容性。
一般来说,PostgreSQL可以在这些CPU架构上工作:x86, x86_64, IA64,PowerPC、PowerPC 64、S/390、S/390x、Sparc、Sparc 64、ARM、MIPS、MIPSEL、PA-RISC。代码也支持这类的M68K, M32R,和VAX架构,但这些架构不确定是否已经测试了最近。通常可以通过配—dis- able-spinlocks在不受支持的CPU类型上构建,但性能会很差。
PostgreSQL可以在以下操作系统上工作:Linux(所有最新发行版),Windows (XP和更高版本)、FreeBSD、OpenBSD、NetBSD、macOS、AIX、HP/UX和Solaris。其他类unix系统也可以工作,但目前还没有进行测试。在大多数情况下,一个给定的操作系统支持的所有CPU架构都可以工作。
软件依赖安装要求:
必须安装包:
第一:GNU make version 3.81 or newer is required,测试方法:make --version
第二:You need an ISO/ANSI C compiler (at least C99-compliant).
第三: tar is required to unpack the source distribution, in addition to either gzip or bzip2.
第四:The GNU Readline library is used by default. It allows psql (the PostgreSQL command line SQL interpreter) to remember each command you type, and allows you to use arrow keys to recall and edit previous commands. This is very helpful and is strongly recommended. If you don't want to use it then you must specify the --without-readline option to configure. As an alternative, you can often use the BSD-licensed libedit library, originally developed on NetBSD. The libedit library is GNU Readline-compatible and is used if libreadline is not found, or if --with-libedit-preferred is used as an option to configure. If you are using a package-based Linux distribution, be aware that you need both the readline and readline-devel packages,if those are separate in your distribution.
第五:The zlib compression library is used by default. If you don't want to use it then you must specify the --without-zlib option to configure. Using this option disables support for compressed archives in pg_dump and pg_restore
可选安装包:
第一:To build the server programming language PL/Perl you need a full Perl installation, including the libperl library and the header files
第二:To build the PL/Python server programming language, you need a Python installation with the header files and the sysconfig module. The minimum required version is Python 3.2
第三:To build the PL/Tcl procedural language, you of course need a Tcl installation. The minimum re-quired version is Tcl 8.4
第四:To enable Native Language Support (NLS), that is, the ability to display a program's messages in a language other than English, you need an implementation of the Gettext API.
第五:You need OpenSSL, if you want to support encrypted client connections.
第六:You need Kerberos, OpenLDAP, and/or PAM, if you want to support authentication using those services.
第七:You need LZ4, if you want to support compression of data with that method; see default_toast_com-pression and wal_compression.、、
第八:You need Zstandard, if you want to support compression of data with that method; see wal_com-pression. The minimum required version is 1.4.0.
第九:To build the PostgreSQL documentation, there is a separate set of requirements; see Section J.2.
开发环境依赖包:
第一:Flex and Bison are needed to build from a Git checkout, or if you changed the actual scanner and parser definition files. If you need them, be sure to get Flex 2.5.31 or later and Bison 1.875 or later. Other lex and yacc programs cannot be used.
第二:Perl 5.8.3 or later is needed to build from a Git checkout, or if you changed the input files for any of the build steps that use Perl scripts. If building on Windows you will need Perl in any case. Perl is also required to run some test suites.
空间要求;
还要检查是否有足够的磁盘空间。您将需要大约350 MB的源代码树大约60 MB用于安装目录。一个空的数据库集群大约需要40个MB;数据库占用的空间大约是具有相同数据的平面文本文件的五倍接受。如果要运行回归测试,则暂时需要额外的300 MB。使用df命令检查磁盘剩余空间。
下载GNU链接:
If you need to get a GNU package, you can find it at your local GNU mirror site (see https://www.gnu.org/prep/ftp for a list) or at ftp://ftp.gnu.org/gnu/.
源码下载链接
PostgreSQL发布版本的源代码可以从网站https://www.postgresql.org/ftp/source/下载。请下载“postgresql-version.tar.gz”或“postgresql-version.tar”。然后将其解压缩:tar xf postgresql-version.tar.bz2
原文来自:postgresql-15 官方文档
标签:15,version,local,pgsql,源码,usr,need,PostgreSQL,安装包 From: https://www.cnblogs.com/wangguanghui-83767582/p/17627546.html