当前位置: 首页 > news >正文

Linux(Ubuntu)源码安装postgresql16.3

文章目录

  • Linux(Ubuntu)源码安装postgresql016.3
    • 下载程序包
    • 编译安装软件
      • 初次执行configure
      • 错误调试1:configure: error: ICU library not found
      • 再次执行configure
      • Build
    • 设置环境
    • 初始化数据库
    • 启动数据库
    • 参考

Linux(Ubuntu)源码安装postgresql016.3

下载程序包

下载命令

wget https://ftp.postgresql.org/pub/source/v16.3/postgresql-16.3.tar.gz

使用postgres下载程序包并解压

root@autodl-container-616f40a3b3-41cb82d9:~/autodl-tmp# su - postgres
postgres@autodl-container-616f40a3b3-41cb82d9:~$ pwd
/var/lib/postgresql
postgres@autodl-container-616f40a3b3-41cb82d9:~$ wget https://ftp.postgresql.org/pub/source/v16.3/postgresql-16.3.tar.gz
--2024-09-26 20:54:25--  https://ftp.postgresql.org/pub/source/v16.3/postgresql-16.3.tar.gz
Connecting to 172.19.4.54:12798... connected.
Proxy request sent, awaiting response... 200 OK
Length: 32616059 (31M) [application/octet-stream]
Saving to: 'postgresql-16.3.tar.gz'postgresql-16.3.tar.gz            100%[============================================================>]  31.10M  6.82MB/s    in 4.6s    2024-09-26 20:54:31 (6.82 MB/s) - 'postgresql-16.3.tar.gz' saved [32616059/32616059]postgres@autodl-container-616f40a3b3-41cb82d9:~$ ls -l
total 31852
drwxr-xr-x 3 postgres postgres       26 Sep 24 21:32 10
-rw-rw-r-- 1 postgres postgres 32616059 May  7 04:31 postgresql-16.3.tar.gz
postgres@autodl-container-616f40a3b3-41cb82d9:~$ 

解压

postgres@autodl-container-616f40a3b3-41cb82d9:~$ tar -xvf postgresql-16.3.tar.gz
...
postgres@autodl-container-616f40a3b3-41cb82d9:~$ ls -l
total 31856
drwxr-xr-x 3 postgres postgres       26 Sep 24 21:32 10
drwxrwxr-x 6 postgres postgres     4096 May  7 04:31 postgresql-16.3
-rw-rw-r-- 1 postgres postgres 32616059 May  7 04:31 postgresql-16.3.tar.gz
postgres@autodl-container-616f40a3b3-41cb82d9:~$ 
postgres@autodl-container-616f40a3b3-41cb82d9:~$ cd postgresql-16.3
postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ 

编译安装软件

编译命令:

cd postgresql-16.3
./configure --prefix=/usr/local/pg16
make world
make install-world

初次执行configure

例:

postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ ls
COPYRIGHT       HISTORY  Makefile  aclocal.m4  configure     contrib  meson.build        src
GNUmakefile.in  INSTALL  README    config      configure.ac  doc      meson_options.txt
postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ pwd
/var/lib/postgresql/postgresql-16.3
postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ ./configure --prefix=/var/lib/postgresql/pgsql16  -with-ssl=openssl --with-pgport=5432
checking build system type... x86_64-pc-linux-gnu
....
checking whether to build with ICU support... yes
checking for icu-uc icu-i18n... no
configure: error: ICU library not found
If you have ICU already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-icu to disable ICU support.
postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ 

错误调试1:configure: error: ICU library not found

我们看到编译过程中出现了如下警告。

checking for icu-uc icu-i18n... no
configure: error: ICU library not found
If you have ICU already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-icu to disable ICU support.
postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ 

ICU (International Components for Unicode)库是一组用于支持 Unicode 和全球化的 C/C++ 和 Java 库。
根据错误提示可能缺少icu。

解决方法:
打开另一个终端,尝试安装 ICU。

root@autodl-container-616f40a3b3-41cb82d9:~# uname -a
Linux autodl-container-616f40a3b3-41cb82d9 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@autodl-container-616f40a3b3-41cb82d9:~#  dpkg -l | grep libicu
ii  libicu60:amd64               60.2-3ubuntu3.1     amd64               International Components for Unicode
root@autodl-container-616f40a3b3-41cb82d9:~# apt-get update
Hit:1 https://repo.huaweicloud.com/ubuntu bionic InRelease
Hit:2 https://repo.huaweicloud.com/ubuntu bionic-backports InRelease                             
Get:3 https://repo.huaweicloud.com/ubuntu bionic-proposed InRelease [251 kB]                     
Hit:4 https://repo.huaweicloud.com/ubuntu bionic-security InRelease                                                                     
Get:5 https://repo.huaweicloud.com/ubuntu bionic-updates InRelease [102 kB]                                                             
Get:6 https://repo.huaweicloud.com/ubuntu bionic-proposed/main Sources [79.1 kB]                                                        
Get:7 https://repo.huaweicloud.com/ubuntu bionic-proposed/main amd64 Packages [168 kB]                                                  
Get:9 https://repo.huaweicloud.com/ubuntu bionic-updates/main Sources [684 kB]                                                          
Get:10 https://repo.huaweicloud.com/ubuntu bionic-updates/main amd64 Packages [3,786 kB]      
Ign:11 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease                 
Hit:12 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release
Hit:8 https://packagecloud.io/github/git-lfs/ubuntu bionic InRelease                                                                    
Fetched 5,071 kB in 12s (426 kB/s)                                                                                                      
Reading package lists... Done
root@autodl-container-616f40a3b3-41cb82d9:~# apt-get install libicu-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:gir1.2-glib-2.0 gir1.2-harfbuzz-0.0 icu-devtools libgirepository-1.0-1 libglib2.0-0 libglib2.0-bin libglib2.0-data libglib2.0-devlibglib2.0-dev-bin libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libicu-le-hb-dev libicu-le-hb0 libicu60libiculx60 libpcre16-3 libpcre3 libpcre3-dev libpcre32-3 libpcrecpp0v5 python3-distutils python3-lib2to3
Suggested packages:libglib2.0-doc libgraphite2-utils icu-doc
Recommended packages:xdg-user-dirs
The following NEW packages will be installed:gir1.2-glib-2.0 gir1.2-harfbuzz-0.0 icu-devtools libgirepository-1.0-1 libglib2.0-bin libglib2.0-data libglib2.0-devlibglib2.0-dev-bin libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libicu-dev libicu-le-hb-dev libicu-le-hb0libiculx60 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 python3-distutils python3-lib2to3
The following packages will be upgraded:libglib2.0-0 libicu60 libpcre3
3 upgraded, 22 newly installed, 0 to remove and 169 not upgraded.
Need to get 21.8 MB of archives.
After this operation, 61.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libpcre3 amd64 2:8.39-9ubuntu0.1 [231 kB]
Get:2 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libglib2.0-0 amd64 2.56.4-0ubuntu0.18.04.9 [1,169 kB]
Get:3 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libgirepository-1.0-1 amd64 1.56.1-1 [82.0 kB]
Get:4 https://repo.huaweicloud.com/ubuntu bionic/main amd64 gir1.2-glib-2.0 amd64 1.56.1-1 [131 kB]
Get:5 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libglib2.0-data all 2.56.4-0ubuntu0.18.04.9 [4,728 B]
Get:6 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libicu60 amd64 60.2-3ubuntu3.2 [8,050 kB]
Get:7 https://repo.huaweicloud.com/ubuntu bionic/main amd64 gir1.2-harfbuzz-0.0 amd64 1.7.2-1ubuntu1 [18.6 kB]
Get:8 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 icu-devtools amd64 60.2-3ubuntu3.2 [179 kB]
Get:9 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libglib2.0-bin amd64 2.56.4-0ubuntu0.18.04.9 [68.9 kB]
Get:10 https://repo.huaweicloud.com/ubuntu bionic-updates/main amd64 python3-lib2to3 all 3.6.9-1~18.04 [77.4 kB]
Get:11 https://repo.huaweicloud.com/ubuntu bionic-updates/main amd64 python3-distutils all 3.6.9-1~18.04 [144 kB]
Get:12 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libglib2.0-dev-bin amd64 2.56.4-0ubuntu0.18.04.9 [102 kB]
Get:13 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libpcre16-3 amd64 2:8.39-9ubuntu0.1 [147 kB]
Get:14 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libpcre32-3 amd64 2:8.39-9ubuntu0.1 [138 kB]
Get:15 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libpcrecpp0v5 amd64 2:8.39-9ubuntu0.1 [15.3 kB]
Get:16 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libpcre3-dev amd64 2:8.39-9ubuntu0.1 [536 kB]
Get:17 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libglib2.0-dev amd64 2.56.4-0ubuntu0.18.04.9 [1,385 kB]
Get:18 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libgraphite2-dev amd64 1.3.11-2 [14.5 kB]
Get:19 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libharfbuzz-icu0 amd64 1.7.2-1ubuntu1 [5,604 B]
Get:20 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libharfbuzz-gobject0 amd64 1.7.2-1ubuntu1 [13.4 kB]
Get:21 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libicu-le-hb0 amd64 1.0.3+git161113-4 [14.3 kB]
Get:22 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libiculx60 amd64 60.2-3ubuntu3.2 [19.0 kB]
Get:23 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libicu-le-hb-dev amd64 1.0.3+git161113-4 [29.5 kB]
Get:24 https://repo.huaweicloud.com/ubuntu bionic-security/main amd64 libicu-dev amd64 60.2-3ubuntu3.2 [8,894 kB]
Get:25 https://repo.huaweicloud.com/ubuntu bionic/main amd64 libharfbuzz-dev amd64 1.7.2-1ubuntu1 [302 kB]
Fetched 21.8 MB in 5s (4,639 kB/s)        
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 43135 files and directories currently installed.)
Preparing to unpack .../libpcre3_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre3:amd64 (2:8.39-9ubuntu0.1) over (2:8.39-9) ...
Setting up libpcre3:amd64 (2:8.39-9ubuntu0.1) ...
(Reading database ... 43135 files and directories currently installed.)
Preparing to unpack .../00-libglib2.0-0_2.56.4-0ubuntu0.18.04.9_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.9) over (2.56.4-0ubuntu0.18.04.8) ...
Selecting previously unselected package libgirepository-1.0-1:amd64.
Preparing to unpack .../01-libgirepository-1.0-1_1.56.1-1_amd64.deb ...
Unpacking libgirepository-1.0-1:amd64 (1.56.1-1) ...
Selecting previously unselected package gir1.2-glib-2.0:amd64.
Preparing to unpack .../02-gir1.2-glib-2.0_1.56.1-1_amd64.deb ...
Unpacking gir1.2-glib-2.0:amd64 (1.56.1-1) ...
Selecting previously unselected package libglib2.0-data.
Preparing to unpack .../03-libglib2.0-data_2.56.4-0ubuntu0.18.04.9_all.deb ...
Unpacking libglib2.0-data (2.56.4-0ubuntu0.18.04.9) ...
Preparing to unpack .../04-libicu60_60.2-3ubuntu3.2_amd64.deb ...
Unpacking libicu60:amd64 (60.2-3ubuntu3.2) over (60.2-3ubuntu3.1) ...
Selecting previously unselected package gir1.2-harfbuzz-0.0:amd64.
Preparing to unpack .../05-gir1.2-harfbuzz-0.0_1.7.2-1ubuntu1_amd64.deb ...
Unpacking gir1.2-harfbuzz-0.0:amd64 (1.7.2-1ubuntu1) ...
Selecting previously unselected package icu-devtools.
Preparing to unpack .../06-icu-devtools_60.2-3ubuntu3.2_amd64.deb ...
Unpacking icu-devtools (60.2-3ubuntu3.2) ...
Selecting previously unselected package libglib2.0-bin.
Preparing to unpack .../07-libglib2.0-bin_2.56.4-0ubuntu0.18.04.9_amd64.deb ...
Unpacking libglib2.0-bin (2.56.4-0ubuntu0.18.04.9) ...
Selecting previously unselected package python3-lib2to3.
Preparing to unpack .../08-python3-lib2to3_3.6.9-1~18.04_all.deb ...
Unpacking python3-lib2to3 (3.6.9-1~18.04) ...
Selecting previously unselected package python3-distutils.
Preparing to unpack .../09-python3-distutils_3.6.9-1~18.04_all.deb ...
Unpacking python3-distutils (3.6.9-1~18.04) ...
Selecting previously unselected package libglib2.0-dev-bin.
Preparing to unpack .../10-libglib2.0-dev-bin_2.56.4-0ubuntu0.18.04.9_amd64.deb ...
Unpacking libglib2.0-dev-bin (2.56.4-0ubuntu0.18.04.9) ...
Selecting previously unselected package libpcre16-3:amd64.
Preparing to unpack .../11-libpcre16-3_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre16-3:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libpcre32-3:amd64.
Preparing to unpack .../12-libpcre32-3_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre32-3:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libpcrecpp0v5:amd64.
Preparing to unpack .../13-libpcrecpp0v5_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcrecpp0v5:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libpcre3-dev:amd64.
Preparing to unpack .../14-libpcre3-dev_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre3-dev:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libglib2.0-dev:amd64.
Preparing to unpack .../15-libglib2.0-dev_2.56.4-0ubuntu0.18.04.9_amd64.deb ...
Unpacking libglib2.0-dev:amd64 (2.56.4-0ubuntu0.18.04.9) ...
Selecting previously unselected package libgraphite2-dev:amd64.
Preparing to unpack .../16-libgraphite2-dev_1.3.11-2_amd64.deb ...
Unpacking libgraphite2-dev:amd64 (1.3.11-2) ...
Selecting previously unselected package libharfbuzz-icu0:amd64.
Preparing to unpack .../17-libharfbuzz-icu0_1.7.2-1ubuntu1_amd64.deb ...
Unpacking libharfbuzz-icu0:amd64 (1.7.2-1ubuntu1) ...
Selecting previously unselected package libharfbuzz-gobject0:amd64.
Preparing to unpack .../18-libharfbuzz-gobject0_1.7.2-1ubuntu1_amd64.deb ...
Unpacking libharfbuzz-gobject0:amd64 (1.7.2-1ubuntu1) ...
Selecting previously unselected package libicu-le-hb0:amd64.
Preparing to unpack .../19-libicu-le-hb0_1.0.3+git161113-4_amd64.deb ...
Unpacking libicu-le-hb0:amd64 (1.0.3+git161113-4) ...
Selecting previously unselected package libiculx60:amd64.
Preparing to unpack .../20-libiculx60_60.2-3ubuntu3.2_amd64.deb ...
Unpacking libiculx60:amd64 (60.2-3ubuntu3.2) ...
Selecting previously unselected package libicu-le-hb-dev:amd64.
Preparing to unpack .../21-libicu-le-hb-dev_1.0.3+git161113-4_amd64.deb ...
Unpacking libicu-le-hb-dev:amd64 (1.0.3+git161113-4) ...
Selecting previously unselected package libicu-dev.
Preparing to unpack .../22-libicu-dev_60.2-3ubuntu3.2_amd64.deb ...
Unpacking libicu-dev (60.2-3ubuntu3.2) ...
Selecting previously unselected package libharfbuzz-dev:amd64.
Preparing to unpack .../23-libharfbuzz-dev_1.7.2-1ubuntu1_amd64.deb ...
Unpacking libharfbuzz-dev:amd64 (1.7.2-1ubuntu1) ...
Setting up libicu60:amd64 (60.2-3ubuntu3.2) ...
Setting up libharfbuzz-icu0:amd64 (1.7.2-1ubuntu1) ...
Setting up libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.9) ...
Setting up libicu-le-hb0:amd64 (1.0.3+git161113-4) ...
Setting up libgirepository-1.0-1:amd64 (1.56.1-1) ...
Setting up gir1.2-glib-2.0:amd64 (1.56.1-1) ...
Setting up libglib2.0-data (2.56.4-0ubuntu0.18.04.9) ...
Setting up gir1.2-harfbuzz-0.0:amd64 (1.7.2-1ubuntu1) ...
Setting up libiculx60:amd64 (60.2-3ubuntu3.2) ...
Setting up libpcrecpp0v5:amd64 (2:8.39-9ubuntu0.1) ...
Setting up libpcre32-3:amd64 (2:8.39-9ubuntu0.1) ...
Setting up icu-devtools (60.2-3ubuntu3.2) ...
Setting up libpcre16-3:amd64 (2:8.39-9ubuntu0.1) ...
Setting up python3-lib2to3 (3.6.9-1~18.04) ...
Setting up libglib2.0-bin (2.56.4-0ubuntu0.18.04.9) ...
Setting up libgraphite2-dev:amd64 (1.3.11-2) ...
Setting up libharfbuzz-gobject0:amd64 (1.7.2-1ubuntu1) ...
Setting up python3-distutils (3.6.9-1~18.04) ...
Setting up libpcre3-dev:amd64 (2:8.39-9ubuntu0.1) ...
Setting up libglib2.0-dev-bin (2.56.4-0ubuntu0.18.04.9) ...
Setting up libglib2.0-dev:amd64 (2.56.4-0ubuntu0.18.04.9) ...
Setting up libicu-dev (60.2-3ubuntu3.2) ...
Setting up libharfbuzz-dev:amd64 (1.7.2-1ubuntu1) ...
Setting up libicu-le-hb-dev:amd64 (1.0.3+git161113-4) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
root@autodl-container-616f40a3b3-41cb82d9:~# 
root@autodl-container-616f40a3b3-41cb82d9:~# dpkg -l | grep libicu
ii  libicu-dev                   60.2-3ubuntu3.2     amd64               Development files for International Components for Unicode
ii  libicu-le-hb-dev:amd64       1.0.3+git161113-4   amd64               ICU Layout Engine API on top of HarfBuzz shaping library (dev
ii  libicu-le-hb0:amd64          1.0.3+git161113-4   amd64               ICU Layout Engine API on top of HarfBuzz shaping library
ii  libicu60:amd64               60.2-3ubuntu3.2     amd64               International Components for Unicode
ii  libiculx60:amd64             60.2-3ubuntu3.2     amd64               International Components for Unicode
root@autodl-container-616f40a3b3-41cb82d9:~# 

参考:

linux下源码安装postgresql
https://blog.csdn.net/csdn_gongyao/article/details/140852925
PostgreSQL(Linux版本:16.1)
https://blog.csdn.net/weixin_53029881/article/details/135315805

再次执行configure

./configure --prefix=/var/lib/postgresql/pgsql16  -with-ssl=openssl --with-pgport=5432

例:

postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ ./configure --prefix=/var/lib/postgresql/pgsql16  -with-ssl=openssl --with-pgport=5432
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... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gawk... no
checking for mawk... mawk
checking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes
checking whether gcc supports -Werror=vla, for CFLAGS... yes
checking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no
checking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no
checking whether gcc supports -Wendif-labels, for CFLAGS... yes
checking whether g++ supports -Wendif-labels, for CXXFLAGS... yes
checking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes
checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes
checking whether gcc supports -Wimplicit-fallthrough=3, for CFLAGS... yes
checking whether g++ supports -Wimplicit-fallthrough=3, for CXXFLAGS... yes
checking whether gcc supports -Wcast-function-type, for CFLAGS... no
checking whether g++ supports -Wcast-function-type, for CXXFLAGS... no
checking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes
checking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... yes
checking whether gcc supports -Wformat-security, for CFLAGS... yes
checking whether g++ supports -Wformat-security, for CXXFLAGS... yes
checking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes
checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes
checking whether gcc supports -fwrapv, for CFLAGS... yes
checking whether g++ supports -fwrapv, for CXXFLAGS... yes
checking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes
checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no
checking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes
checking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes
checking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no
checking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no
checking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes
checking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... no
checking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no
checking whether gcc 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 -E
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking allow thread-safe client libraries... 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... /bin/tar
checking whether ln -s works... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for bison... no
configure: WARNING:
*** Without Bison you will not be able to build PostgreSQL from Git nor
*** change any of the parser definition files.  You can obtain Bison from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this, because the Bison
*** output is pre-generated.)
checking for flex... no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from Git nor
*** change any of the scanner definition files.  You can obtain Flex from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.26.1
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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 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 fdatasync... 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 X509_get_signature_nid... yes
checking for SSL_CTX_set_cert_cb... yes
checking for OPENSSL_init_ssl... yes
checking for BIO_meth_new... yes
checking for ASN1_STRING_get0_data... yes
checking for HMAC_CTX_new... yes
checking for HMAC_CTX_free... yes
checking for CRYPTO_lock... no
checking for X509_get_signature_info... yes
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... no
checking for zstd... no
checking for openssl... /usr/bin/openssl
configure: using openssl: OpenSSL 1.1.1  11 Sep 2018
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 for z_streamp... 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 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 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... yes
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... yes
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 __cpuid... 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 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... no
checking for xsltproc... no
checking for fop... no
checking for dbtoepub... no
checking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes
checking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes
configure: using compiler=gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
configure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -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@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ 

Build

编译:

postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ make world
postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ make install-world 

编译成功

postgres@autodl-container-616f40a3b3-41cb82d9:~/postgresql-16.3$ cd ..
postgres@autodl-container-616f40a3b3-41cb82d9:~$ pwd
/var/lib/postgresql
postgres@autodl-container-616f40a3b3-41cb82d9:~$ ls -l
total 31856
drwxr-xr-x 3 postgres postgres       26 Sep 24 21:32 10
drwxrwxr-x 6 postgres postgres       76 Sep 26 21:46 pgsql16
drwxrwxr-x 6 postgres postgres     4096 Sep 26 21:30 postgresql-16.3
-rw-rw-r-- 1 postgres postgres 32616059 May  7 04:31 postgresql-16.3.tar.gz
postgres@autodl-container-616f40a3b3-41cb82d9:~$ 
postgres@autodl-container-616f40a3b3-41cb82d9:~$ cd pgsql16
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ pwd
/var/lib/postgresql/pgsql16
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ ls
bin  include  lib  share
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ 

设置环境

编辑修改.bash_profile文件(vi .bash_profile)。

# .bash_profile# Get the aliases and functions
if [ -f ~/.bashrc ]; then. ~/.bashrc
fi# User specific environment and startup programs
export PG_HOME=/var/lib/postgresql/pgsql16
export PGDATA=/var/lib/postgresql/pgsql16/data
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$PG_HOME/bin
alias psql='/var/lib/postgresql/pgsql16/bin/psql'
export PATH

例:

root@autodl-container-616f40a3b3-41cb82d9:~# su - postgres
postgres@autodl-container-616f40a3b3-41cb82d9:~$ vi .bash_profile
postgres@autodl-container-616f40a3b3-41cb82d9:~$ 

初始化数据库

postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ pwd
/var/lib/postgresql/pgsql16
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ mkdir data
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ 
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ ls -l
total 16
drwxrwxr-x 2 postgres postgres 4096 Sep 26 21:46 bin
drwxrwxr-x 2 postgres postgres   10 Sep 26 22:01 data
drwxrwxr-x 6 postgres postgres 4096 Sep 26 21:46 include
drwxrwxr-x 4 postgres postgres 4096 Sep 26 21:46 lib
drwxrwxr-x 8 postgres postgres 4096 Sep 26 21:46 share
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ 

初始化

postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ initdb -A trust --data-checksums -D /var/lib/postgresql/pgsql16/data -U postgres -W
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 "C".
The default database encoding has accordingly been set to "SQL_ASCII".
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 /var/lib/postgresql/pgsql16/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... PRC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... okSuccess. You can now start the database server using:pg_ctl -D /var/lib/postgresql/pgsql16/data -l logfile startpostgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ 

参考:

initdb
https://www.postgresql.org/docs/16/app-initdb.html

启动数据库

pg_ctl -D /var/lib/postgresql/pgsql16/data -l logfile start

例:

postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ pg_ctl -D /var/lib/postgresql/pgsql16/data -l logfile start
waiting for server to start.... done
server started
postgres@autodl-container-616f40a3b3-41cb82d9:~/pgsql16$ 

登录

root@autodl-container-616f40a3b3-41cb82d9:~/autodl-tmp# su - postgres
ostgres@autodl-container-616f40a3b3-41cb82d9:~$ psql
psql (16.3)
Type "help" for help.postgres=# select pg_reload_conf();pg_reload_conf 
----------------t
(1 row)postgres=# alter system set listen_addresses = '*';
ALTER SYSTEM
postgres=# select pg_reload_conf();pg_reload_conf 
----------------t
(1 row)postgres=# 
postgres=# select setting from pg_settings where name like '%hba%';setting                    
----------------------------------------------/var/lib/postgresql/pgsql16/data/pg_hba.conf
(1 row)postgres=# 

根据情况修改pg_hba.conf文件配置开放postgreSQL连接权限。

PG数据库的基本配置完成

参考

实战PG vector 构建DBA 个人知识库之二: 向量数据库与 PG vector 介绍
https://pgfans.cn/a/3606

https://www.postgresql.org/docs/16/index.html

PostgreSQL16源码编译安装
https://blog.csdn.net/qq_34254018/article/details/135774932

Linux 源码编译安装 Postgresql 16.0
https://blog.csdn.net/CoderChronicle/article/details/134979884

相关文章:

Linux(Ubuntu)源码安装postgresql16.3

文章目录 Linux(Ubuntu)源码安装postgresql016.3下载程序包编译安装软件初次执行configure错误调试1:configure: error: ICU library not found再次执行configureBuild 设置环境初始化数据库启动数据库参考 Linux(Ubuntu)源码安装…...

Python 入门教程(7)面向对象 | 7.6、多态

文章目录 一、多态1、鸭子类型2、实现多态的机制2.1、鸭子类型2.2、继承与重写 3、Python多态的优势4、总结 前言: 在面向对象编程(OOP)中,多态(Polymorphism)是一种非常重要的概念,多态就是同一…...

Cilium + ebpf 系列文章-什么是ebpf?(一)

前言: 这篇非常非常干,很有可能读不懂。 这里非常非常推荐,建议使用Cilium官网的lab来辅助学习!!!Resources Library - IsovalentExplore Isovalents Resource Library, your one-stop destination for ins…...

RabbitMQ08_保证消息可靠性

保证消息可靠性 一、生产者可靠性1、生产者重连机制(防止网络波动)2、生产者确认机制Publisher Return 确认机制Publisher Confirm 确认机制 二、MQ 可靠性1、数据持久化交换机、队列持久化消息持久化 2、Lazy Queue 惰性队列 三、消费者可靠性1、消费者…...

恶意Bot流量识别分析实践

1、摘要 随着互联网的发展,自动化工具和脚本(Bots)的使用越来越普遍。虽然一些善意 Bots 对于网站的正常运行和数据采集至关重要,但恶意 Bots 可能会对网站带来负面影响,如爬取敏感信息、恶意注册、刷流量等。因此&am…...

Java2 实用教程(第6版)习题2 第四题

【源文件的命名与书中的不同】 四、阅读程序题 1、上机运行下列程序&#xff0c;注意观察输出的结果。 public class E2_1 {public static void main(String args[]){for(int i20302;i<20322;i){System.out.println((char) i);}} } 运行结果&#xff1a; 低 住 佐 佑 佒…...

HashMap和ConcurrentHashMap的区别

1.是什么 HashMap和ConcurrentHashMap都是Java集合框架中的成员&#xff0c;它们用于存储键值对&#xff0c;但它们在并发场景下的表现和行为有很大的不同。以下是它们之间的一些主要区别&#xff1a; 1. 并发安全性 HashMap: HashMap不是线程安全的。如果多个线程同时访问Has…...

css 下拉框展示:当hover的时候展示下拉框 z-index的用法解释

代码如下&#xff1a; <template><div class"outer"><div class"left"></div><div class"aTest2"><div class"box">显示方框</div><div class"aTest3"></div></…...

spring装配笔记

spring装配是个大课题&#xff0c;能懂一点是一点吧。 关于代码链路&#xff0c;最后的方式就是倒序摸索&#xff0c;正序那么多逻辑&#xff0c;没有一百万也差不多少&#xff0c;所以就用倒序。 .(点号)和#井号是一个意思&#xff0c;下面代码可能不详细区分&#xff0c;复…...

vscode【实用插件】Notes 便捷做笔记

安装 在 vscode 插件市场的搜索 Notes点 安装 安装成功后&#xff0c;vscode 左侧栏会出现 使用 初次使用 需先选择一个本地目录 重启 vscode 后&#xff0c;得到 切换笔记目录 新建笔记 快捷键为 Alt N 默认会创建 .md 文件 配合插件 Markdown Preview Enhanced 预览 .md…...

中间件:maxwell、canal

文章目录 1、底层原理&#xff1a;基于mysql的bin log日志实现的&#xff1a;把自己伪装成slave2、bin log 日志有三种模式&#xff1a;2.1、statement模式&#xff1a;2.2、row模式&#xff1a;2.3、mixed模式&#xff1a; 3、maxwell只支持 row 模式&#xff1a;4、maxwell介…...

postman控制变量和常用方法

1、添加环境&#xff1a; 2、环境添加变量&#xff1a; 3、配置不同的环境&#xff1a;local、dev、sit、uat、pro 4、 接口调用 5、清除cookie方法&#xff1a; 6、下载文件方法&#xff1a;...

Spring Boot 中整合 Kafka

在 Spring Boot 中整合 Kafka 非常简单&#xff0c;Spring Kafka 提供了丰富的支持&#xff0c;使得我们可以轻松地实现 Kafka 的生产者和消费者。下面是一个简单的 Spring Boot 整合 Kafka 的示例。 1. 添加依赖 首先&#xff0c;在 pom.xml 中添加 Spring Kafka 的依赖&#…...

什么是开放式耳机?具有什么特色?非常值得入手的蓝牙耳机推荐

开放式耳机是当下较为热门的一种耳机类型。它具有以下特点&#xff1a; 设计结构&#xff1a; 呈现开放式的构造&#xff0c;不会完全堵住耳道。如此一来&#xff0c;外界声音能够较容易地被使用者听到&#xff0c;在使用耳机时可以保持对周围环境的察觉。比如在户外&#xf…...

编译 FFmpeg 以支持 AV1 编解码器以及其他硬件加速选项(如 NVENC、VAAPI 等)

步骤 1: 安装必要的依赖 sudo apt update sudo apt install -y \autoconf automake build-essential cmake git libass-dev libfreetype6-dev \libsdl2-dev libtool libva-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev \libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-…...

解释一下Java中的多线程。如何创建一个新的线程?

在Java中&#xff0c;多线程是一种机制&#xff0c;允许一个程序同时执行多个任务或处理。每个任务被称为一个线程。 这种并行执行可以极大地提高应用程序的效率和响应速度。 例如&#xff0c;在开发一个桌面应用程序时&#xff0c;你可以使用一个线程来更新用户界面&#xf…...

Java语言程序设计基础篇_编程练习题**18.30 (找出单词)

题目&#xff1a;**18.30 (找出单词) 编写一个程序&#xff0c;递归地找出某个目录下的所有文件中某个单词出现的次数。从命令行如下传递参数&#xff1a; java Exercise18_30 dirName word 习题思路 &#xff08;读取路径方法&#xff09;和18.28题差不多&#xff0c;把找…...

MyBatis中 #{} 和 ${} 的区别

1. #{id}&#xff08;参数占位符&#xff09; 作用: 使用 #{id} 时&#xff0c;MyBatis 会将 id 参数绑定为 JDBC 的参数。这种方式能够有效防止 SQL 注入攻击&#xff0c;因为它会进行参数的预处理&#xff0c;将参数值作为数据类型的绑定&#xff0c;而不是直接插入到 SQL 语…...

Android Perfetto 学习

1、如何抓取性能日志 方式1、通过手机里的System Tracing抓取 1、点击Settings->System->Developer options->System Tracing->Record trace 打开 2、操作完成后&#xff0c;点击Settings->System->Developer options->System Tracing->Record trace…...

ES数据的删除与备份

背景 需要删除索引下满足指定条件的文档数据&#xff0c;并将删除的数据进行备份。 操作步骤 新建索引 该索引结构与映射关系与原索引一致 查看原索引设置 GET /tb/_settings结果&#xff1a; {"tb" : {"settings" : {"index" : {"ro…...

论文解读《Object-Centric Learning with Slot Attention》

系列文章目录 文章目录 系列文章目录论文细节理解 1. 研究背景2. 论文贡献3. 方法框架3.1 Slot Attention模块3.2 无监督对象发现架构 4. 研究思路5. 实验6. 限制 论文细节理解 supervised property prediction tasks是什么&#xff1f; Supervised property prediction tasks…...

YOLOv8+注意力机制+PyQt5玉米病害检测系统完整资源集合

资源包含可视化的玉米病害检测系统&#xff0c;基于最新的YOLOv8注意力机制训练的玉米病害检测模型&#xff0c;和基于PyQt5制作的可视玉米病害系统&#xff0c;包含登陆页面和检测页面&#xff0c;该系统可自动检测和识别图片或视频当中出现的七类玉米病害&#xff1a;矮花叶病…...

tcp、udp通信调试工具Socket Tool

tcp、udp通信调试工具Socket Tool ]...

MedPrompt:基于提示工程的医学诊断准确率优化方法

Medprompt&#xff1a;基于提示工程的医学诊断准确率优化方法 秒懂大纲解法拆解MedPrompt 提示词全流程分析总结创意视角 论文&#xff1a;Can Generalist Foundation Models Outcompete Special-Purpose Tuning? Case Study in Medicine 秒懂大纲 ├── 1 研究背景【描述背…...

关于ollama 在mac的部署问题

安装 官网链接 直接按需求下载即可 默认模型下载地址 macOS: ~/.ollama/models Linux: /usr/share/ollama/.ollama/models Windows: C:\Users<username>.ollama\models 根据需要的平台设置相应的环境变量&#xff1a; OLLAMA_MODELS 如Mac 设置 &#xff5e;/.zshrc …...

职业技能大赛-单元测试笔记(assertThat)分享

前言 assertThat 是一种用于编写测试断言的方法,广泛应用于 Java 及其他编程语言的测试框架中,如 JUnit 和 AssertJ。它特别强调可读性和流畅性,使得测试代码更加直观易懂,从而提高了开发者在编写和维护测试时的效率。传统的断言方法通常以较为简洁但不够清晰的形式出现,例…...

AI大模型:OpenAI o1或能成为引领AI Phenomenal Ride的LLM新范式

OpenAI 发布 o1 系列大模型&#xff0c;AI 大模型进入新纪元**。**9 月 12 日&#xff0c;OpenAI 宣布开发了一系列全新AI 模型&#xff0c;其被命名为 OpenAI o1-preview&#xff0c;旨在在回应前投入更多时间思考。与之前的模型相比&#xff0c;这些模型能够更好地进行推理&a…...

天命人,如何轻松利用仿真技术打造出属于你的“金箍棒”?

近期&#xff0c;一款以西游记为背景的国产游戏&#xff0c;‌重塑了悟空这一经典角色&#xff0c;‌将其置于一个黑暗、‌魔幻的世界中。同时也是国内第一款 3A 游戏大作&#xff0c;而所谓 3A 游戏&#xff0c;简单来说就是高质量&#xff0c;高体量&#xff0c;高成本的单机…...

【Qt | QAction】Qt 的 QAction 类介绍

&#x1f601;博客主页&#x1f601;&#xff1a;&#x1f680;https://blog.csdn.net/wkd_007&#x1f680; &#x1f911;博客内容&#x1f911;&#xff1a;&#x1f36d;嵌入式开发、Linux、C语言、C、数据结构、音视频&#x1f36d; &#x1f923;本文内容&#x1f923;&a…...

写论文一定要知道的三大AI工具!5分钟完成论文初稿

在当今的学术研究和写作领域&#xff0c;AI工具已经成为不可或缺的助手。它们不仅能够提高写作效率&#xff0c;还能帮助研究者生成高质量的论文。以下是三大值得推荐的AI工具&#xff0c;它们可以帮助你在5分钟内完成论文初稿&#xff0c;并且特别推荐千笔-AIPasspaper。 千笔…...