HHH-14446 Fix PostgreSQL create extension syntax

This commit is contained in:
Karel Maesen 2021-02-11 17:40:16 +01:00 committed by Christian Beikov
parent 031f12a1ec
commit a467641584
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ public class PostgreSQLDatabaseCleaner implements DatabaseCleaner {
Map<String, List<String>> schemaExtensions = new HashMap<>();
try (Statement s2 = c.createStatement()) {
rs = s2.executeQuery(
"SELECT ns.nspname, 'CREATE EXTENSION ' || e.extname || ' SCHEMA \"' || ns.nspname || '\" VERSION ' || e.extversion FROM pg_extension e JOIN pg_catalog.pg_namespace ns ON e.extnamespace = ns.oid WHERE e.extname <> 'plpgsql'"
"SELECT ns.nspname, 'CREATE EXTENSION ' || e.extname || ' SCHEMA \"' || ns.nspname || '\"' FROM pg_extension e JOIN pg_catalog.pg_namespace ns ON e.extnamespace = ns.oid WHERE e.extname <> 'plpgsql'"
);
while ( rs.next() ) {
schemaExtensions.computeIfAbsent( rs.getString( 1 ), k -> new ArrayList<>() )