[#7628] Add support for PostgreSQL 11 - Added SQLDialect

This commit is contained in:
lukaseder 2018-07-05 17:38:46 +02:00
parent 17389bc57c
commit a6a9dd271a
6 changed files with 18 additions and 1 deletions

View File

@ -122,6 +122,7 @@ public class Databases {
case POSTGRES_9_4:
case POSTGRES_9_5:
case POSTGRES_10:
case POSTGRES_11:
case POSTGRES: result = PostgresDatabase.class; break;
case SQLITE: result = SQLiteDatabase.class; break;

View File

@ -178,6 +178,15 @@ public enum SQLDialect {
*/
POSTGRES_10("Postgres", false, POSTGRES, POSTGRES_9_5),
/**
* The PostgreSQL 11 dialect.
* <p>
* While this family (and its dialects) have been observed to work to some
* extent on Amazon RedShift as well, we strongly suggest you use the
* official {@link #REDSHIFT} support, instead.
*/
POSTGRES_11("Postgres", false, POSTGRES, POSTGRES_10),
/**
* The SQLite dialect family.
*/

View File

@ -418,6 +418,7 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
case POSTGRES_9_5:
case POSTGRES_10:
case POSTGRES_11:
case POSTGRES: {
toSQLInsert(ctx);
ctx.formatSeparator()

View File

@ -321,6 +321,7 @@ final class Limit extends AbstractQueryPart {
case POSTGRES_9_4:
case POSTGRES_9_5:
case POSTGRES_10:
case POSTGRES_11:
// No break
// A default implementation is necessary for hashCode() and toString()

View File

@ -633,7 +633,8 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
case POSTGRES_9_3:
case POSTGRES_9_4:
case POSTGRES_9_5:
case POSTGRES_10: {
case POSTGRES_10:
case POSTGRES_11: {
if (getLimit().isApplicable() && getLimit().withTies())
toSQLReferenceLimitWithWindowFunctions(context);
else

View File

@ -63,6 +63,7 @@ import static org.jooq.SQLDialect.MYSQL_8_0;
// ...
import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.SQLDialect.POSTGRES_10;
import static org.jooq.SQLDialect.POSTGRES_11;
import static org.jooq.SQLDialect.POSTGRES_9_3;
import static org.jooq.SQLDialect.POSTGRES_9_4;
import static org.jooq.SQLDialect.POSTGRES_9_5;
@ -238,6 +239,9 @@ public class JDBCUtils {
if (majorVersion >= 10)
return POSTGRES_10;
if (majorVersion >= 11)
return POSTGRES_11;
return POSTGRES;
}