Skip to content

Commit 7472fbd

Browse files
authored
docs(pg-native): installation (#3541)
* docs(pg-native): installation Improve installation instruction * Update native.mdx * Update native.mdx
1 parent 2d08681 commit 7472fbd

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/pages/features/native.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ metaTitle: bar
66

77
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.
88

9-
To use the native bindings first you'll need to install them:
9+
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.
10+
11+
Some ways I've done it in the past:
12+
13+
- On macOS: `brew install libpq`
14+
- On Ubuntu/Debian and Debian-based Node images: `apt-get install libpq-dev python3 g++ make`
15+
- On RHEL/CentOS: `yum install postgresql-devel`
16+
- On Windows:
17+
1. Install Visual Studio C++ (successfully built with Express 2010). Express is free.
18+
2. Install PostgreSQL (`http://www.postgresql.org/download/windows/`)
19+
3. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`).
20+
4. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder.
21+
22+
Install `pg` and `pg-native` them:
1023

1124
```sh
1225
$ npm install pg pg-native

0 commit comments

Comments
 (0)