If you marry an Indonesian citizen you are allowed to have automatic residency IF you are female but not if you are male. If you are male you need to prove that you will be able to support yourself and your wife whilst in Indonesia. You will need a work visa and tempory resident visa through the embassy until your permanent residency status is decided on.
Indonesia only allows 1 residency so if you take up Indonesian residency you will have to give up your home country residency. The way the Indonesian economy is, I don't think that would be a very good idea. Indonesians have all kinds of limitations on their ability to travel freely to other countries (mainly because a lot of people want to work overseas and try to do so without the right visa.)
You really need to go have a chat with your local Indonesian embassy to see what your situation is now. If your new wife wants to take up the residency of your home country she will have to give up her Indonesian residency at least officially.
The Indonesian Consulate or Embassy are the best people to ask. A general answer : You will need a spouse visa and be able to prove that the marriage is recognised as such by the laws of that country where you married.
since you did not precise your country of origin
here are two links you may want to look at ?
visas can be obtained upon arrival as well , it all depends on the lenght of your stay ?
would you like to come back and tell your country ?
i will try to find you an answer :-)
im from the philippines and my us citizen fiancee and i are plannin to get married soon, does any knows how long will it take to get that affidavit done? like if it will take days or it can be done ...