JFB : Psalms 138

      @Ps 138:1-8. David thanks God for His benefits, and anticipating a wider extension of God's glory by His means, assures himself of His continued presence and faithfulness.

      1. I will praise thee with my whole heart--(Compare @Ps 9:1).
      before the gods--whether angels (@Ps 8:5); or princes (@Ex 21:6 Ps 82:6); or idols (@Ps 97:7); denotes a readiness to worship the true God alone, and a contempt of all other objects of worship.

      2. (Compare @Ps 5:7).
      thy word above all thy name--that is, God's promise (@2Sa 7:12-16), sustained by His mercy and truth, exceeded all other manifestations of Himself as subject of praise.

      3-5. That promise, as an answer to his prayers in distress, revived and strengthened his faith; and, as the basis of other revelations of the Messiah, it will be the occasion of praise by all who hear and receive it (@Ps 68:29,31 Isa 4:3).

      5. for great is the glory--or, "when the glory shall be great," in God's fulfilling His purposes of redemption.

      6, 7. On this general principle of God's government (@Isa 2:11 57:15 66:2), he relies for God's favor in saving him, and overthrowing his enemies.
      knoweth afar off--their ways and deserts (@Ps 1:6).

      8. God will fulfil His promise.