Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem when upsert using with pg@7.0 #8026

Closed
kukoo1 opened this issue Jul 28, 2017 · 2 comments
Closed

problem when upsert using with pg@7.0 #8026

kukoo1 opened this issue Jul 28, 2017 · 2 comments

Comments

@kukoo1
Copy link

kukoo1 commented Jul 28, 2017

What you are doing?

try {
 await NewsSubscriber.insertOrUpdate(data);
} catch (e) {
 console.log(e);
}

What do you expect to happen?

Not been caught by try-catch block.

What is actually happening?

Data was inserted into db successfully.
But it's caught by try-catch and console.log output this
TypeError: Cannot read property '0' of undefined at query.catch.then.then.queryResult (C:\Website\node_modules\sequelize\lib\dialects\postgres\query.js:112:17) at tryCatcher (C:\Website\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Website\node_modules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (C:\Website\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromise0 (C:\Website\node_modules\bluebird\js\release\promise.js:614:10) at Promise._settlePromises (C:\Website\node_modules\bluebird\js\release\promise.js:693:18) at Async._drainQueue (C:\Website\node_modules\bluebird\js\release\async.js:133:16) at Async._drainQueues (C:\Website\node_modules\bluebird\js\release\async.js:143:10) at Immediate.Async.drainQueues (C:\Website\node_modules\bluebird\js\release\async.js:17:14) at runCallback (timers.js:800:20) at tryOnImmediate (timers.js:762:5) at processImmediate [as _immediateCallback] (timers.js:733:5)

Dialect: postgres
Database version: pg@7.0.2
Sequelize version: 4.4.2

It used to work as expected on pg@6.4.1.

@alitaheri
Copy link
Contributor

This is the reason: #7998

Please downgrade for now until we find a solution for this.

@kukoo1
Copy link
Author

kukoo1 commented Jul 28, 2017

Thanks, alitaheri
look forward to the fix

@kukoo1 kukoo1 closed this as completed Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants