org.postgresql.util.PSQLException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Try downgrading PostgresSQL server to 9.5 or update your PostgresSQL driver to 9.4-1211 with the following command: 9.4.1211

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Upgrading Confluence from 3.3 to 3.4.7 fails with: {code} 2011-01-25 07:49:55,914 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 21508 ms 2011-01-25 07:49:58,557 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table EXTRNLNKS add constraint FK97C10FE78DD41734 foreign key (CONTENTID) references CONTENT 2011-01-25 07:49:58,557 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute ERROR: insert or update on table "extrnlnks" violates foreign key constraint "fk97c10fe78dd41734" Detail: Key (contentid)=(1213498) is not present in table "content". 2011-01-25 07:49:58,559 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update org.postgresql.util.PSQLException: ERROR: insert or update on table "extrnlnks" violates foreign key constraint "fk97c10fe78dd41734" Detail: Key (contentid)=(1213498) is not present in table "content". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) {code} h2. Cause The {{extrnlnks}} table contains stray/outdated entries that reference content in the {{content}} table that does not exist anymore. h2. Workaround _The example queries were run against a PostgreSQL database, please adjust them for your particular DBMS_ # Ensure that you have a *backup of the database*! # Identify the stray link entries, (there should only be a few entires that point to non-existing content): {code} SELECT e.linkid, e.contentid, c.contentid, e.url FROM extrnlnks as e LEFT OUTER JOIN content as c ON e.contentid = c.contentid WHERE c.contentid IS NULL {code} # Delete the link stray entries {code} DELETE FROM extrnlnks WHERE linkid IN (SELECT e.linkid FROM extrnlnks as e LEFT OUTER JOIN content as c ON e.contentid = c.contentid WHERE c.contentid IS NULL) {code} # Restart Confluence to carry on with the upgrade.
    via by Stefan Saasen,
  • Upgrading Confluence from 3.3 to 3.4.7 fails with: {code} 2011-01-25 07:49:55,914 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 21508 ms 2011-01-25 07:49:58,557 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table EXTRNLNKS add constraint FK97C10FE78DD41734 foreign key (CONTENTID) references CONTENT 2011-01-25 07:49:58,557 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute ERROR: insert or update on table "extrnlnks" violates foreign key constraint "fk97c10fe78dd41734" Detail: Key (contentid)=(1213498) is not present in table "content". 2011-01-25 07:49:58,559 ERROR [main] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update org.postgresql.util.PSQLException: ERROR: insert or update on table "extrnlnks" violates foreign key constraint "fk97c10fe78dd41734" Detail: Key (contentid)=(1213498) is not present in table "content". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) {code} h2. Cause The {{extrnlnks}} table contains stray/outdated entries that reference content in the {{content}} table that does not exist anymore. h2. Workaround _The example queries were run against a PostgreSQL database, please adjust them for your particular DBMS_ # Ensure that you have a *backup of the database*! # Identify the stray link entries, (there should only be a few entires that point to non-existing content): {code} SELECT e.linkid, e.contentid, c.contentid, e.url FROM extrnlnks as e LEFT OUTER JOIN content as c ON e.contentid = c.contentid WHERE c.contentid IS NULL {code} # Delete the link stray entries {code} DELETE FROM extrnlnks WHERE linkid IN (SELECT e.linkid FROM extrnlnks as e LEFT OUTER JOIN content as c ON e.contentid = c.contentid WHERE c.contentid IS NULL) {code} # Restart Confluence to carry on with the upgrade.
    via by Stefan Saasen [Atlassian],
  • GitHub comment 47#95927784
    via GitHub by Argelein
    ,
  • install problem.
    via openbravo by charleswhj
    ,
    • org.postgresql.util.PSQLException: ERROR: insert or update on table "extrnlnks" violates foreign key constraint "fk97c10fe78dd41734" Detail: Key (contentid)=(1213498) is not present in table "content". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)

    Users with the same issue

    guizmaii
    26 times, last one,
    derprogger
    1 times, last one,
    Unknown User
    7 times, last one,
    jokester
    2 times, last one,
    Unknown visitor2 times, last one,
    89 more bugmates