暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

抢先体验PostgreSQL 17 RC 1

  • 说明:在https://www.postgresql.org/ftp/source已支持下载PostgreSQL 17 RC 1安装包了,赶快来体验吧!!!

一、PostgreSQL 17 RC 1新功能预览

PostgreSQL全球开发团队宣布,PostgreSQL 17的第一个候选版本现已可供下载。作为发布候选版本,PostgreSQL 17 RC 1将与PostgreSQL 17的初始版本基本相同,但在PostgreSQL 17普遍可用之前可能会应用更多的修复。


要将 PostgreSQL 17 RC 1 从较早的 PostgreSQL 版本升级,您需要使用主要版本升级策略,例如 pg_upgrade 或 pg_dump / pg_restore。有关更多信息,请访问升级文档部分。

这是PostgreSQL 17的第一个发布候选版本。除非发现需要延迟或制作额外的发布候选版本的问题,否则PostgreSQL 17应该在2024年9月26日普遍可用。
有关更多信息,请参阅“测试版”页面。

PostgreSQL beta 和发布候选版本是社区发布新版本之前的预发布测试版本。它们的功能冻结(即不再添加新功能),我们在最终发布之前会将其发布给公众进行测试。PostgreSQL beta 和发布候选版本不适用于生产系统。
测试版和发布候选版会提前向社区开放,以便在首次发布前进行测试。它们对于依赖PostgreSQL的平台、驱动程序、工具和实用程序的开发者特别有用,可以帮助他们为新版本的变化做好准备。虽然发布候选版应该与新的主要版本的PostgreSQL初始发布完全相同,但在正式发布之前可能会做出额外的更改。
每个PostgreSQL版本的稳定性在很大程度上取决于社区测试即将发布的版本,使用您的工作负载和测试工具,以便在初始发布之前发现错误和回归。用户测试的质量有助于确定我们何时可以进行最终发布。
PostgreSQL全球开发团队强烈建议不要在生产安装或活跃开发项目中使用PostgreSQL的测试版本。虽然PostgreSQL代码不断受到许多自动和手动测试,但测试版本可能会存在严重错误。在任何测试版本的开发过程中,功能都可能发生向后不兼容的变化,甚至可能完全被移除。

在PostgreSQL Beta 3期间,为PostgreSQL 17应用了几个错误修复。这些包括:

  • 恢复合并/拆分分区功能。
  • 修复了提高逻辑解码子事务性能的功能。
  • 有关详细修复列表,请访问 未解决问题 页面。

二、部署体验

2.1、环境规划

主机名称 Server
主机IP 117.72.67.88
主机IP CentOS Linux 7.9
PostgreSQL版本 17 RC 1

2.2、环境检查

[root@lavm-y2jz8vut0h ~]# hostnamectl
   Static hostname: lavm-y2jz8vut0h
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 22276d54e9754e518df481c64128cd63
           Boot ID: ade130202b33421a9d34795e8380255a
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1160.el7.x86_64
      Architecture: x86-64
[root@lavm-y2jz8vut0h ~]#
[root@lavm-y2jz8vut0h ~]#
复制

2.3、修改主机名

vi /etc/hostname
或 hostnamectl set-hostname Node1
复制

2.4、关闭SELINUX

sed -i  "s/SELINUX=enforcing/SELINUX=disabled/"  /etc/selinux/config
复制

2.5、关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service

或设置开放端口:
查看开放的端口:
firewall-cmd --list-ports
开启防火墙端口:
firewall-cmd --zone=public --add-port=5432/tcp --permanent
命令含义:
–zone #作用域
–add-port=9200/tcp #添加端口,格式为:端口/通讯协议
–permanent #永久生效,没有此参数重启后失效
重新加载一遍才会生效:
firewall-cmd --reload
复制

2.6、安装插件

yum -y install readline readline-devel zlib zlib-devel gettext gettext-devel openssl openssl-devel pam pam-devel libxml2 libxml2-devel libxslt libxslt-devel perl perl-devel tcl-devel uuid-devel gcc gcc-c++ make flex bison perl-ExtUtils*  libicu  libicu-devel  ntp libcurl-devel
复制

2.7、编辑hosts

cat>>/etc/hosts<<EOF
192.168.1.71  Node1
EOF
复制

2.8、用户limits设置

cat>>/etc/security/limits.conf<<EOF
postgres soft nofile 1048576
postgres hard nofile 1048576
postgres soft nproc 131072
postgres hard nproc 131072
postgres soft stack 10240
postgres hard stack 32768
postgres soft core 6291456
postgres hard core 6291456
EOF
复制

2.9、调整内核参数

cat>>/etc/sysctl.conf<<EOF
fs.file-max = 76724200
kernel.sem = 10000 10240000 10000 1024
kernel.shmmni = 4096
kernel.shmall = 253702
kernel.shmmax = 1039163392
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 40960000
vm.dirty_ratio=20
vm.dirty_background_ratio=3
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=500
vm.swappiness=10
vm.min_free_kbytes=524288
vm.swappiness=0
vm.overcommit_memory=2
vm.overcommit_ratio=75
net.ipv4.ip_local_port_range = 10000 65535
EOF


sysctl -p 
复制

2.10、检查主机时间

[root@lavm-y2jz8vut0h ~]# date
Fri Sep  6 13:08:10 CST 2024
[root@lavm-y2jz8vut0h ~]#
复制

2.11、创建数据库用户

  • 说明:注:在主机上创建DBA用户

    groupadd postgres -g 4000
    useradd postgres -g 4000 -u 4000
    echo “postgres”|passwd --stdin postgres

2.12、主机配置sudo

sed -i.bak '100apostgres   ALL=(ALL)       NOPASSWD:ALL' /etc/sudoers
复制

2.13、数据库安装目录规划

目录编号 目录名称 备注
1 postgres 软件安装目录
2 /postgres/server 软件安装目录
3 /postgres/data 数据目录
4 /postgres/WAL 归档目录
5 /postgres/archive 备份目录
6 /install 安装包上传目录
7 /postgres/data/log 日志目录

2.14、创建安装目录

 mkdir /install
 chmod -R 777 /install
 mkdir /postgres
 mkdir -p /postgres/server /postgres/data  /postgres/wal  /postgres/archive  /postgres/backup /postgres/repmgr/log
 sudo chown -R postgres:postgres /postgres /install
 chmod 0775 /postgres
 chmod 0700 /postgres/data
复制

2.15、下载安装包

su  postgres
cd /install	
wget  https://ftp.postgresql.org/pub/source/v17rc1/postgresql-17rc1.tar.gz
tar -zxvf postgresql-17rc1.tar.gz


[postgres@Server install]$ wget https://ftp.postgresql.org/pub/source/v17rc1/postgresql-17rc1.tar.gz
--2024-09-06 13:32:43--  https://ftp.postgresql.org/pub/source/v17rc1/postgresql-17rc1.tar.gz
Resolving ftp.postgresql.org (ftp.postgresql.org)... 147.75.85.69, 217.196.149.55, 87.238.57.227, ...
Connecting to ftp.postgresql.org (ftp.postgresql.org)|147.75.85.69|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27932572 (27M) [application/octet-stream]
Saving to: ‘postgresql-17rc1.tar.gz’

100%[==============================================================================>] 27,932,572  1.51MB/s   in 17s

2024-09-06 13:33:02 (1.58 MB/s) - ‘postgresql-17rc1.tar.gz’ saved [27932572/27932572]

[postgres@Server install]$
复制

2.16、解压安装包

[postgres@Server install]$ tar -zxvf postgresql-17rc1.tar.gz
postgresql-17rc1/
postgresql-17rc1/.cirrus.star
postgresql-17rc1/.cirrus.tasks.yml
postgresql-17rc1/.cirrus.yml
postgresql-17rc1/.dir-locals.el
postgresql-17rc1/.editorconfig
postgresql-17rc1/.git-blame-ignore-revs
postgresql-17rc1/.gitattributes
postgresql-17rc1/.gitignore
postgresql-17rc1/COPYRIGHT
postgresql-17rc1/GNUmakefile.in
postgresql-17rc1/HISTORY
postgresql-17rc1/Makefile
postgresql-17rc1/README.md
postgresql-17rc1/aclocal.m4
postgresql-17rc1/config/
postgresql-17rc1/config/Makefile
postgresql-17rc1/config/ax_pthread.m4
.............................................................
postgresql-17rc1/src/tutorial/.gitignore
postgresql-17rc1/src/tutorial/Makefile
postgresql-17rc1/src/tutorial/README
postgresql-17rc1/src/tutorial/advanced.source
postgresql-17rc1/src/tutorial/basics.source
postgresql-17rc1/src/tutorial/complex.c
postgresql-17rc1/src/tutorial/complex.source
postgresql-17rc1/src/tutorial/funcs.c
postgresql-17rc1/src/tutorial/funcs.source
postgresql-17rc1/src/tutorial/syscat.source
[postgres@Server install]$
复制

2.17、切换安装目录

[postgres@Server install]$ cd /install/postgresql-17rc1
[postgres@Server postgresql-17rc1]$
复制

2.18、编译安装

  • 语法:
./configure --prefix=/postgres/server --with-pgport=5432 --with-openssl

使用  make 或者  make world
$ make world
使用 make install 或者 make install-world 进行安装
$ make install-world     #包含扩展包和文档
复制
  • 安装过程:
[postgres@Server postgresql-17rc1]$ ./configure --prefix=/postgres/server --with-pgport=5432 --with-openssl
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gawk... gawk
checking whether gcc -std=gnu99 supports -Wdeclaration-after-statement, for CFLAGS... yes
checking whether gcc -std=gnu99 supports -Werror=vla, for CFLAGS... yes
checking whether gcc -std=gnu99 supports -Werror=unguarded-availability-new, for CFLAGS... no
checking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no
checking whether gcc -std=gnu99 supports -Wendif-labels, for CFLAGS... yes
checking whether g++ supports -Wendif-labels, for CXXFLAGS... yes
checking whether gcc -std=gnu99 supports -Wmissing-format-attribute, for CFLAGS... yes
checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes
checking whether gcc -std=gnu99 supports -Wimplicit-fallthrough=3, for CFLAGS... no
checking whether g++ supports -Wimplicit-fallthrough=3, for CXXFLAGS... no
checking whether gcc -std=gnu99 supports -Wcast-function-type, for CFLAGS... no
checking whether g++ supports -Wcast-function-type, for CXXFLAGS... no
checking whether gcc -std=gnu99 supports -Wshadow=compatible-local, for CFLAGS... no
checking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... no
checking whether gcc -std=gnu99 supports -Wformat-security, for CFLAGS... yes
checking whether g++ supports -Wformat-security, for CXXFLAGS... yes
checking whether gcc -std=gnu99 supports -fno-strict-aliasing, for CFLAGS... yes
checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes
checking whether gcc -std=gnu99 supports -fwrapv, for CFLAGS... yes
checking whether g++ supports -fwrapv, for CXXFLAGS... yes
checking whether gcc -std=gnu99 supports -fexcess-precision=standard, for CFLAGS... yes
checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no
checking whether gcc -std=gnu99 supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes
checking whether gcc -std=gnu99 supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes
checking whether gcc -std=gnu99 supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no
checking whether gcc -std=gnu99 supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no
checking whether gcc -std=gnu99 supports -Wformat-truncation, for NOT_THE_CFLAGS... no
checking whether gcc -std=gnu99 supports -Wstringop-truncation, for NOT_THE_CFLAGS... no
checking whether gcc -std=gnu99 supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no
checking whether gcc -std=gnu99 supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes
checking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... yes
checking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether to build with ICU support... yes
checking for icu-uc icu-i18n... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with PAM support... no
checking whether to build with BSD Authentication support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with SELinux support... no
checking whether to build with systemd support... no
checking whether to build with XML support... no
checking whether to build with LZ4 support... no
checking whether to build with ZSTD support... no
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for tar... /usr/bin/tar
checking whether ln -s works... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for bison... /usr/bin/bison
configure: using bison (GNU Bison) 3.0.4
checking for flex... /usr/bin/flex
configure: using flex 2.5.37
checking for perl... /usr/bin/perl
configure: using perl 5.16.3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether gcc -std=gnu99 is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking whether strerror_r returns int... no
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlsym... -ldl
checking for library containing socket... none required
checking for library containing getopt_long... none required
checking for library containing shm_open... -lrt
checking for library containing shm_unlink... none required
checking for library containing clock_gettime... none required
checking for library containing shmget... none required
checking for library containing backtrace_symbols... none required
checking for library containing pthread_barrier_wait... -lpthread
checking for library containing readline... -lreadline
checking for inflate in -lz... yes
checking for CRYPTO_new_ex_data in -lcrypto... yes
checking for SSL_new in -lssl... yes
checking for SSL_CTX_set_cert_cb... yes
checking for OPENSSL_init_ssl... no
checking for BIO_meth_new... no
checking for ASN1_STRING_get0_data... no
checking for HMAC_CTX_new... no
checking for HMAC_CTX_free... no
checking for CRYPTO_lock... yes
checking for X509_get_signature_info... no
checking for SSL_CTX_set_num_tickets... no
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking atomic.h usability... no
checking atomic.h presence... no
checking for atomic.h... no
checking copyfile.h usability... no
checking copyfile.h presence... no
checking for copyfile.h... no
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking mbarrier.h usability... no
checking mbarrier.h presence... no
checking for mbarrier.h... no
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking sys/personality.h usability... yes
checking sys/personality.h presence... yes
checking for sys/personality.h... yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking sys/procctl.h usability... no
checking sys/procctl.h presence... no
checking for sys/procctl.h... no
checking sys/signalfd.h usability... yes
checking sys/signalfd.h presence... yes
checking for sys/signalfd.h... yes
checking sys/ucred.h usability... no
checking sys/ucred.h presence... no
checking for sys/ucred.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking ucred.h usability... no
checking ucred.h presence... no
checking for ucred.h... no
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for lz4... /usr/bin/lz4
checking for zstd... no
checking for openssl... /usr/bin/openssl
configure: using openssl: OpenSSL 1.0.2k-fips  26 Jan 2017
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for printf format archetype... gnu_printf
checking for _Static_assert... yes
checking for typeof... typeof
checking for __builtin_types_compatible_p... yes
checking for __builtin_constant_p... yes
checking for __builtin_unreachable... yes
checking for computed goto support... yes
checking for struct tm.tm_zone... yes
checking for union semun... no
checking for socklen_t... yes
checking for struct sockaddr.sa_len... no
checking for locale_t... yes
checking for C/C++ restrict keyword... __restrict
checking for struct option... yes
checking whether assembler supports x86_64 popcntq... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of off_t... 8
checking size of bool... 1
checking for int timezone... yes
checking for wcstombs_l declaration... no
checking for backtrace_symbols... yes
checking for copyfile... no
checking for copy_file_range... no
checking for getifaddrs... yes
checking for getpeerucred... no
checking for inet_pton... yes
checking for kqueue... no
checking for mbstowcs_l... no
checking for memset_s... no
checking for posix_fallocate... yes
checking for ppoll... yes
checking for pthread_is_threaded_np... no
checking for setproctitle... no
checking for setproctitle_fast... no
checking for strchrnul... yes
checking for strsignal... yes
checking for syncfs... yes
checking for sync_file_range... yes
checking for uselocale... yes
checking for wcstombs_l... no
checking for __builtin_bswap16... yes
checking for __builtin_bswap32... yes
checking for __builtin_bswap64... yes
checking for __builtin_clz... yes
checking for __builtin_ctz... yes
checking for __builtin_popcount... yes
checking for __builtin_frame_address... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking how gcc -std=gnu99 reports undeclared, standard C functions... error
checking for posix_fadvise... yes
checking whether posix_fadvise is declared... yes
checking whether fdatasync is declared... yes
checking whether strlcat is declared... no
checking whether strlcpy is declared... no
checking whether strnlen is declared... yes
checking whether preadv is declared... yes
checking whether pwritev is declared... yes
checking whether F_FULLFSYNC is declared... no
checking for explicit_bzero... no
checking for getopt... yes
checking for getpeereid... no
checking for inet_aton... yes
checking for mkdtemp... yes
checking for strlcat... no
checking for strlcpy... no
checking for strnlen... yes
checking for pthread_barrier_wait... yes
checking for getopt_long... yes
checking for syslog... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for opterr... yes
checking for optreset... no
checking unicode/ucol.h usability... yes
checking unicode/ucol.h presence... yes
checking for unicode/ucol.h... yes
checking for rl_completion_suppress_quote... yes
checking for rl_filename_quote_characters... yes
checking for rl_filename_quoting_function... yes
checking for append_history... yes
checking for history_truncate_file... yes
checking for rl_completion_matches... yes
checking for rl_filename_completion_function... yes
checking for rl_reset_screen_size... yes
checking for rl_variable_bind... yes
checking test program... ok
checking whether long int is 64 bits... yes
checking for __builtin_mul_overflow... no
checking size of void *... 8
checking size of size_t... 8
checking size of long... 8
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for __int128... yes
checking for __int128 alignment bug... ok
checking alignment of PG_INT128_TYPE... 16
checking for builtin __sync char locking functions... yes
checking for builtin __sync int32 locking functions... yes
checking for builtin __sync int32 atomic operations... yes
checking for builtin __sync int64 atomic operations... yes
checking for builtin __atomic int32 atomic operations... yes
checking for builtin __atomic int64 atomic operations... yes
checking for __get_cpuid... yes
checking for __get_cpuid_count... no
checking for __cpuid... no
checking for __cpuidex... no
checking for _xgetbv with CFLAGS=... no
checking for _xgetbv with CFLAGS=-mxsave... no
checking for _mm512_popcnt_epi64 with CFLAGS=... no
checking for _mm512_popcnt_epi64 with CFLAGS=-mavx512vpopcntdq -mavx512bw... no
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... no
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... yes
checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no
checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no
checking for __builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w... no
checking which CRC-32C implementation to use... SSE 4.2 with runtime check
checking for library containing sem_init... none required
checking which semaphore API to use... unnamed POSIX
checking which random number source to use... OpenSSL
checking for xmllint... /usr/bin/xmllint
checking for xsltproc... /usr/bin/xsltproc
checking for fop... no
checking for dbtoepub... no
checking whether gcc -std=gnu99 supports -Wl,--as-needed, for LDFLAGS... yes
checking whether gcc -std=gnu99 supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes
configure: using compiler=gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
configure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2
configure: using CPPFLAGS= -D_GNU_SOURCE
configure: using LDFLAGS=  -Wl,--as-needed
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/include/pg_config_ext.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/linux.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.linux to src/Makefile.port
[postgres@Server postgresql-17rc1]$


[postgres@Server postgresql-17rc1]$ make && make install
make -C ./src/backend generated-headers
make[1]: Entering directory `/install/postgresql-17rc1/src/backend'
make -C ../include/catalog generated-headers
make[2]: Entering directory `/install/postgresql-17rc1/src/include/catalog'
'/usr/bin/perl' ../../../src/backend/catalog/genbki.pl --include-path=../../../src/include/ \
        --set-version=17 ../../../src/include/catalog/pg_proc.h ../../../src/include/catalog/pg_type.h ../../../src/include/catalog/pg_attribute.h ../../../src/include/catalog/pg_class.h ../../../src/include/catalog/pg_attrdef.h ../../../src/include/catalog/pg_constraint.h ../../../src/include/catalog/pg_inherits.h ../../../src/include/catalog/pg_index.h ../../../src/include/catalog/pg_operator.h ../../../src/include/catalog/pg_opfamily.h ../../../src/include/catalog/pg_opcla
............................................................................................
make -C test/perl install
make[2]: Entering directory `/install/postgresql-17rc1/src/test/perl'
make[2]: Nothing to be done for `install'.
make[2]: Leaving directory `/install/postgresql-17rc1/src/test/perl'
/usr/bin/mkdir -p '/postgres/server/lib/pgxs/src'
/usr/bin/install -c -m 644 Makefile.global '/postgres/server/lib/pgxs/src/Makefile.global'
/usr/bin/install -c -m 644 Makefile.port '/postgres/server/lib/pgxs/src/Makefile.port'
/usr/bin/install -c -m 644 ./Makefile.shlib '/postgres/server/lib/pgxs/src/Makefile.shlib'
/usr/bin/install -c -m 644 ./nls-global.mk '/postgres/server/lib/pgxs/src/nls-global.mk'
make[1]: Leaving directory `/install/postgresql-17rc1/src'
make -C config install
make[1]: Entering directory `/install/postgresql-17rc1/config'
/usr/bin/mkdir -p '/postgres/server/lib/pgxs/config'
/usr/bin/install -c -m 755 ./install-sh '/postgres/server/lib/pgxs/config/install-sh'
/usr/bin/install -c -m 755 ./missing '/postgres/server/lib/pgxs/config/missing'
make[1]: Leaving directory `/install/postgresql-17rc1/config'
[postgres@Server postgresql-17rc1]$
复制

2.19、创建软连接

su root
mkdir /postgresql
chmod -R 777 /postgresql
chown -R postgres:postgres /postgresql
cd /postgres
ln -s /postgres/server /postgresql
复制

2.20、设置环境变量

vi /home/postgres/.bashrc

export PGPORT=5432
export PGUSER=postgres
export PGHOME=/postgres/server
export PGDATA=/postgres/data
export PATH=$PGHOME/bin:$PATH
source  /home/postgres/.bashrc
复制

2.21、初始化数据库

 /postgresql/server/bin/initdb -D /postgres/data -X/postgres/wal -EUTF8 -Upostgres -W --data-checksums --pwprompt



[postgres@Server ~]$  /postgresql/server/bin/initdb -D /postgres/data -X/postgres/wal -EUTF8 -Upostgres -W --data-checksums --pwprompt
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are enabled.

Enter new superuser password:
Enter it again:

fixing permissions on existing directory /postgres/data ... ok
creating directory /postgres/wal ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Asia/Shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /postgresql/server/bin/pg_ctl -D /postgres/data -l logfile start

[postgres@Server ~]$
复制

2.22、修改postgresql.conf配置信息

echo "PORT=5432">> /postgres/data/postgresql.conf 
echo "listen_addresses='*'">> /postgres/data/postgresql.conf 
复制

2.23、修改pg_hba.conf配置信息,可以在内网访问

[postgres@Server ~]$ vi $PGDATA/pg_hba.conf
增加一列:
host all all 0.0.0.0/0 scram-sha-256

2.24、启动数据库

[postgres@Server ~]$ /postgresql/server/bin/pg_ctl -D /postgres/data -l logfile start
waiting for server to start… done
server started
[postgres@Server ~]$

三、补充问题

3.1、问题记录:Navicat连接PostgreSql时出现 “ERROR: column “datlastsysoid” does not exist LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database”

image.png

  • 解决方案: 升级Navicat工具至17版本。

四.总结

4.1、详细版本说明

官网地址:
https://www.postgresql.org/docs/17/release-17.html

4.2、版本详情

当前测试版本是 PostgreSQL 17 RC1。有关当前测试版本的信息以及如何进行测试,请查看下面的链接。
  • PostgreSQL 17 RC1 发布公告
    https://www.postgresql.org/about/news/postgresql-17-rc1-released-2926/
  • 下载 PostgreSQL 17 RC1 源代码
    https://www.postgresql.org/ftp/source/v17rc1/
  • PostgreSQL 17 文档
    https://www.postgresql.org/docs/17/
  • PostgreSQL 17 发布说明
    https://www.postgresql.org/docs/17/release-17.html
  • PostgreSQL 17 未完成事项
    https://wiki.postgresql.org/wiki/PostgreSQL_17_Open_Items
  • 《PostgreSQL 测试指南》
    https://wiki.postgresql.org/wiki/HowToBetaTest

4.3、后续会陆续体验新功能的用法

最后修改时间:2024-09-09 17:41:49
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

暂无图片
获得了79次点赞
暂无图片
内容获得15次评论
暂无图片
获得了147次收藏
TA的专栏
信创数据库学习中心
收录76篇内容
目录
  • 一、PostgreSQL 17 RC 1新功能预览
    • PostgreSQL全球开发团队宣布,PostgreSQL 17的第一个候选版本现已可供下载。作为发布候选版本,PostgreSQL 17 RC 1将与PostgreSQL 17的初始版本基本相同,但在PostgreSQL 17普遍可用之前可能会应用更多的修复。
  • 二、部署体验
    • 2.1、环境规划
    • 2.2、环境检查
    • 2.3、修改主机名
    • 2.4、关闭SELINUX
    • 2.5、关闭防火墙
    • 2.6、安装插件
    • 2.7、编辑hosts
    • 2.8、用户limits设置
    • 2.9、调整内核参数
    • 2.10、检查主机时间
    • 2.11、创建数据库用户
    • 2.12、主机配置sudo
    • 2.13、数据库安装目录规划
    • 2.14、创建安装目录
    • 2.15、下载安装包
    • 2.16、解压安装包
    • 2.17、切换安装目录
    • 2.18、编译安装
    • 2.19、创建软连接
    • 2.20、设置环境变量
    • 2.21、初始化数据库
    • 2.22、修改postgresql.conf配置信息
    • 2.23、修改pg_hba.conf配置信息,可以在内网访问
    • 2.24、启动数据库
  • 三、补充问题
    • 3.1、问题记录:Navicat连接PostgreSql时出现 “ERROR: column “datlastsysoid” does not exist LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database”
  • 四.总结
    • 4.1、详细版本说明
    • 4.2、版本详情
      • 当前测试版本是 PostgreSQL 17 RC1。有关当前测试版本的信息以及如何进行测试,请查看下面的链接。
    • 4.3、后续会陆续体验新功能的用法