Yes, generally you are right. However, if the pillar was performed during the prayer itself, the prayer is still valid as in the case of someone missing a sujood and remembering it before he concluded his prayer and hence he added another whole Rakah in exchange for the invalid Rakah.

With the prayer, am I right in saying that if a pillar isn’t performed then the salah is invalid however if an obligation isn’t performed then the salah is still valid ?

Prayer |