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".

Atlassian JIRA | Stefan Saasen [Atlassian] | 6 years ago
  1. 0

    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.

    Atlassian JIRA | 6 years ago | Stefan Saasen
    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".
  2. 0

    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.

    Atlassian JIRA | 6 years ago | Stefan Saasen [Atlassian]
    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".
  3. 0

    Unable to migrate a structure using bundles

    GitHub | 3 years ago | wezell
    org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "idx_field_velocity_structure"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [Hive]I got "ArrayIndexOutOfBoundsException" while I query the hive database

    Stack Overflow | 3 years ago | CK Chang
    org.postgresql.util.PSQLException: ERROR: relation "partitions" does not exist
  6. 0

    GitHub comment 47#95927784

    GitHub | 2 years ago | Argelein
    play.api.Application$$anon$1: Execution exception[[PSQLException: ╬╪╚┴╩└: яютЄюЁ ■∙ххё  чэрўхэшх ъы■ўр эрЁє°рхЄ юуЁрэшўхэшх єэшъры№эюёЄш "idx_pass_uq" Detail: ╩ы■ў "(pass)=(345345)" єцх ёє∙хёЄтєхЄ.]]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. PostgreSQL JDBC Driver
      AbstractJdbc2Statement.executeWithFlags
      1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
      2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
      3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
      4. org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
      5. org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
      5 frames