Hello Eric, Thanks for the feedback. That is a very interesting corner-case! Most databases prevent multiple identical foreign keys from being defined. I wasn't aware of postgres allowing this. I have created #1270 to fix this in future versions of jOOQ: https://sourceforge.net/apps/trac/jooq/ticket/1270
Maybe, jOOQ-codegen should emit a warning in these cases. Just as in your case, I don't think this is done on purpose... Cheers Lukas 2012/4/5 ericjs <[email protected]>: > I'm working around this for now by limiting what tables it generates > code for to just what I need at the moment. > > This is with Postgres. (The server version is 8.4, the jdbc driver is > postgresql-9.0-801.jdbc4) > > There are a good half dozen tables with FK constraints to this table's > PK. Actually, looking at one of these tables I see it has TWO > identical (except for name) FK constraints to this table. I expect > this is a mistake (it's not my schema). Could this be causing it? > > Actually I can answer my own question. I just tried dropping one of > the redundant constraints, recompiled, and sure enough the problem > went away. Thanks for the clue to look at dependent FKs! (Note to > anyone who runs into this in the future with PostgreSQL: PgAdmin can > generate a Dependents Report for a table which made finding this > redundant FK very easy.) > > Eric
