Subject: [pgjdbc/pgjdbc] issue #3522: Error when bumping org.postgresql:postgresql from 42.7.4 -> 42.7.5

From: "kevinm416 (@kevinm416)" <[email-masked]>
Date: Tue, 11 Feb 2025 23:39:47 +0000

Bumping `org.postgresql:postgresql` from 42.7.4 -> 42.7.5 causes this error for me, while I keep the `jooq` dependency constant. I'm not sure what's going on here, or what `key_seq` is.

```
17:35:40 SEVERE Error while generating table public.app_user
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Field (key_seq) is not contained in Row (
  "PKTABLE_CAT",
  "pg_namespace"."PKTABLE_SCHEM",
  "pg_class"."PKTABLE_NAME",
  "pg_attribute"."PKCOLUMN_NAME",
  "FKTABLE_CAT",
  "pg_namespace"."FKTABLE_SCHEM",
  "pg_class"."FKTABLE_NAME",
  "pg_attribute"."FKCOLUMN_NAME",
  "KEY_SEQ",
  "UPDATE_RULE",
  "DELETE_RULE",
  "pg_constraint"."FK_NAME",
  "pg_class"."PK_NAME",
  "DEFERRABILITY"
)
        at org.jooq.meta.AbstractDatabase.onError(AbstractDatabase.java:3806)
        at org.jooq.meta.AbstractDatabase.getRelations(AbstractDatabase.java:2801)
        at org.jooq.meta.DefaultColumnDefinition.getPrimaryKey(DefaultColumnDefinition.java:154)
        at org.jooq.meta.AbstractTableDefinition.getPrimaryKey(AbstractTableDefinition.java:108)
        at org.jooq.codegen.JavaGenerator.generateTable(JavaGenerator.java:6006)
        at org.jooq.codegen.JavaGenerator.generateTables(JavaGenerator.java:5985)
        at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:654)
        at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:609)
        at org.jooq.codegen.JavaGenerator.generate0(JavaGenerator.java:521)
        at org.jooq.codegen.AbstractGenerator.generate(AbstractGenerator.java:191)
        at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:222)
        at org.jooq.codegen.GenerationTool.run0(GenerationTool.java:957)
        at org.jooq.codegen.GenerationTool.run(GenerationTool.java:240)
        at org.jooq.codegen.GenerationTool.generate(GenerationTool.java:235)
        at org.jooq.codegen.GenerationTool.main(GenerationTool.java:207)
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Field (key_seq) is not contained in Row (
  "PKTABLE_CAT",
  "pg_namespace"."PKTABLE_SCHEM",
  "pg_class"."PKTABLE_NAME",
  "pg_attribute"."PKCOLUMN_NAME",
  "FKTABLE_CAT",
  "pg_namespace"."FKTABLE_SCHEM",
  "pg_class"."FKTABLE_NAME",
  "pg_attribute"."FKCOLUMN_NAME",
  "KEY_SEQ",
  "UPDATE_RULE",
  "DELETE_RULE",
  "pg_constraint"."FK_NAME",
  "pg_class"."PK_NAME",
  "DEFERRABILITY"
)
```

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 12 Feb 2025 11:07:16 +0000

I suggest you post this on jooq . I don't have enough information here to help you

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 12 Feb 2025 11:16:28 +0000

It seems to be related to https://github.com/pgjdbc/pgjdbc/pull/3386/files#diff-0571f8ac3385a7f7bb34e5c77f8afd24810311506989379c2e85c6c16eea6ce4R2420

I guess it has been resolved under https://github.com/jOOQ/jOOQ/issues/17873

I do not think we could improve anything here.