1

Is there are way to make ID fiels in MySql immutable? It's possible in postgreSQL using PGAdmin for example.

ID field sets as primary key and auto incr but can be changed manually.

Vandal
  • 21
  • 2
  • Perhaps you can use a trigger ON UPDATE to prevent updating the column. – IVO GELOV Jan 12 '23 at 08:29
  • Not clear why you would want this. As is being a primary key means duplicates are trapped and if referred to by a foreign key cannot be changed if it would cause an FK error..Do you mean that you want to disbar on the basis of some other columns in the row? – P.Salmon Jan 12 '23 at 08:39
  • Are you trying to ensure that id values are consecutive, with no values missing? – Bill Karwin Jan 12 '23 at 14:17

0 Answers0