Your pension is protected from garnishment just like Social Security. Once the money gets in your bank account, however, it can possibly be taken depending on what is in the account. You generally have to go to court to explain the source of the income. When you say bankruptcy, are you saying you are currently in a Ch.13 and the payment plan is the garnishment? If so, you would just need to take over making the payments, but the pension does not get garnished.
The legal analysis of any situation depends on a variety of factors which cannot be properly represented or accounted for in a response to an on-line question. Any answer, discussion or information is intended as general information only, is not intended to serve as legal advice or as a substitute for legal counsel, and should not be relied upon in making any decision. If you have a question about a specific factual situation, you should contact an attorney directly.