不要怂,就是干,撸起袖子干!

Commit 6efc2ad2 by Jiepei Min Committed by Sushant

fix error when connect to Postgres 8.2.0(fix #5254) (#7266)

* fix error when connect to Postgres 8.2.0

* Update sequelize.md

* separating version check for clean code

* changelog: properly state oids for postgres
1 parent 75841f3e
......@@ -49,6 +49,7 @@
- [INTERNAL] Updated to `generic-pool@3.1.6` [#7109](https://github.com/sequelize/sequelize/issues/7109)
- [FIXED] findAll throws error if attributes option is formatted incorrectly [#7162](https://github.com/sequelize/sequelize/issues/7163)
- [FIXED] previous gave wrong value back [#7189](https://github.com/sequelize/sequelize/pull/7189)
- [FIXED] Connection error when fetching OIDs for unspported types in Postgres 8.2 or below [POSTGRES] [#5254](https://github.com/sequelize/sequelize/issues/5254)
## BC breaks:
- `DATEONLY` now returns string in `YYYY-MM-DD` format rather than `Date` type
......
......@@ -75,7 +75,6 @@ var sequelize = new Sequelize('mysql://localhost:3306/database', {})
| [options.typeValidation=false] | Boolean | Run built in type validators on insert and update, e.g. validate that arguments passed to integer fields are integer-like. |
| [options.benchmark=false] | Boolean | Print query execution time in milliseconds when logging SQL. |
***
<a name="sequelize"></a>
......
......@@ -145,7 +145,8 @@ class ConnectionManager extends AbstractConnectionManager {
}
// oids for hstore and geometry are dynamic - so select them at connection time
if (dataTypes.HSTORE.types.postgres.oids.length === 0) {
const supportedVersion = this.sequelize.options.databaseVersion !== 0 && semver.gte(this.sequelize.options.databaseVersion, '8.3.0');
if (dataTypes.HSTORE.types.postgres.oids.length === 0 && supportedVersion) {
query += 'SELECT typname, oid, typarray FROM pg_type WHERE typtype = \'b\' AND typname IN (\'hstore\', \'geometry\', \'geography\')';
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!