Repository: GoogleCloudPlatform/pgadapter
Pull request #2787 (2025-01-20 02:46:52)

deps: update dependency coverlet.collector to 6.0.4
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverlet.collector](https://redirect.github.com/coverlet-coverage/coverlet) | `6.0.3` -> `6.0.4` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/coverlet.collector/6.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/coverlet.collector/6.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/coverlet.collector/6.0.3/6.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/coverlet.collector/6.0.3/6.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>coverlet-coverage/coverlet (coverlet.collector)</summary>

### [`v6.0.4`](https://redirect.github.com/coverlet-coverage/coverlet/releases/tag/v6.0.4)

##### Fixed

-   Fix empty coverage report when using include and exclude filters [#&#8203;1726](https://redirect.github.com/coverlet-coverage/coverlet/issues/1726)

[Diff between 6.0.3 and 6.0.4](https://redirect.github.com/coverlet-coverage/coverlet/compare/v6.0.3...v6.0.4)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/GoogleCloudPlatform/pgadapter).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoicG9zdGdyZXNxbC1kaWFsZWN0IiwibGFiZWxzIjpbXX0=-->



Patch:
diff --git a/benchmarks/tpcc/pom.xml b/benchmarks/tpcc/pom.xml
index 858066d2..71a81d1d 100644
--- a/benchmarks/tpcc/pom.xml
+++ b/benchmarks/tpcc/pom.xml
@@ -21,7 +21,7 @@
       <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>libraries-bom</artifactId>
-        <version>26.52.0</version>
+        <version>26.53.0</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
diff --git a/pom.xml b/pom.xml
index 2ebb6371..f7d7de91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -165,7 +165,7 @@
     <dependency>
       <groupId>org.postgresql</groupId>
       <artifactId>postgresql</artifactId>
-      <version>42.7.4</version>
+      <version>42.7.5</version>
     </dependency>
     <dependency>
       <groupId>com.kohlschutter.junixsocket</groupId>
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/JdbcMetadataStatementHelper.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/JdbcMetadataStatementHelper.java
index db846800..a4317a7e 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/JdbcMetadataStatementHelper.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/JdbcMetadataStatementHelper.java
@@ -45,10 +45,18 @@ class JdbcMetadataStatementHelper {
     // with Spangres-compatible queries.
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_EXPORTED_IMPORTED_KEYS_PREFIX)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_EXPORTED_IMPORTED_KEYS_42_0_PREFIX)) {
-      return replaceImportedExportedKeysQuery(sql);
+      return replaceImportedExportedKeysQuery(
+          sql, PgJdbcCatalog.PG_JDBC_EXPORTED_IMPORTED_KEYS_REPLACEMENT, "KEY_SEQ");
+    }
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_EXPORTED_IMPORTED_KEYS_PREFIX_V42_7_5)) {
+      return replaceImportedExportedKeysQuery(
+          sql, PgJdbcCatalog.PG_JDBC_EXPORTED_IMPORTED_KEYS_REPLACEMENT_UPPER_CASE, "\"KEY_SEQ\"");
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_SCHEMAS_PREFIX)) {
-      return replaceGetSchemasQuery(sql);
+      return replaceGetSchemasQuery(sql, PgJdbcCatalog.PG_JDBC_GET_SCHEMAS_REPLACEMENT);
+    }
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_SCHEMAS_PREFIX_V42_7_5)) {
+      return replaceGetSchemasQuery(sql, PgJdbcCatalog.PG_JDBC_GET_SCHEMAS_REPLACEMENT_UPPER_CASE);
     }
     if (sql.contains(LiquibaseStatementHelper.TAG_STATEMENT_PART)) {
       return LiquibaseStatementHelper.replaceTagStatement(sql);
@@ -65,10 +73,16 @@ class JdbcMetadataStatementHelper {
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_5)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_6)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_7)
-        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_8)) {
-      return replaceGetTablesQuery(sql);
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_8)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_9)) {
+      if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLES_PREFIX_9)) {
+        return replaceGetTablesQuery(sql, PgJdbcCatalog.PG_JDBC_GET_TABLES_REPLACEMENT_UPPER_CASE);
+      } else {
+        return replaceGetTablesQuery(sql, PgJdbcCatalog.PG_JDBC_GET_TABLES_REPLACEMENT);
+      }
     }
-    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_1)
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_V42_7_5)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_1)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_2)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_3)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_4)
@@ -78,22 +92,26 @@ class JdbcMetadataStatementHelper {
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMNS_PREFIX_4_1)) {
       return replaceGetColumnsQuery(sql);
     }
-    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_INDEXES_PREFIX_1)
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_INDEXES_PREFIX_V42_7_5)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_INDEXES_PREFIX_1)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_INDEXES_PREFIX_2)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_INDEXES_PREFIX_3)
         || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_INDEXES_PREFIX_1_1)) {
       return replaceGetIndexInfoQuery(sql);
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_PRIMARY_KEY_PREFIX_1)
-        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_PRIMARY_KEY_PREFIX_2)) {
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_PRIMARY_KEY_PREFIX_2)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_PRIMARY_KEY_PREFIX_V42_7_5)) {
       return replaceGetPrimaryKeyQuery(sql);
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLE_PRIVILEGES_PREFIX_1)
-        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLE_PRIVILEGES_PREFIX_2)) {
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLE_PRIVILEGES_PREFIX_2)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_TABLE_PRIVILEGES_PREFIX_3)) {
       return PgJdbcCatalog.PG_JDBC_GET_TABLE_PRIVILEGES_REPLACEMENT;
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_1)
-        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_1_1)) {
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_1_1)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_V42_7_5)) {
       return PgJdbcCatalog.PG_JDBC_GET_TABLE_PRIVILEGES_REPLACEMENT;
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_BEST_ROW_IDENTIFIER_PREFIX)) {
@@ -101,16 +119,22 @@ class JdbcMetadataStatementHelper {
     }
 
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTIONS_WITH_FUNC_TYPE_PREFIX)
-        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTIONS_WITHOUT_FUNC_TYPE_PREFIX)) {
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTIONS_WITHOUT_FUNC_TYPE_PREFIX)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTIONS_UPPER_CASE_PREFIX)) {
       return PgJdbcCatalog.PG_JDBC_GET_FUNCTIONS_REPLACEMENT;
     }
-    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTION_COLUMNS_PREFIX)) {
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTION_COLUMNS_PREFIX)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_FUNCTION_COLUMNS_PREFIX_V42_7_5)) {
       return PgJdbcCatalog.PG_JDBC_GET_FUNCTION_COLUMNS_REPLACEMENT;
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_PROCEDURES_PREFIX)) {
       return PgJdbcCatalog.PG_JDBC_GET_PROCEDURES_REPLACEMENT;
     }
-    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_UDTS_PREFIX)) {
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_PROCEDURES_PREFIX_V42_7_5)) {
+      return PgJdbcCatalog.PG_JDBC_GET_PROCEDURES_REPLACEMENT;
+    }
+    if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_UDTS_PREFIX)
+        || sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_UDTS_PREFIX_V42_7_5)) {
       return PgJdbcCatalog.PG_JDBC_GET_UDTS_REPLACEMENT;
     }
     if (sql.startsWith(PgJdbcCatalog.PG_JDBC_GET_MAX_NAME_LENGTH_PREFIX)) {
@@ -204,8 +228,7 @@ class JdbcMetadataStatementHelper {
     return replacedSql + whereClause + " ORDER BY ct.relname, pk_name, key_seq";
   }
 
-  private static String replaceGetSchemasQuery(String sql) {
-    String replacedSql = PgJdbcCatalog.PG_JDBC_GET_SCHEMAS_REPLACEMENT;
+  private static String replaceGetSchemasQuery(String sql, String replacedSql) {
     int startIndex;
     if (sql.contains(" AND nspname LIKE ")) {
       startIndex = sql.indexOf(" AND nspname LIKE ");
@@ -218,8 +241,7 @@ class JdbcMetadataStatementHelper {
         .replace(" ORDER BY TABLE_SCHEM", " ORDER BY schema_name");
   }
 
-  private static String replaceGetTablesQuery(String sql) {
-    String replacedSql = PgJdbcCatalog.PG_JDBC_GET_TABLES_REPLACEMENT;
+  private static String replaceGetTablesQuery(String sql, String replacedSql) {
     int startIndex;
     String wherePrefix = "WHERE c.relnamespace = n.oid";
     if (sql.contains(wherePrefix)) {
@@ -344,6 +366,9 @@ class JdbcMetadataStatementHelper {
         .replace(" AND n.nspname = ", " AND IDX.TABLE_SCHEMA = ")
         .replace(" AND ct.relname = ", " AND IDX.TABLE_NAME = ")
         .replace(" AND i.indisunique ", " AND IDX.IS_UNIQUE='YES' ")
+        .replace(
+            ") AS tmp ORDER BY \"NON_UNIQUE\", \"TYPE\", \"INDEX_NAME\", \"ORDINAL_POSITION\"",
+            " ORDER BY IDX.TABLE_NAME, IS_UNIQUE DESC, IDX.INDEX_NAME, CASE WHEN ORDINAL_POSITION IS NULL THEN 0 ELSE ORDINAL_POSITION END")
         .replace(
             ") AS tmp ORDER BY NON_UNIQUE, TYPE, INDEX_NAME, ORDINAL_POSITION",
             " ORDER BY IDX.TABLE_NAME, IS_UNIQUE DESC, IDX.INDEX_NAME, CASE WHEN ORDINAL_POSITION IS NULL THEN 0 ELSE ORDINAL_POSITION END")
@@ -364,6 +389,7 @@ class JdbcMetadataStatementHelper {
     replacedSql += " WHERE TRUE " + sql.substring(startIndex);
     return replacedSql
         .replace(") result where  result.A_ATTNUM = (result.KEYS).x", "")
+        .replace("AND result.KEY_SEQ <= KEY_COUNT", "")
         .replace(" AND n.nspname = ", " AND IDX.TABLE_SCHEMA = ")
         .replace(" AND ct.relname = ", " AND IDX.TABLE_NAME = ")
         .replace(" AND i.indisprimary ", " AND IDX.INDEX_TYPE='PRIMARY_KEY' ")
@@ -375,8 +401,8 @@ class JdbcMetadataStatementHelper {
             "ORDER BY COLS.TABLE_NAME, IDX.INDEX_NAME, COLS.ORDINAL_POSITION");
   }
 
-  private static String replaceImportedExportedKeysQuery(String sql) {
-    String replacedSql = PgJdbcCatalog.PG_JDBC_EXPORTED_IMPORTED_KEYS_REPLACEMENT;
+  private static String replaceImportedExportedKeysQuery(
+      String sql, String replacedSql, String keySeq) {
     int startIndex;
     if (sql.contains(" AND pkn.nspname = ")) {
       startIndex = sql.indexOf(" AND pkn.nspname = ");
@@ -397,9 +423,9 @@ class JdbcMetadataStatementHelper {
         .replace(" AND fkc.relname = ", " AND CHILD.TABLE_NAME = ")
         .replace(
             " ORDER BY fkn.nspname,fkc.relname,con.conname,pos.n",
-            " ORDER BY CHILD.TABLE_CATALOG, CHILD.TABLE_SCHEMA, CHILD.TABLE_NAME, KEY_SEQ")
+            " ORDER BY CHILD.TABLE_CATALOG, CHILD.TABLE_SCHEMA, CHILD.TABLE_NAME, " + keySeq)
         .replace(
             " ORDER BY pkn.nspname,pkc.relname, con.conname,pos.n",
-            " ORDER BY PARENT.TABLE_CATALOG, PARENT.TABLE_SCHEMA, PARENT.TABLE_NAME, KEY_SEQ");
+            " ORDER BY PARENT.TABLE_CATALOG, PARENT.TABLE_SCHEMA, PARENT.TABLE_NAME, " + keySeq);
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/utils/ClientAutoDetector.java b/src/main/java/com/google/cloud/spanner/pgadapter/utils/ClientAutoDetector.java
index d4d267fc..dea38054 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/utils/ClientAutoDetector.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/utils/ClientAutoDetector.java
@@ -46,7 +46,9 @@ import java.time.Duration;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.regex.Pattern;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -71,6 +73,11 @@ public class ClientAutoDetector {
   public static final String PGBENCH_USAGE_HINT =
       "See https://github.com/GoogleCloudPlatform/pgadapter/blob/-/docs/pgbench.md for how to use pgbench with PGAdapter";
 
+  /** Force the detector to return this client. This should only be used for testing. */
+  @VisibleForTesting
+  public static final AtomicReference<WellKnownClient> FORCE_DETECT_CLIENT =
+      new AtomicReference<>();
+
   public enum WellKnownClient {
     PSQL {
 
@@ -665,6 +672,9 @@ public class ClientAutoDetector {
   public static @Nonnull WellKnownClient detectClient(
       List<String> orderParameterKeys, Map<String, String> parameters) {
     for (WellKnownClient client : WellKnownClient.values()) {
+      if (Objects.equals(client, FORCE_DETECT_CLIENT.get())) {
+        return client;
+      }
       if (client.isClient(orderParameterKeys, parameters)) {
         return client;
       }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/utils/PgJdbcCatalog.java b/src/main/java/com/google/cloud/spanner/pgadapter/utils/PgJdbcCatalog.java
index b0881e52..50fa7972 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/utils/PgJdbcCatalog.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/utils/PgJdbcCatalog.java
@@ -75,6 +75,8 @@ public class PgJdbcCatalog {
           + "FROM pg_catalog.pg_proc p "
           + "INNER JOIN pg_catalog.pg_namespace n ON p.pronamespace=n.oid "
           + "LEFT JOIN pg_catalog.pg_description d ON p.oid=d.objoid ";
+  public static final String PG_JDBC_GET_FUNCTIONS_UPPER_CASE_PREFIX =
+      "SELECT current_database() AS \"FUNCTION_CAT\",  n.nspname AS \"FUNCTION_SCHEM\", p.proname AS \"FUNCTION_NAME\",  d.description AS \"REMARKS\",";
   public static final String PG_JDBC_GET_FUNCTIONS_REPLACEMENT =
       "select * from (\n"
           + "\tselect ''::varchar as FUNCTION_CAT, ''::varchar as FUNCTION_SCHEM, ''::varchar as FUNCTION_NAME, ''::varchar as REMARKS, 0::bigint as FUNCTION_TYPE, ''::varchar as SPECIFIC_NAME\n"
@@ -91,6 +93,8 @@ public class PgJdbcCatalog {
           + " LEFT JOIN pg_catalog.pg_class c ON (d.classoid=c.oid AND c.relname='pg_proc') "
           + " LEFT JOIN pg_catalog.pg_namespace pn ON (c.relnamespace=pn.oid AND pn.nspname='pg_catalog') "
           + " WHERE p.pronamespace=n.oid ";
+  public static final String PG_JDBC_GET_PROCEDURES_PREFIX_V42_7_5 =
+      "SELECT current_database() AS \"PROCEDURE_CAT\",  n.nspname AS \"PROCEDURE_SCHEM\", p.proname AS \"PROCEDURE_NAME\", NULL, NULL, NULL, d.description AS \"REMARKS\", 2 AS \"PROCEDURE_TYPE\",";
   public static final String PG_JDBC_GET_PROCEDURES_REPLACEMENT =
       "select * from (\n"
           + "\tselect ''::varchar as PROCEDURE_CAT, ''::varchar as PROCEDURE_SCHEM, ''::varchar as PROCEDURE_NAME, ''::varchar as REMARKS, 0::bigint as PROCEDURE_TYPE, ''::varchar as SPECIFIC_NAME\n"
@@ -106,6 +110,8 @@ public class PgJdbcCatalog {
           + java.sql.Types.DISTINCT
           + " end as data_type, pg_catalog.obj_description(t.oid, 'pg_type')  "
           + "as remarks, CASE WHEN t.typtype = 'd' then  (select CASE";
+  public static final String PG_JDBC_GET_UDTS_PREFIX_V42_7_5 =
+      "select current_database() as \"TYPE_CAT\", n.nspname as \"TYPE_SCHEM\", t.typname as \"TYPE_NAME\", null as \"CLASS_NAME\", ";
   public static final String PG_JDBC_GET_UDTS_REPLACEMENT =
       "select * from (\n"
           + "\tselect ''::varchar as TYPE_CAT, ''::varchar as TYPE_SCHEM, ''::varchar as TYPE_NAME, ''::varchar as CLASS_NAME, 0::bigint as DATA_TYPE, ''::varchar as REMARKS, 0::bigint as BASE_TYPE\n"
@@ -117,6 +123,9 @@ public class PgJdbcCatalog {
           + " p.proargnames, p.proargmodes, p.proallargtypes, p.oid "
           + " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_type t "
           + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid ";
+  public static final String PG_JDBC_GET_FUNCTION_COLUMNS_PREFIX_V42_7_5 =
+      "SELECT current_database(), n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid, "
+          + " p.proargnames, p.proargmodes, p.proallargtypes, p.oid ";
   public static final String PG_JDBC_GET_FUNCTION_COLUMNS_REPLACEMENT =
       "select * from (\n"
           + "\tselect ''::varchar as FUNCTION_CAT, ''::varchar as FUNCTION_SCHEM, ''::varchar as FUNCTION_NAME, ''::varchar as COLUMN_NAME, 0::bigint as COLUMN_TYPE,\n"
@@ -130,8 +139,15 @@ public class PgJdbcCatalog {
           + " WHERE nspname <> 'pg_toast' AND (nspname !~ '^pg_temp_' "
           + " OR nspname = (pg_catalog.current_schemas(true))[1]) AND (nspname !~ '^pg_toast_temp_' "
           + " OR nspname = replace((pg_catalog.current_schemas(true))[1], 'pg_temp_', 'pg_toast_temp_')) ";
+  public static final String PG_JDBC_GET_SCHEMAS_PREFIX_V42_7_5 =
+      "SELECT nspname AS \"TABLE_SCHEM\", current_database() AS \"TABLE_CATALOG\" FROM pg_catalog.pg_namespace "
+          + " WHERE nspname <> 'pg_toast' AND (nspname !~ '^pg_temp_' "
+          + " OR nspname = (pg_catalog.current_schemas(true))[1]) AND (nspname !~ '^pg_toast_temp_' "
+          + " OR nspname = replace((pg_catalog.current_schemas(true))[1], 'pg_temp_', 'pg_toast_temp_')) ";
   public static final String PG_JDBC_GET_SCHEMAS_REPLACEMENT =
       "select schema_name as TABLE_SCHEM, catalog_name AS TABLE_CATALOG from information_schema.schemata WHERE true ";
+  public static final String PG_JDBC_GET_SCHEMAS_REPLACEMENT_UPPER_CASE =
+      "select schema_name as \"TABLE_SCHEM\", catalog_name AS \"TABLE_CATALOG\" from information_schema.schemata WHERE true ";
 
   public static final String PG_JDBC_GET_TABLES_PREFIX_1 =
       "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME,  CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'  WHEN true THEN CASE  WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TABLE'   WHEN 'v' THEN 'SYSTEM VIEW'   WHEN 'i' THEN 'SYSTEM INDEX'   ELSE NULL   END  WHEN n.nspname = 'pg_toast' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TOAST TABLE'   WHEN 'i' THEN 'SYSTEM TOAST INDEX'   ELSE NULL   END  ELSE CASE c.relkind   WHEN 'r' THEN 'TEMPORARY TABLE'   WHEN 'p' THEN 'TEMPORARY TABLE'   WHEN 'i' THEN 'TEMPORARY INDEX'   WHEN 'S' THEN 'TEMPORARY SEQUENCE'   WHEN 'v' THEN 'TEMPORARY VIEW'   ELSE NULL   END  END  WHEN false THEN CASE c.relkind  WHEN 'r' THEN 'TABLE'  WHEN 'p' THEN 'PARTITIONED TABLE'  WHEN 'i' THEN 'INDEX'  WHEN 'P' then 'PARTITIONED INDEX'  WHEN 'S' THEN 'SEQUENCE'  WHEN 'v' THEN 'VIEW'  WHEN 'c' THEN 'TYPE'  WHEN 'f' THEN 'FOREIGN TABLE'  WHEN 'm' THEN 'MATERIALIZED VIEW'  ELSE NULL  END  ELSE NULL  END  AS TABLE_TYPE, d.description AS REMARKS,  '' as TYPE_CAT, '' as TYPE_SCHEM, '' as TYPE_NAME, '' AS SELF_REFERENCING_COL_NAME, '' AS REF_GENERATION  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c  LEFT JOIN (select * from (select 0 as objoid, 0 as classoid, 0 as objsubid, '' as description) pg_description where false) d ON (c.oid = d.objoid AND d.objsubid = 0  and d.classoid = 0)  WHERE c.relnamespace = n.oid";
@@ -149,14 +165,25 @@ public class PgJdbcCatalog {
       "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME,  CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'  WHEN true THEN CASE  WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TABLE'   WHEN 'v' THEN 'SYSTEM VIEW'   WHEN 'i' THEN 'SYSTEM INDEX'   ELSE NULL   END  WHEN n.nspname = 'pg_toast' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TOAST TABLE'   WHEN 'i' THEN 'SYSTEM TOAST INDEX'   ELSE NULL   END  ELSE CASE c.relkind   WHEN 'r' THEN 'TEMPORARY TABLE'   WHEN 'p' THEN 'TEMPORARY TABLE'   WHEN 'i' THEN 'TEMPORARY INDEX'   WHEN 'S' THEN 'TEMPORARY SEQUENCE'   WHEN 'v' THEN 'TEMPORARY VIEW'   ELSE NULL   END  END  WHEN false THEN CASE c.relkind  WHEN 'r' THEN 'TABLE'  WHEN 'p' THEN 'TABLE'  WHEN 'i' THEN 'INDEX'  WHEN 'S' THEN 'SEQUENCE'  WHEN 'v' THEN 'VIEW'  WHEN 'c' THEN 'TYPE'  WHEN 'f' THEN 'FOREIGN TABLE'  WHEN 'm' THEN 'MATERIALIZED VIEW'  ELSE NULL  END  ELSE NULL  END  AS TABLE_TYPE, d.description AS REMARKS  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c  LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0)  LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class')  LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog')  WHERE c.relnamespace = n.oid  ";
   public static final String PG_JDBC_GET_TABLES_PREFIX_8 =
       "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME,  CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'  WHEN true THEN CASE  WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TABLE'   WHEN 'v' THEN 'SYSTEM VIEW'   WHEN 'i' THEN 'SYSTEM INDEX'   ELSE NULL   END  WHEN n.nspname = 'pg_toast' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TOAST TABLE'   WHEN 'i' THEN 'SYSTEM TOAST INDEX'   ELSE NULL   END  ELSE CASE c.relkind   WHEN 'r' THEN 'TEMPORARY TABLE'   WHEN 'i' THEN 'TEMPORARY INDEX'   WHEN 'S' THEN 'TEMPORARY SEQUENCE'   WHEN 'v' THEN 'TEMPORARY VIEW'   ELSE NULL   END  END  WHEN false THEN CASE c.relkind  WHEN 'r' THEN 'TABLE'  WHEN 'i' THEN 'INDEX'  WHEN 'S' THEN 'SEQUENCE'  WHEN 'v' THEN 'VIEW'  WHEN 'c' THEN 'TYPE'  WHEN 'f' THEN 'FOREIGN TABLE'  WHEN 'm' THEN 'MATERIALIZED VIEW'  ELSE NULL  END  ELSE NULL  END  AS TABLE_TYPE, d.description AS REMARKS  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c  LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0)  LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class')  LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog')  WHERE c.relnamespace = n.oid  ";
+  public static final String PG_JDBC_GET_TABLES_PREFIX_9 =
+      "SELECT current_database() AS \"TABLE_CAT\", n.nspname AS \"TABLE_SCHEM\", c.relname AS \"TABLE_NAME\",  CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'  WHEN true THEN CASE  WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TABLE'   WHEN 'v' THEN 'SYSTEM VIEW'   WHEN 'i' THEN 'SYSTEM INDEX'   ELSE NULL   END  WHEN n.nspname = 'pg_toast' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TOAST TABLE'   WHEN 'i' THEN 'SYSTEM TOAST INDEX'   ELSE NULL   END  ELSE CASE c.relkind   WHEN 'r' THEN 'TEMPORARY TABLE'   WHEN 'p' THEN 'TEMPORARY TABLE'   WHEN 'i' THEN 'TEMPORARY INDEX'   WHEN 'S' THEN 'TEMPORARY SEQUENCE'   WHEN 'v' THEN 'TEMPORARY VIEW'   ELSE NULL   END  END  WHEN false THEN CASE c.relkind  WHEN 'r' THEN 'TABLE'  WHEN 'p' THEN 'PARTITIONED TABLE'  WHEN 'i' THEN 'INDEX'  WHEN 'P' then 'PARTITIONED INDEX'  WHEN 'S' THEN 'SEQUENCE'  WHEN 'v' THEN 'VIEW'  WHEN 'c' THEN 'TYPE'  WHEN 'f' THEN 'FOREIGN TABLE'  WHEN 'm' THEN 'MATERIALIZED VIEW'  ELSE NULL  END  ELSE NULL  END  AS \"TABLE_TYPE\", d.description AS \"REMARKS\",  '' as \"TYPE_CAT\", '' as \"TYPE_SCHEM\", '' as \"TYPE_NAME\", '' AS \"SELF_REFERENCING_COL_NAME\", '' AS \"REF_GENERATION\"";
   public static final String PG_JDBC_GET_TABLES_REPLACEMENT =
       "SELECT TABLE_CATALOG AS TABLE_CAT, TABLE_SCHEMA AS TABLE_SCHEM, TABLE_NAME AS TABLE_NAME,\n"
           + "       CASE WHEN TABLE_TYPE = 'BASE TABLE' THEN 'TABLE' ELSE TABLE_TYPE END AS TABLE_TYPE,\n"
           + "       NULL AS REMARKS, NULL AS TYPE_CAT, NULL AS TYPE_SCHEM, NULL AS TYPE_NAME,\n"
           + "       NULL AS SELF_REFERENCING_COL_NAME, NULL AS REF_GENERATION\n"
           + "FROM INFORMATION_SCHEMA.TABLES AS T\n";
+  public static final String PG_JDBC_GET_TABLES_REPLACEMENT_UPPER_CASE =
+      "SELECT TABLE_CATALOG AS \"TABLE_CAT\", TABLE_SCHEMA AS \"TABLE_SCHEM\", TABLE_NAME AS \"TABLE_NAME\",\n"
+          + "       CASE WHEN TABLE_TYPE = 'BASE TABLE' THEN 'TABLE' ELSE TABLE_TYPE END AS \"TABLE_TYPE\",\n"
+          + "       NULL AS \"REMARKS\", NULL AS \"TYPE_CAT\", NULL AS \"TYPE_SCHEM\", NULL AS \"TYPE_NAME\",\n"
+          + "       NULL AS \"SELF_REFERENCING_COL_NAME\", NULL AS \"REF_GENERATION\"\n"
+          + "FROM INFORMATION_SCHEMA.TABLES AS T\n";
 
-  // This prefix is used for versions [42.3.2, ...).
+  // This prefix is used for versions [42.7.5, ...).
+  public static final String PG_JDBC_GET_COLUMNS_PREFIX_V42_7_5 =
+      "SELECT * FROM (SELECT current_database(), n.nspname,c.relname,a.attname,a.atttypid,a.attnotnull  OR (t.typtype = 'd' AND t.typnotnull) AS attnotnull,a.atttypmod,a.attlen,t.typtypmod,row_number() OVER (PARTITION BY a.attrelid ORDER BY a.attnum) AS attnum, nullif(a.attidentity, '') as attidentity,nullif(a.attgenerated, '') as attgenerated,pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS adsrc,dsc.description,t.typbasetype,t.typtype  FROM pg_catalog.pg_namespace n  JOIN pg_catalog.pg_class c ON (c.relnamespace = n.oid)  JOIN pg_catalog.pg_attribute a ON (a.attrelid=c.oid)  JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid)  LEFT JOIN pg_catalog.pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum)  LEFT JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid)  LEFT JOIN pg_catalog.pg_class dc ON (dc.oid=dsc.classoid AND dc.relname='pg_class')  LEFT JOIN pg_catalog.pg_namespace dn ON (dc.relnamespace=dn.oid AND dn.nspname='pg_catalog')";
+  // This prefix is used for versions [42.3.2, 42.7.4].
   public static final String PG_JDBC_GET_COLUMNS_PREFIX_1 =
       "SELECT * FROM (SELECT n.nspname,c.relname,a.attname,a.atttypid,a.attnotnull OR (t.typtype = 'd' AND t.typnotnull) AS attnotnull,a.atttypmod,a.attlen,t.typtypmod,row_number() OVER (PARTITION BY a.attrelid ORDER BY a.attnum) AS attnum, nullif(a.attidentity, '') as attidentity,nullif(a.attgenerated, '') as attgenerated,pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS adsrc,dsc.description,t.typbasetype,t.typtype  FROM pg_catalog.pg_namespace n  JOIN pg_catalog.pg_class c ON (c.relnamespace = n.oid)  JOIN pg_catalog.pg_attribute a ON (a.attrelid=c.oid)  JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid)  LEFT JOIN pg_catalog.pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum)  LEFT JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid)  LEFT JOIN pg_catalog.pg_class dc ON (dc.oid=dsc.classoid AND dc.relname='pg_class')  LEFT JOIN pg_catalog.pg_namespace dn ON (dc.relnamespace=dn.oid AND dn.nspname='pg_catalog')";
   // This prefix is used for versions [42.2.9, 42.3.1].
@@ -211,7 +238,7 @@ public class PgJdbcCatalog {
       "SELECT n.nspname,c.relname,a.attname,a.atttypid,a.attnotnull OR (t.typtype = 'd' AND t.typnotnull) AS attnotnull,a.atttypmod,a.attlen,a.attnum,pg_catalog.pg_get_expr(def.adbin, def.adrelid) AS adsrc,dsc.description,t.typbasetype,t.typtype  FROM pg_catalog.pg_namespace n  JOIN pg_catalog.pg_class c ON (c.relnamespace = n.oid)  JOIN pg_catalog.pg_attribute a ON (a.attrelid=c.oid)  JOIN pg_catalog.pg_type t ON (a.atttypid = t.oid)  LEFT JOIN pg_catalog.pg_attrdef def ON (a.attrelid=def.adrelid AND a.attnum = def.adnum)  LEFT JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid)  LEFT JOIN pg_catalog.pg_class dc ON (dc.oid=dsc.classoid AND dc.relname='pg_class')  LEFT JOIN pg_catalog.pg_namespace dn ON (dc.relnamespace=dn.oid AND dn.nspname='pg_catalog')";
 
   public static final String PG_JDBC_GET_COLUMNS_REPLACEMENT =
-      "SELECT TABLE_CATALOG AS \"TABLE_CAT\", TABLE_SCHEMA AS nspname, TABLE_NAME AS relname, COLUMN_NAME AS attname, '' as typtype,\n"
+      "SELECT TABLE_CATALOG as current_database, TABLE_CATALOG AS \"TABLE_CAT\", TABLE_SCHEMA AS nspname, TABLE_NAME AS relname, COLUMN_NAME AS attname, '' as typtype,\n"
           + "       CASE\n"
           + "           WHEN SPANNER_TYPE = 'boolean' THEN 16\n"
           + "           WHEN SPANNER_TYPE = 'boolean[]' THEN 1000\n"
@@ -288,6 +315,28 @@ public class PgJdbcCatalog {
           + "        END AS \"IS_GENERATEDCOLUMN\"\n"
           + "FROM INFORMATION_SCHEMA.COLUMNS C\n";
 
+  public static final String PG_JDBC_GET_INDEXES_PREFIX_V42_7_5 =
+      "SELECT"
+          + "     tmp.TABLE_CAT AS \"TABLE_CAT\","
+          + "     tmp.TABLE_SCHEM AS \"TABLE_SCHEM\","
+          + "     tmp.TABLE_NAME AS \"TABLE_NAME\","
+          + "     tmp.NON_UNIQUE AS \"NON_UNIQUE\","
+          + "     tmp.INDEX_QUALIFIER AS \"INDEX_QUALIFIER\","
+          + "     tmp.INDEX_NAME AS \"INDEX_NAME\","
+          + "     tmp.TYPE AS \"TYPE\","
+          + "     tmp.ORDINAL_POSITION AS \"ORDINAL_POSITION\","
+          + "     trim(both '\"' from pg_catalog.pg_get_indexdef(tmp.CI_OID, tmp.ORDINAL_POSITION, false)) AS \"COLUMN_NAME\","
+          + "   CASE tmp.AM_NAME"
+          + "     WHEN 'btree' THEN CASE tmp.I_INDOPTION[tmp.ORDINAL_POSITION - 1] & 1::smallint"
+          + "       WHEN 1 THEN 'D'"
+          + "       ELSE 'A'"
+          + "     END"
+          + "     ELSE NULL"
+          + "   END AS \"ASC_OR_DESC\","
+          + "     tmp.CARDINALITY AS \"CARDINALITY\","
+          + "     tmp.PAGES AS \"PAGES\","
+          + "     tmp.FILTER_CONDITION AS \"FILTER_CONDITION\""
+          + "FROM (";
   public static final String PG_JDBC_GET_INDEXES_PREFIX_1 =
       "SELECT "
           + "    tmp.TABLE_CAT, "
@@ -386,6 +435,8 @@ public class PgJdbcCatalog {
           + "                AND IDX.TABLE_NAME=COL.TABLE_NAME\n"
           + "                AND IDX.INDEX_NAME=COL.INDEX_NAME\n";
 
+  public static final String PG_JDBC_GET_PRIMARY_KEY_PREFIX_V42_7_5 =
+      "SELECT        result.TABLE_CAT AS \"TABLE_CAT\",        result.TABLE_SCHEM AS \"TABLE_SCHEM\",        result.TABLE_NAME AS \"TABLE_NAME\",        result.COLUMN_NAME AS \"COLUMN_NAME\",        result.KEY_SEQ AS \"KEY_SEQ\",        result.PK_NAME AS \"PK_NAME\"";
   public static final String PG_JDBC_GET_PRIMARY_KEY_PREFIX_1 =
       "SELECT        result.TABLE_CAT,        result.TABLE_SCHEM,        result.TABLE_NAME,        result.COLUMN_NAME,        result.KEY_SEQ,        result.PK_NAME FROM      (SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM,   ct.relname AS TABLE_NAME, a.attname AS COLUMN_NAME,   (information_schema._pg_expandarray(i.indkey)).n AS KEY_SEQ, ci.relname AS PK_NAME,   information_schema._pg_expandarray(i.indkey) AS KEYS, a.attnum AS A_ATTNUM FROM pg_catalog.pg_class ct   JOIN pg_catalog.pg_attribute a ON (ct.oid = a.attrelid)   JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid)   JOIN pg_catalog.pg_index i ON ( a.attrelid = i.indrelid)   JOIN pg_catalog.pg_class ci ON (ci.oid = i.indexrelid)";
   public static final String PG_JDBC_GET_PRIMARY_KEY_PREFIX_2 =
@@ -404,12 +455,16 @@ public class PgJdbcCatalog {
       "SELECT n.nspname,c.relname,r.rolname,c.relacl  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r  WHERE c.relnamespace = n.oid  AND c.relowner = r.oid  AND c.relkind IN ('r','p'";
   public static final String PG_JDBC_GET_TABLE_PRIVILEGES_PREFIX_2 =
       "SELECT n.nspname,c.relname,r.rolname,c.relacl  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r  WHERE c.relnamespace = n.oid  AND c.relowner = r.oid  AND c.relkind = 'r'";
+  public static final String PG_JDBC_GET_TABLE_PRIVILEGES_PREFIX_3 =
+      "SELECT current_database(), n.nspname,c.relname,r.rolname,c.relacl  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r ";
   public static final String PG_JDBC_GET_TABLE_PRIVILEGES_REPLACEMENT =
-      "select '' as nspname, '' as relname, '' as rolname, '' as relacl from (select 1) t where false";
+      "select '' as current_database, '' as nspname, '' as relname, '' as rolname, '' as relacl from (select 1) t where false";
   public static final String PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_1 =
       "SELECT n.nspname,c.relname,r.rolname,c.relacl, a.attacl,  a.attname  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c,  pg_catalog.pg_roles r, pg_catalog.pg_attribute a  WHERE c.relnamespace = n.oid  AND c.relowner = r.oid  AND c.oid = a.attrelid  AND c.relkind = 'r'  AND a.attnum > 0 AND NOT a.attisdropped";
   public static final String PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_1_1 =
       "SELECT n.nspname,c.relname,r.rolname,c.relacl,  a.attname  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c,  pg_catalog.pg_roles r, pg_catalog.pg_attribute a  WHERE c.relnamespace = n.oid  AND c.relowner = r.oid  AND c.oid = a.attrelid  AND c.relkind = 'r'  AND a.attnum > 0 AND NOT a.attisdropped";
+  public static final String PG_JDBC_GET_COLUMN_PRIVILEGES_PREFIX_V42_7_5 =
+      "SELECT current_database(), n.nspname,c.relname,r.rolname,c.relacl, a.attacl,  a.attname  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c,  pg_catalog.pg_roles r, pg_catalog.pg_attribute a";
   public static final String PG_JDBC_GET_BEST_ROW_IDENTIFIER_REPLACEMENT =
       "select '' as attname, 0 as atttypid, -1 as atttypmod from (select 1) t where false";
 
@@ -562,6 +617,9 @@ public class PgJdbcCatalog {
           + " pg_catalog.pg_constraint con, "
           + " pg_catalog.generate_series(1, 32) pos(n), "
           + " pg_catalog.pg_class pkic";
+  public static final String PG_JDBC_EXPORTED_IMPORTED_KEYS_PREFIX_V42_7_5 =
+      "SELECT current_database() AS \"PKTABLE_CAT\", pkn.nspname AS \"PKTABLE_SCHEM\", pkc.relname AS \"PKTABLE_NAME\", pka.attname AS \"PKCOLUMN_NAME\", "
+          + "current_database() AS \"FKTABLE_CAT\", fkn.nspname AS \"FKTABLE_SCHEM\", fkc.relname AS \"FKTABLE_NAME\", fka.attname AS \"FKCOLUMN_NAME\", ";
   public static final String PG_JDBC_EXPORTED_IMPORTED_KEYS_REPLACEMENT =
       "SELECT PARENT.TABLE_CATALOG AS PKTABLE_CAT, PARENT.TABLE_SCHEMA AS PKTABLE_SCHEM, PARENT.TABLE_NAME AS PKTABLE_NAME,\n"
           + "       PARENT.COLUMN_NAME AS PKCOLUMN_NAME, CHILD.TABLE_CATALOG AS FKTABLE_CAT, CHILD.TABLE_SCHEMA AS FKTABLE_SCHEM,\n"
@@ -575,6 +633,19 @@ public class PgJdbcCatalog {
           + "INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CHILD  ON COALESCE(CONSTRAINTS.CONSTRAINT_CATALOG, '')=COALESCE(CHILD.CONSTRAINT_CATALOG, '') AND CONSTRAINTS.CONSTRAINT_SCHEMA= CHILD.CONSTRAINT_SCHEMA AND CONSTRAINTS.CONSTRAINT_NAME= CHILD.CONSTRAINT_NAME\n"
           + "INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE PARENT ON COALESCE(CONSTRAINTS.UNIQUE_CONSTRAINT_CATALOG, '')=COALESCE(PARENT.CONSTRAINT_CATALOG, '') AND CONSTRAINTS.UNIQUE_CONSTRAINT_SCHEMA=PARENT.CONSTRAINT_SCHEMA AND CONSTRAINTS.UNIQUE_CONSTRAINT_NAME=PARENT.CONSTRAINT_NAME AND PARENT.ORDINAL_POSITION=CHILD.POSITION_IN_UNIQUE_CONSTRAINT\n"
           + "WHERE TRUE\n";
+  public static final String PG_JDBC_EXPORTED_IMPORTED_KEYS_REPLACEMENT_UPPER_CASE =
+      "SELECT PARENT.TABLE_CATALOG AS \"PKTABLE_CAT\", PARENT.TABLE_SCHEMA AS \"PKTABLE_SCHEM\", PARENT.TABLE_NAME AS \"PKTABLE_NAME\",\n"
+          + "       PARENT.COLUMN_NAME AS \"PKCOLUMN_NAME\", CHILD.TABLE_CATALOG AS \"FKTABLE_CAT\", CHILD.TABLE_SCHEMA AS \"FKTABLE_SCHEM\",\n"
+          + "       CHILD.TABLE_NAME AS \"FKTABLE_NAME\", CHILD.COLUMN_NAME AS \"FKCOLUMN_NAME\",\n"
+          + "       CHILD.ORDINAL_POSITION AS \"KEY_SEQ\",\n"
+          + "       1 AS \"UPDATE_RULE\", -- 1 = importedKeyRestrict\n"
+          + "       1 AS \"DELETE_RULE\", -- 1 = importedKeyRestrict\n"
+          + "       CONSTRAINTS.CONSTRAINT_NAME AS \"FK_NAME\", CONSTRAINTS.UNIQUE_CONSTRAINT_NAME AS \"PK_NAME\",\n"
+          + "       7 AS \"DEFERRABILITY\" -- 7 = importedKeyNotDeferrable\n"
+          + "FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS CONSTRAINTS\n"
+          + "INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CHILD  ON COALESCE(CONSTRAINTS.CONSTRAINT_CATALOG, '')=COALESCE(CHILD.CONSTRAINT_CATALOG, '') AND CONSTRAINTS.CONSTRAINT_SCHEMA= CHILD.CONSTRAINT_SCHEMA AND CONSTRAINTS.CONSTRAINT_NAME= CHILD.CONSTRAINT_NAME\n"
+          + "INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE PARENT ON COALESCE(CONSTRAINTS.UNIQUE_CONSTRAINT_CATALOG, '')=COALESCE(PARENT.CONSTRAINT_CATALOG, '') AND CONSTRAINTS.UNIQUE_CONSTRAINT_SCHEMA=PARENT.CONSTRAINT_SCHEMA AND CONSTRAINTS.UNIQUE_CONSTRAINT_NAME=PARENT.CONSTRAINT_NAME AND PARENT.ORDINAL_POSITION=CHILD.POSITION_IN_UNIQUE_CONSTRAINT\n"
+          + "WHERE TRUE\n";
 
   public static final String PG_DESCRIPTION =
       "select * from (select 0 as objoid, 0 as classoid, 0 as objsubid, '' as description) pg_description where false";


Test patch:
diff --git a/samples/snippets/dotnet-snippets/sample-tests/sample-tests.csproj b/samples/snippets/dotnet-snippets/sample-tests/sample-tests.csproj
index 043240cf..0ecf1f63 100644
--- a/samples/snippets/dotnet-snippets/sample-tests/sample-tests.csproj
+++ b/samples/snippets/dotnet-snippets/sample-tests/sample-tests.csproj
@@ -11,7 +11,7 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="coverlet.collector" Version="6.0.3"/>
+        <PackageReference Include="coverlet.collector" Version="6.0.4"/>
         <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
         <PackageReference Include="NUnit" Version="4.3.2" />
         <PackageReference Include="NUnit.Analyzers" Version="4.6.0"/>
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java
index fd706cc3..d25d89d7 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java
@@ -1129,7 +1129,7 @@ public class AbortedMockServerTest extends AbstractMockServerTest {
       try (ResultSet resultSet =
           connection.createStatement().executeQuery("show application_name ")) {
         assertTrue(resultSet.next());
-        assertEquals(getExpectedInitialApplicationName(), resultSet.getString(1));
+        assertNull(resultSet.getString(1));
         assertFalse(resultSet.next());
       }
     }
@@ -1422,7 +1422,7 @@ public class AbortedMockServerTest extends AbstractMockServerTest {
 
       connection.createStatement().execute("reset all");
 
-      verifySettingValue(connection, "application_name", getExpectedInitialApplicationName());
+      verifySettingIsNull(connection, "application_name");
       verifySettingValue(connection, "search_path", "public");
     }
   }
@@ -1438,7 +1438,7 @@ public class AbortedMockServerTest extends AbstractMockServerTest {
       connection.createStatement().execute("set application_name to default");
       connection.createStatement().execute("set search_path to default");
 
-      verifySettingValue(connection, "application_name", getExpectedInitialApplicationName());
+      verifySettingIsNull(connection, "application_name");
       verifySettingValue(connection, "search_path", "public");
     }
   }
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPgbenchMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPgbenchMockServerTest.java
index 9e477b2d..925aef50 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPgbenchMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPgbenchMockServerTest.java
@@ -31,11 +31,11 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.SQLWarning;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
-import org.postgresql.PGProperty;
 import org.postgresql.util.PSQLException;
 import org.postgresql.util.PSQLWarning;
 
@@ -48,17 +48,23 @@ public class EmulatedPgbenchMockServerTest extends AbstractMockServerTest {
     Class.forName("org.postgresql.Driver");
   }
 
+  @BeforeClass
+  public static void setDetectClient() {
+    ClientAutoDetector.FORCE_DETECT_CLIENT.set(WellKnownClient.PGBENCH);
+  }
+
+  @AfterClass
+  public static void clearDetectClient() {
+    ClientAutoDetector.FORCE_DETECT_CLIENT.set(null);
+  }
+
   /**
    * Creates a JDBC connection string that instructs the PG JDBC driver to use the default simple
-   * mode. It also adds 'pgbench' as the application name, which will make PGAdapter automatically
-   * recognize the connection as a pgbench connection.
+   * mode.
    */
   private String createUrl() {
     return String.format(
-        "jdbc:postgresql://localhost:%d/db?preferQueryMode=simple&%s=pgbench&%s=090000",
-        pgServer.getLocalPort(),
-        PGProperty.APPLICATION_NAME.getName(),
-        PGProperty.ASSUME_MIN_SERVER_VERSION.getName());
+        "jdbc:postgresql://localhost:%d/db?preferQueryMode=simple", pgServer.getLocalPort());
   }
 
   @Test
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPsqlMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPsqlMockServerTest.java
index 5ec2f0c1..4b6d2c8a 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPsqlMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/EmulatedPsqlMockServerTest.java
@@ -26,6 +26,8 @@ import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
 import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.pgadapter.error.PGException;
 import com.google.cloud.spanner.pgadapter.statements.IntermediateStatement;
+import com.google.cloud.spanner.pgadapter.utils.ClientAutoDetector;
+import com.google.cloud.spanner.pgadapter.utils.ClientAutoDetector.WellKnownClient;
 import com.google.common.collect.ImmutableList;
 import com.google.protobuf.ListValue;
 import com.google.protobuf.Value;
@@ -57,12 +59,12 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
 import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
-import org.postgresql.PGProperty;
 import org.postgresql.util.PSQLException;
 
 @RunWith(JUnit4.class)
@@ -77,6 +79,16 @@ public class EmulatedPsqlMockServerTest extends AbstractMockServerTest {
     Class.forName("org.postgresql.Driver");
   }
 
+  @BeforeClass
+  public static void setDetectClient() {
+    ClientAutoDetector.FORCE_DETECT_CLIENT.set(WellKnownClient.PSQL);
+  }
+
+  @AfterClass
+  public static void clearDetectClient() {
+    ClientAutoDetector.FORCE_DETECT_CLIENT.set(null);
+  }
+
   @BeforeClass
   public static void startMockSpannerAndPgAdapterServers() throws Exception {
     // Start PGAdapter without a default database.
@@ -95,21 +107,12 @@ public class EmulatedPsqlMockServerTest extends AbstractMockServerTest {
   /**
    * Creates a JDBC connection string that instructs the PG JDBC driver to use the default simple
    * mode for queries and DML statements. This makes the JDBC driver behave in (much) the same way
-   * as psql. It also adds 'psql' as the application name, which will make PGAdapter automatically
-   * recognize the connection as a psql connection.
+   * as psql.
    */
   private String createUrl(String database) {
-    return createUrl(database, "psql");
-  }
-
-  private String createUrl(String database, String applicationName) {
     return String.format(
-        "jdbc:postgresql://localhost:%d/%s?preferQueryMode=simple&%s=%s&%s=090000",
-        pgServer.getLocalPort(),
-        database,
-        PGProperty.APPLICATION_NAME.getName(),
-        applicationName,
-        PGProperty.ASSUME_MIN_SERVER_VERSION.getName());
+        "jdbc:postgresql://localhost:%d/%s?preferQueryMode=simple",
+        pgServer.getLocalPort(), database);
   }
 
   @Test
@@ -201,22 +204,15 @@ public class EmulatedPsqlMockServerTest extends AbstractMockServerTest {
     }
   }
 
-  @Test
-  public void testShowApplicationName() throws SQLException {
-    try (Connection connection = DriverManager.getConnection(createUrl("my-db"))) {
-      try (ResultSet resultSet =
-          connection.createStatement().executeQuery("show application_name")) {
-        assertTrue(resultSet.next());
-        assertEquals("psql", resultSet.getString(1));
-        assertFalse(resultSet.next());
-      }
-    }
-  }
-
   @Test
   public void testConnectToNonExistingInstance() {
-    for (String appName : new String[] {"psql", "other-app"}) {
+    for (boolean isPsql : new boolean[] {true, false}) {
       try {
+        if (isPsql) {
+          setDetectClient();
+        } else {
+          clearDetectClient();
+        }
         mockSpanner.setExecuteStreamingSqlExecutionTime(
             SimulatedExecutionTime.ofStickyException(
                 newStatusResourceNotFoundException(
@@ -241,10 +237,9 @@ public class EmulatedPsqlMockServerTest extends AbstractMockServerTest {
         SQLException exception =
             assertThrows(
                 SQLException.class,
-                () -> DriverManager.getConnection(createUrl("non-existing-db", appName)));
+                () -> DriverManager.getConnection(createUrl("non-existing-db")));
         assertTrue(exception.getMessage(), exception.getMessage().contains("NOT_FOUND"));
 
-        boolean isPsql = "psql".equals(appName);
         assertEquals(
             exception.getMessage(),
             isPsql,
@@ -255,6 +250,7 @@ public class EmulatedPsqlMockServerTest extends AbstractMockServerTest {
             exception.getMessage().contains("\tprojects/p/instances/i\n"));
       } finally {
         closeSpannerPool(true);
+        setDetectClient();
       }
     }
   }
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/ITJdbcMetadataTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/ITJdbcMetadataTest.java
index daefa5a6..fa0ee6a2 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/ITJdbcMetadataTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/ITJdbcMetadataTest.java
@@ -53,13 +53,12 @@ import org.junit.runners.JUnit4;
 public class ITJdbcMetadataTest implements IntegrationTest {
   private static final String[] VERSIONS =
       new String[] {
-        "42.7.4", "42.7.3", "42.7.2", "42.7.1", "42.7.0", "42.6.0", "42.5.4", "42.5.3", "42.5.2",
-        "42.5.1", "42.5.0", "42.4.2", "42.4.1", "42.4.0", "42.3.6", "42.3.5", "42.3.4", "42.3.3",
-        "42.3.2", "42.3.1", "42.3.0", "42.2.25", "42.2.24", "42.2.23", "42.2.22", "42.2.21",
-        "42.2.20", "42.2.19", "42.2.18", "42.2.17", "42.2.16", "42.2.15", "42.2.14", "42.2.13",
-        "42.2.12", "42.2.11", "42.2.10", "42.2.9", "42.2.8", "42.2.7", "42.2.6", "42.2.5", "42.2.4",
-        "42.2.3", "42.2.2", "42.2.1", "42.2.0", "42.1.4",
-        /* "42.1.3", "42.1.2", "42.1.1", "42.1.0", "42.0.0" */
+        "42.7.5", "42.7.4", "42.7.3", "42.7.2", "42.7.1", "42.7.0", "42.6.0", "42.5.4", "42.5.3",
+        "42.5.2", "42.5.1", "42.5.0", "42.4.2", "42.4.1", "42.4.0", "42.3.6", "42.3.5", "42.3.4",
+        "42.3.3", "42.3.2", "42.3.1", "42.3.0", "42.2.25", "42.2.24", "42.2.23", "42.2.22",
+        "42.2.21", "42.2.20", "42.2.19", "42.2.18", "42.2.17", "42.2.16", "42.2.15", "42.2.14",
+        "42.2.13", "42.2.12", "42.2.11", "42.2.10", "42.2.9", "42.2.8", "42.2.7", "42.2.6",
+        "42.2.5", "42.2.4", "42.2.3", "42.2.2", "42.2.1", "42.2.0", "42.1.4"
       };
 
   private static final PgAdapterTestEnv testEnv = new PgAdapterTestEnv();
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java
index 89fd118d..d050fdec 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java
@@ -122,7 +122,9 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
   private static final Statement SELECT_RANDOM = Statement.of("select * from random_table");
   private static final ImmutableList<String> JDBC_STARTUP_STATEMENTS =
       ImmutableList.of(
-          "SET extra_float_digits = 3", "SET application_name = 'PostgreSQL JDBC Driver'");
+          "SET extra_float_digits = 2",
+          "SET extra_float_digits = 3",
+          "SET application_name = 'PostgreSQL JDBC Driver'");
 
   @Parameter public String pgVersion;
 
@@ -403,7 +405,7 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
   }
 
   private String getExpectedInitialApplicationName() {
-    return "PostgreSQL JDBC Driver";
+    return pgVersion.equals("1.0") ? "jdbc" : "PostgreSQL JDBC Driver";
   }
 
   @Test
@@ -522,7 +524,7 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
                     + "  /* Preferably, this should use information_schema.information_schema_catalog_name, but that does not exist on the emulator. */\n"
                     + "  from (select distinct catalog_name from information_schema.schemata) catalogs\n"
                     + ")\n"
-                    + "SELECT datname AS TABLE_CAT FROM pg_database WHERE datallowconn = true ORDER BY datname"),
+                    + "SELECT datname AS \"TABLE_CAT\" FROM pg_database WHERE datallowconn = true ORDER BY datname"),
             com.google.spanner.v1.ResultSet.newBuilder()
                 .setMetadata(
                     ResultSetMetadata.newBuilder()
@@ -3863,7 +3865,7 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
       try (ResultSet resultSet =
           connection.createStatement().executeQuery("show application_name ")) {
         assertTrue(resultSet.next());
-        assertEquals(getExpectedInitialApplicationName(), resultSet.getString(1));
+        assertNull(resultSet.getString(1));
         assertFalse(resultSet.next());
       }
     }
@@ -4162,7 +4164,7 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
 
       connection.createStatement().execute("reset all");
 
-      verifySettingValue(connection, "application_name", getExpectedInitialApplicationName());
+      verifySettingIsNull(connection, "application_name");
       verifySettingValue(connection, "search_path", "public");
       verifySettingValue(connection, "spanner.autocommit_dml_mode", "TRANSACTIONAL");
     }
@@ -4171,6 +4173,8 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
   @Test
   public void testSetToDefault() throws SQLException {
     try (Connection connection = DriverManager.getConnection(createUrl())) {
+      verifySettingValue(connection, "application_name", getExpectedInitialApplicationName());
+
       connection.createStatement().execute("set application_name to 'my-app'");
       connection.createStatement().execute("set search_path to 'my_schema'");
       verifySettingValue(connection, "application_name", "my-app");
@@ -4179,7 +4183,7 @@ public class JdbcMockServerTest extends AbstractMockServerTest {
       connection.createStatement().execute("set application_name to default");
       connection.createStatement().execute("set search_path to default");
 
-      verifySettingValue(connection, "application_name", getExpectedInitialApplicationName());
+      verifySettingIsNull(connection, "application_name");
       verifySettingValue(connection, "search_path", "public");
     }
   }
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/ruby/ActiveRecordMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/ruby/ActiveRecordMockServerTest.java
index a28362b6..b206ea23 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/ruby/ActiveRecordMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/ruby/ActiveRecordMockServerTest.java
@@ -25,6 +25,8 @@ import com.google.cloud.Date;
 import com.google.cloud.Timestamp;
 import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
 import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.pgadapter.utils.ClientAutoDetector;
+import com.google.cloud.spanner.pgadapter.utils.ClientAutoDetector.WellKnownClient;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.protobuf.ListValue;
@@ -200,6 +202,7 @@ public class ActiveRecordMockServerTest extends AbstractRubyMockServerTest {
   @Test
   public void testErrorHints() throws SQLException {
     // Emulate an ActiveRecord connection.
+    ClientAutoDetector.FORCE_DETECT_CLIENT.set(WellKnownClient.RAILS);
     String url =
         String.format(
             "jdbc:postgresql://localhost:%d/db?%s=rails&%s=090000",
@@ -250,6 +253,8 @@ public class ActiveRecordMockServerTest extends AbstractRubyMockServerTest {
           exception.getServerErrorMessage().getMessage(),
           "Table foo not found - Statement: 'SELECT * FROM foo'");
       assertNull(exception.getServerErrorMessage().getHint());
+    } finally {
+      ClientAutoDetector.FORCE_DETECT_CLIENT.set(null);
     }
   }
 
diff --git a/src/test/ruby/activerecord/config/database.yml b/src/test/ruby/activerecord/config/database.yml
index 64cf5297..901a6ac7 100644
--- a/src/test/ruby/activerecord/config/database.yml
+++ b/src/test/ruby/activerecord/config/database.yml
@@ -1,6 +1,8 @@
 development:
   adapter: postgresql
   pool: 5
+  # Schema dumping uses pg_catalog tables and functions that are not supported by Spanner.
+  schema_dump: false
   # Advisory locks are not supported by PGAdapter
   advisory_locks: false
   # These settings ensure that migrations and schema inspections work.
diff --git a/src/test/ruby/activerecord/db/schema.rb b/src/test/ruby/activerecord/db/schema.rb
deleted file mode 100644
index 6ca4a69b..00000000
--- a/src/test/ruby/activerecord/db/schema.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# This file is the source Rails uses to define your schema when running `bin/rails
-# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
-# be faster and is potentially less error prone than running all of your
-# migrations from scratch. Old migrations may fail to apply correctly if those
-# migrations use external dependencies or application code.
-#
-# It's strongly recommended that you check this file into your version control system.
-
-ActiveRecord::Schema[7.0].define(version: 1) do
-  create_table "albums", primary_key: "album_id", id: { type: :string, limit: 36 }, comment: "", force: :cascade do |t|
-    t.string "title"
-    t.decimal "marketing_budget"
-    t.date "release_date"
-    t.binary "cover_picture"
-    t.string "singer_id", limit: 36
-    t.datetime "created_at", precision: nil
-    t.datetime "updated_at", precision: nil
-    t.bigint "lock_version", null: false
-    t.index [], name: "IDX_albums_singer_id_N_90CD66D06B92DBCF"
-  end
-
-  create_table "concerts", primary_key: "concert_id", id: { type: :string, limit: 36 }, comment: "", force: :cascade do |t|
-    t.string "venue_id", limit: 36
-    t.string "singer_id", limit: 36
-    t.string "name"
-    t.datetime "start_time", precision: nil, null: false
-    t.datetime "end_time", precision: nil, null: false
-    t.datetime "created_at", precision: nil
-    t.datetime "updated_at", precision: nil
-    t.bigint "lock_version", null: false
-    t.index [], name: "IDX_concerts_singer_id_N_E92CCCE963BE681C"
-    t.index [], name: "IDX_concerts_venue_id_N_F08F98ABB662E6D5"
-    t.check_constraint nil, name: "chk_end_time_after_start_time"
-  end
-
-  create_table "singers", primary_key: "singer_id", id: { type: :string, limit: 36 }, comment: "", force: :cascade do |t|
-    t.string "first_name", limit: 100
-    t.string "last_name", limit: 200, null: false
-    t.virtual "full_name", type: :string, as: "COALESCE(concat(first_name, ' '::character varying, last_name), last_name)", stored: true
-    t.boolean "active"
-    t.datetime "created_at", precision: nil
-    t.datetime "updated_at", precision: nil
-    t.bigint "lock_version", null: false
-  end
-
-  create_table "tracks", primary_key: ["album_id", "track_number"], comment: "", force: :cascade do |t|
-    t.string "album_id", limit: 36, null: false
-    t.bigint "track_number", null: false
-    t.string "title", null: false
-    t.float "sample_rate", null: false
-    t.datetime "created_at", precision: nil
-    t.datetime "updated_at", precision: nil
-    t.bigint "lock_version", null: false
-  end
-
-  create_table "venues", primary_key: "venue_id", id: { type: :string, limit: 36 }, comment: "", force: :cascade do |t|
-    t.string "name"
-    t.jsonb "description"
-    t.datetime "created_at", precision: nil
-    t.datetime "updated_at", precision: nil
-    t.bigint "lock_version", null: false
-  end
-
-  add_foreign_key "albums", "singers", primary_key: "singer_id"
-  add_foreign_key "concerts", "singers", primary_key: "singer_id"
-  add_foreign_key "concerts", "venues", primary_key: "venue_id"
-end