From d709d1ef47236872232c285ff944d34e03d072d2 Mon Sep 17 00:00:00 2001 From: georgik Date: Fri, 29 Mar 2013 04:36:48 -0700 Subject: [PATCH] Added info about installation on Windows. --- FAQ.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index 68b9ecd..70044e6 100644 --- a/FAQ.md +++ b/FAQ.md @@ -161,4 +161,16 @@ Personally, I like the pure JavaScript bindings because it's JavaScript all the ### 13. What happens to open transactions when `pg.connect`'s `done` is called? -Nothing. You are responsible for calling either `client.query('COMMIT')` or `client.query('ROLLBACK')` If you call neither and call the `done()` callback the client will be returned to the pool with an open transaction, and I assume _bad things will happen_ in your application. \ No newline at end of file +Nothing. You are responsible for calling either `client.query('COMMIT')` or `client.query('ROLLBACK')` If you call neither and call the `done()` callback the client will be returned to the pool with an open transaction, and I assume _bad things will happen_ in your application. + +### 14. How to install pg on Windows? + +Problem: `npm install pg` fails with error message `Call to 'pg_config --libdir' returned exit status 1. while trying to load binding.gyp` + +You need PosgreSQL installed on your system. Path to PostgreSQL bin directory must be included in environment PATH variable. `pg_config` is stored in that bin directory. + +Quick fix for PowerShell: + +`$env:PATH+=";C:\Program Files\PostgreSQL\9.2\bin"` + +`npm install pg` \ No newline at end of file