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

[bug][pgsql] truncating table via Model.destroy fails #4306

machinshin opened this Issue Aug 12, 2015 · 1 comment


2 participants

machinshin commented Aug 12, 2015

Model.destroy({truncate: true});

fails to work, i get the error:

Unhandled rejection SequelizeDatabaseError: relation "public.model_table" does not exist

I dug through the sequelize code to this line:
for some reason quoting the table name for truncate fails to work, when i change my local code from:
query = 'TRUNCATE ' + QueryGenerator.quoteIdentifier(tableName);
``query = 'TRUNCATE ' + tableName;`
works fine.

I can work on filing a PR if that would be received?

P.S. names obviously changed to protect the innocent.


This comment has been minimized.


janmeier commented Aug 12, 2015

Hmm, no idea why we call quoteTable, then remove the ticks again....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment