From 4c43c0e54b41bced027f8c8a187e38b55244b56d Mon Sep 17 00:00:00 2001 From: Nigro Simone Date: Sun, 7 Sep 2025 10:46:54 +0200 Subject: [PATCH 1/3] docs(pg-native): installation Improve installation instruction --- docs/pages/features/native.mdx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/pages/features/native.mdx b/docs/pages/features/native.mdx index cdec4ae9b..32382c2ec 100644 --- a/docs/pages/features/native.mdx +++ b/docs/pages/features/native.mdx @@ -6,7 +6,32 @@ metaTitle: bar Native bindings between node.js & [libpq](https://www.postgresql.org/docs/9.5/static/libpq.html) are provided by the [node-pg-native](https://github.com/brianc/node-pg-native) package. node-postgres can consume this package & use the native bindings to access the PostgreSQL server while giving you the same interface that is used with the JavaScript version of the library. -To use the native bindings first you'll need to install them: +You need PostgreSQL client libraries & tools installed. An easy way to check is to type `pg_config`. If `pg_config` is in your path, you should be good to go. If it's not in your path you'll need to consult operating specific instructions on how to go about getting it there. + +Some ways I've done it in the past: + +- On macOS: `brew install libpq` +- On Ubuntu/Debian: `apt-get install libpq-dev g++ make` +- On RHEL/CentOS: `yum install postgresql-devel` +- On Windows: + 1. Install Visual Studio C++ (successfully built with Express 2010). Express is free. + 1. Install PostgreSQL (http://www.postgresql.org/download/windows/) + 1. Add your Postgre Installation's bin folder to the system path (i.e. C:\Program Files\PostgreSQL\9.3\bin). + 1. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. +- On Docker: +```Docker +FROM node:24-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get -y install libpq-dev python3 g++ make \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* +``` + +Install `pg` and `pg-native` them: ```sh $ npm install pg pg-native From f25d944fb18381423d0bf88f06729116b1ab8278 Mon Sep 17 00:00:00 2001 From: Nigro Simone Date: Wed, 10 Sep 2025 05:19:17 +0200 Subject: [PATCH 2/3] Update native.mdx --- docs/pages/features/native.mdx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/pages/features/native.mdx b/docs/pages/features/native.mdx index 32382c2ec..1ea9c09c3 100644 --- a/docs/pages/features/native.mdx +++ b/docs/pages/features/native.mdx @@ -11,25 +11,13 @@ You need PostgreSQL client libraries & tools installed. An easy way to check is Some ways I've done it in the past: - On macOS: `brew install libpq` -- On Ubuntu/Debian: `apt-get install libpq-dev g++ make` +- On Ubuntu/Debian and Debian-based Node images: `apt-get install libpq-dev python3 g++ make` - On RHEL/CentOS: `yum install postgresql-devel` - On Windows: 1. Install Visual Studio C++ (successfully built with Express 2010). Express is free. - 1. Install PostgreSQL (http://www.postgresql.org/download/windows/) - 1. Add your Postgre Installation's bin folder to the system path (i.e. C:\Program Files\PostgreSQL\9.3\bin). - 1. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. -- On Docker: -```Docker -FROM node:24-slim - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get -y install libpq-dev python3 g++ make \ - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* -``` + 2. Install PostgreSQL (http://www.postgresql.org/download/windows/) + 3. Add your Postgre Installation's bin folder to the system path (i.e. C:\Program Files\PostgreSQL\9.3\bin). + 4. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. Install `pg` and `pg-native` them: From 2da5f85184f63ee5adda89b45603d6d77325fa3f Mon Sep 17 00:00:00 2001 From: Nigro Simone Date: Wed, 10 Sep 2025 05:23:39 +0200 Subject: [PATCH 3/3] Update native.mdx --- docs/pages/features/native.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/features/native.mdx b/docs/pages/features/native.mdx index 1ea9c09c3..a4febc7e6 100644 --- a/docs/pages/features/native.mdx +++ b/docs/pages/features/native.mdx @@ -14,10 +14,10 @@ Some ways I've done it in the past: - On Ubuntu/Debian and Debian-based Node images: `apt-get install libpq-dev python3 g++ make` - On RHEL/CentOS: `yum install postgresql-devel` - On Windows: - 1. Install Visual Studio C++ (successfully built with Express 2010). Express is free. - 2. Install PostgreSQL (http://www.postgresql.org/download/windows/) - 3. Add your Postgre Installation's bin folder to the system path (i.e. C:\Program Files\PostgreSQL\9.3\bin). - 4. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. + 1. Install Visual Studio C++ (successfully built with Express 2010). Express is free. + 2. Install PostgreSQL (`http://www.postgresql.org/download/windows/`) + 3. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`). + 4. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. Install `pg` and `pg-native` them: