code-server调试postgresql


 TL;DR
用 code-server 在容器里搭建 PostgreSQL 的远程调试环境。
难度 中等

搭建环境

  1. 搭建code-server
docker pull ghcr.io/growdu/oh-my-code/coder:v1.4
  1. 启动code-server
git clone https://github.com/growdu/oh-my-code.git
cd oh-my-code
docker-compose up -d
  1. 登录code-server

  2. 下载postgresql源码

git clone git://git.postgresql.org/git/postgresql.git
  1. 安装c语言插件

从这里下载插件安装。

编译postgresql

./configure --prefix=`pwd`/debug --enable-debug CFLAGS='-O0 -g'
make world -j 8
make install-world

编译完成后如下:

➜  postgresql git:(REL_12_STABLE) ✗ ls debug 
bin  include  lib  share

运行postgresql

./initdb -A trust data
./pg_ctl -D data -l logfile start

文章作者: growdu
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 growdu !
这篇还发到了
今日头条 drafted
  目录