Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: brianc/node-postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.3
Choose a base ref
...
head repository: brianc/node-postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.4
Choose a head ref
  • 5 commits
  • 2 files changed
  • 4 contributors

Commits on Jul 26, 2016

  1. Copy the full SHA
    74db8f9 View commit details

Commits on Aug 1, 2016

  1. Small spelling fix (#1099)

    Vince Coppola authored and brianc committed Aug 1, 2016
    Copy the full SHA
    4e77464 View commit details

Commits on Aug 2, 2016

  1. Copy the full SHA
    9f955c4 View commit details

Commits on Aug 10, 2016

  1. pgpass: Upgrade to 1.x (#1098)

    pgpass is using semver versioning now, thus a dependency on
    version 1.x should be safe.
    hoegaarden authored and brianc committed Aug 10, 2016
    Copy the full SHA
    f857bbf View commit details
  2. Bump version

    brianc committed Aug 10, 2016
    Copy the full SHA
    a95d9ac View commit details
Showing with 16 additions and 4 deletions.
  1. +14 −2 README.md
  2. +2 −2 package.json
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

[![Build Status](https://secure.travis-ci.org/brianc/node-postgres.svg?branch=master)](http://travis-ci.org/brianc/node-postgres)
[![Dependency Status](https://david-dm.org/brianc/node-postgres.svg)](https://david-dm.org/brianc/node-postgres)
<span class="badge-npmversion"><a href="https://npmjs.org/package/pg" title="View this project on NPM"><img src="https://img.shields.io/npm/v/pg.svg" alt="NPM version" /></a></span>
<span class="badge-npmdownloads"><a href="https://npmjs.org/package/pg" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/pg.svg" alt="NPM downloads" /></a></span>

Non-blocking PostgreSQL client for node.js. Pure JavaScript and optional native libpq bindings.

@@ -20,7 +22,7 @@ var pg = require('pg');

// instantiate a new client
// the client will read connection information from
// the same environment varaibles used by postgres cli tools
// the same environment variables used by postgres cli tools
var client = new pg.Client();

// connect to our database
@@ -137,7 +139,17 @@ var Pool = pg.Pool // good! a pool bound to the native client
var Client = pg.Client // good! this client uses libpq bindings
```

node-postgres abstracts over the pg-native module to provide exactly the same interface as the pure JavaScript version. Care has been taken to keep the number of api differences between the two modules to a minimum; however, it is recommended you use either the pure JavaScript or native bindings in both development and production and don't mix & match them in the same process - it can get confusing!
#### API differences

node-postgres abstracts over the pg-native module to provide the same interface as the pure JavaScript version. Care has been taken to keep the number of api differences between the two modules to a minimum.
However, currently some differences remain, especially :
* the error object in pg-native is different : notably, the information about the postgres error code is not present in field `code` but in the field `sqlState` , and the name of a few other fields is different (see https://github.com/brianc/node-postgres/issues/938, https://github.com/brianc/node-postgres/issues/972).
So for example, if you rely on error.code in your application, your will have to adapt your code to work with native bindings.
* the notification object has a few less properties (see https://github.com/brianc/node-postgres/issues/1045)
* column objects have less properties (see https://github.com/brianc/node-postgres/issues/988)
* the modules https://github.com/brianc/node-pg-copy-streams and https://github.com/brianc/node-pg-query-stream do not work with native bindings (you will have to require 'pg' to use them).

Thus, it is recommended you use either the pure JavaScript or native bindings in both development and production and don't mix & match them in the same process - it can get confusing!

## Features

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pg",
"version": "6.0.3",
"version": "6.0.4",
"description": "PostgreSQL client - pure javascript & libpq with the same API",
"keywords": [
"postgres",
@@ -23,7 +23,7 @@
"pg-connection-string": "0.1.3",
"pg-pool": "1.*",
"pg-types": "1.*",
"pgpass": "0.0.6",
"pgpass": "1.x",
"semver": "4.3.2"
},
"devDependencies": {