_id_seq tables

Help
croaker___
2013-01-29
2013-05-15
  • croaker___
    croaker___
    2013-01-29

    When you first access a database table via a mask, a new table is created to hold the value of the current id. if you save a record via the mask, the value in this table is incremented.

    If you populate or add to the table using external means (phpmyadmin manual insert, CSV import or maybe website inserts) then this value is not incremented causing the P4A application to crash complaining the id_seq is out of sync.

    Is there a built-in solution to this situation?

     
  • BES
    BES
    2013-01-29

    No there isn't.  I brought this up years ago.

    Somewhere in the forum is code to reset the sequence table when it gets out of synch.

     
  • you can use the p4a_db_source_resync_seq function here
    http://www.spadamar.com/tag/p4a/

    but more easily use p4a function to get a new sequence number so you'd keep using the same sequence for all your inserts

    otherwise look into P4A_AUTO_DB_SEQUENCES constant, it does what you need if you have autoincrements