Skip to content

client.on('notice', ...) doesn't work with native binding #752

Open
@sasha-alias

Description

@sasha-alias

client.on('notice', ...) doesn't work with native bindings

pg = require('pg').native;

client = new pg.Client(...);

client.on('notice', function(msg) {
  console.log("custom notice: " + msg);
});

client.connect(function(err){

    if (err){
        console.log(err);
    }

    q = "do $$begin raise notice 'my message'; end;$$";
    client.query(q, function(err, result){
        if (err){
            console.log(err);
        }
    });
});

Expected output the same as with javascript bindings:

custom notice: notice: my message

Got:

NOTICE:  my message

Versions:

$ node --version
v0.12.0
$ npm list pg-native
└── pg-native@1.8.0
$ npm list pg
└── pg@4.3.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions