当前位置:网站首页>postgresql源码编译
postgresql源码编译
2022-06-11 15:39:00 【happytree001】
一、环境说明
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
- 安装docker
$ sudo apt install docker.io
$ sudo docker -v
Docker version 20.10.7, build 20.10.7-0ubuntu5~18.04.3
- 获取ubuntu镜像
$ sudo docker pull ubuntu
二、编译
2.1 获取源码
- 从官网上下载源码
$ wget https://ftp.postgresql.org/pub/source/v14.2/postgresql-14.2.tar.bz2
- 解压
$ tar xf postgresql-14.2.tar.bz2
2.2 编译源码
- 启动容器
$ sudo docker run -it -v /home/trevor/桌面/postgresql-14.2:/code --name build-pg ubuntu /bin/bash
[email protected]:/# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
- 安装编译工具
[email protected]:/# apt update && apt install -y gcc libreadline-dev zlib1g-dev make
- 编译
[email protected]:/# cd /code
[email protected]:/# ./configure
[email protected]:/# make
[email protected]:/# make install
2.3 初始化
- 创建postgres用户
[email protected]:/# adduser postgres
[email protected]:/# mkdir /usr/local/pgsql/data
[email protected]:/# chown postgres /usr/local/pgsql/data
[email protected]:/# su - postgres
- 初始化db
[email protected]:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
- 启动服务器
[email protected]:~$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
三、验证
3.1 创建数据库
[email protected]:~$ /usr/local/pgsql/bin/createdb test
3.2 使用数据库
[email protected]:~$ /usr/local/pgsql/bin/psql test
psql (14.2)
Type "help" for help.
test=# select version();
version
--------------------------------------------------------------------------------------------------
PostgreSQL 14.2 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, 64-bit
(1 row)
边栏推荐
- YEF 2022昨日开幕,多网络平台全程免费直播,开启在线技术盛宴!
- 知网被立案调查;字节跳动成立抖音集团,或在港上市;钉钉被曝裁员30%;北京人均存款超20万元 |Q资讯
- 数据库资源负载管理(上篇)
- selenium--显示等待(中)--详解篇
- How to write elegant secondary classification for enterprise development [small case of meituan]
- Tianjin Port coke wharf hand in hand map flapping software to visually unlock the smart coke port
- HowNet has been filed for investigation; Byte beat established Tiktok group or listed in Hong Kong; The nail was exposed to be cut by 30%; Beijing's per capita deposit exceeds 200000 yuan | Q informat
- 从内核代码了解SQL如何解析
- With an average annual salary of 20W, automated test engineers are so popular?
- 数据库密态等值查询概述及操作
猜你喜欢

前沿科技探究之AI工具:Anomaly-detection

Code farming essential SQL tuning (Part 2)

Using cloud DB to build app quick start - quick application

关于 JS 函数的一切

Analysis of breadcrumb usage scenarios on websites

从屡遭拒稿到90后助理教授,罗格斯大学王灏:好奇心驱使我不断探索

openGauss数据库性能调优概述及实例分析

GO语言-Slice切片

Tianjin Port coke wharf hand in hand map flapping software to visually unlock the smart coke port

The third generation Pentium B70 won the C-NCAP five-star safety performance again
随机推荐
[0006] title, keyword and page description
openGauss并行解码浅谈
openGauss数据库性能调优概述及实例分析
将配置导出到FTP或TFTP服务器
Is it possible to use multiple indexes together in a query?
我的代码变量名称统一 记录
2022年软件测试的前景如何?需不需要懂代码?
Hands on, how should selenium deal with pseudo elements?
Kaixia was selected into the 2022 global top 100 innovation institutions list of Kerui Weian
【愚公系列】2022年06月 .NET架构班 078-分布式中间件 ScheduleMaster的Worker集群
同学,你听说过MOT吗?
Discussion on opengauss parallel decoding
The third generation Pentium B70 won the C-NCAP five-star safety performance again
Analysis of the execution process of opengauss simple query SQL
网站上的 breadcrumb 使用场景浅析
导入数据:gs_restore or MERGE INTO? 看看哪款更适合你
The research results of Professor xuweixin from the school of atmosphere of Sun Yat sen University on extreme precipitation caused by weak convection were reported by science highlights
[系统安全] 四十二.Powershell恶意代码检测系列 (4)论文总结及抽象语法树(AST)提取
验证码是自动化的天敌?阿里研究出了解决方法
After nine years of testing, the salary for interviewing Huawei is 10000. Huawei employees: the company doesn't have such a low salary position