Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4881 OpenMRS should support Postgresql
  3. TRUNK-5794

Fail to create patient in PostgreSQL, due to inconsistent sequence value.

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • Core 2.4.0
    • None
    • None
    • Low

    Description

      Currently, when creating Patient in PostgreSQL you get an error of key violation in person table, Reason is there is already a person in table, Admin user. Currently, in the liquibase changesets during insertions we specify the Primary Key ( Id value ) and hence the sequence in PostgreSQL does not get autoincremented. Create a liquibase changeset to update these sequence values after all the insertions have been done via liquibase changesets.

      Error :    Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "person_pkey"
      {{ Detail: Key (person_id)=(1) already exists.}}

       

      Error Logs : https://pastebin.com/wfveKFnc

      Gliffy Diagrams

        Attachments

          1. MySQL Screenshot from 2020-06-22 13-21-58.png
            MySQL Screenshot from 2020-06-22 13-21-58.png
            222 kB
          2. PostgresqlErrorLog
            2.23 MB
          3. PostgreSQL Screenshot from 2020-06-22 12-49-28.png
            PostgreSQL Screenshot from 2020-06-22 12-49-28.png
            237 kB
          4. Screenshot from 2020-06-11 23-00-39.png
            Screenshot from 2020-06-11 23-00-39.png
            292 kB
          5. Screenshot from 2020-06-11 23-18-53.png
            Screenshot from 2020-06-11 23-18-53.png
            334 kB
          6. Screenshot from 2020-06-11 23-18-58.png
            Screenshot from 2020-06-11 23-18-58.png
            284 kB
          7. Screenshot from 2020-06-11 23-19-03.png
            Screenshot from 2020-06-11 23-19-03.png
            303 kB
          8. Screenshot from 2020-06-11 23-19-06.png
            Screenshot from 2020-06-11 23-19-06.png
            326 kB
          9. Screenshot from 2020-06-11 23-19-08.png
            Screenshot from 2020-06-11 23-19-08.png
            318 kB
          10. Screenshot from 2020-06-11 23-19-09.png
            Screenshot from 2020-06-11 23-19-09.png
            292 kB
          11. Screenshot from 2020-06-11 23-19-26.png
            Screenshot from 2020-06-11 23-19-26.png
            169 kB

          Activity

            People

              aman Aman Mishra
              aman Aman Mishra
              Daniel Kayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: