Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to run a function from sequelize.js against my postgres database. The function works fine when I run it through RazorSQL (database IDE), but it throws an error when running it from sequelize.js on a node server.

I tried it for both functions with and without parameters.

CoffeeScript on Node Server

query = "SELECT * FROM order.base_orders(); "

sequelize.query(query, null, {raw: true}).success (rows) =>
  deferred.resolve rows
.error (error) =>
  deferred.reject error

It returns the following error.

{
"error": {
    "name": "error",
    "length": 216,
    "severity": "ERROR",
    "code": "42883",
    "hint": "No function matches the given name and argument types. You might need to add explicit type casts.",
    "position": "15",
    "file": "parse_func.c",
    "line": "306",
    "routine": "ParseFuncOrColumn",
    "sql": "SELECT * FROM order.base_orders(); "
}

}

share|improve this question

1 Answer 1

What the error says: you need to cast your data, e.g. select foo((?)::int), or make sure you're calling it with the correct number of arguments -- or make sure it exists, for that matter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.