The automatic primary key (PKey) values are not intended to work in another specific deployment. They are produced by the Adobe Campaign API.
Automatic Primary Key values generated by Adobe Campaign must never be stored into an external database or website. You must generate specific key fields in your database definition and use it during your developments.
You won't be able to generate or alter PKey. However, you may use Custom keys if the profile resource has been extended with a custom key field.
Which API you're trying? It would be worth knowing the use case here for max length of the PKey, are you running into any issues due to its length?