Skip to content

NOTIFY query - syntax error at or near "$1" #1258

Closed
@DrLou

Description

@DrLou

What is the syntax error in this query?
Have tried a variety of quoting options - (have escaped the comma, thinking this was the problem?)

One of you will look at this and say 'ah ha!'

pool.connect(function(err, client, done) {
if(err) {
  // return console.error('error fetching client from pool', err);
  return console.error(err);
  }
  // PostgreSQL NOTIFY
  client.query("NOTIFY bottle\, $1", ["hope you get this message"], function(err, result) {
    done(err);
    
    if(err) {
      return console.error('error running query', err);
    }
    console.log('Successful NOTIFY');
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions