Now, although I am claiming in this book that in one major way Paul's hermeneutic stands in opposition to midrash, in another way he is very much within a midrashic tradition. The fundamental hermeneutical stance which he takes to the text is allegorical; that is, the language and even its apparent referents are understood as pointing to a reality beyond themselves. This is then an entirely different orientation to language from midrash in which the concrete reality both of the language and the history which it encodes is absolutely primary. Paul, however, seems very able indeed to make use of midrashic techniques of manipulation of biblical language. In a sense, this is exactly what we would expect of Paul if we take his descriptions of himself seriously. A Hellenistic Jew, thoroughly imbued with the ideology of middle-platonism but just as thoroughly trained in contemporary Palestinian biblical hermeneutics, would perhaps predictably produce biblical interpretation that is Hellenistic in ethos but often Pharisaic in method. The following section of Galatians provides some excellent examples of Paul's use of midrashic method.
The first example of how important this observation is for understanding Paul is Galatians 2:16. It has already been recognized that the argument of this verse is dependent on Psalms 143:2, but I think that the full measure of the midrash has not yet been appreciated (Betz 1979, 118). Even James Dunn, who has made this verse the cornerstone of his argument, and with whose approach I largely agree, has not fully plumbed the depths of this verse (Dunn 1990, 183–214). Paul assumes as a given of his argument that works do not justify. This is not, then, what he is trying to prove here. What the commentators seem to have missed is that Paul is not reading Psalms 143:2 alone but together with its preceding verse. The two verses are:
Lord, hear my prayer, listen to my supplication in your faith. Answer me in your justice. Do not reproach your servant with statute, for no living being will be justified [declared just] before you.
I think that Paul's only extravagant exegetical move here is to read “your faith” as “faith in You.”  All the rest of his doctrine then follows. No living being will be justified (= acquitted) before you by “statute”; therefore, we are dependent on our supplication in faith in order for us to be answered by Your justice (= justification, acquittal).
This interpretation accomplishes several purposes. First of all, I think that it definitively establishes Dunn's point that justification here is simply the Jewish doctrine of vindication by God and not transfer terminology. Second, it strongly argues for Dunn's other main point, that what is bothering Paul is the ethnic exclusivity of Torah-righteousness. The word טפשמ, which I have translated “statute,” in other contexts in Psalms itself, refers precisely to the Jewish Law of the Torah which explicitly marks off the Jews from others. “He has spoken his words to Jacob, his laws and statutes to Israel. He has not done so for any other nation, and statutes, they do not know” (Psalms 147:16–17). Accordingly Paul's interpretation of these verses is just perfect for his argument. David is asking for God to acquit him on the basis of his supplication in faith, because if no human being can be righteous, then failure to keep the statutes (which are specifically and explicitly special to Israel) cannot be the determining factor of salvation. All this becomes a powerful argument in favor of the replacement of “works of the Torah,” Jewish ritual observances by faith, and Paul's argument against Peter is complete. Note that David's supplication to God to “answer me in Your justice” is paradoxically that he come to judge not on the basis of “statute” but on the basis of faith!
While with regard to the specifics of the midrash, I have departed from Dunn's reading, it should be emphasized that in respect to the content, I am in full agreement with him, and I believe that this reading only strengthens his point that “works of the law, epitomized in this letter by circumcision, are precisely acts of the flesh. To insist on circumcision is to give a primacy to the physical level of relationship which Paul can no longer accept” (Dunn 1990, 199). The only thing that puzzles me is why Dunn, having come this far, writes “by that course, Paul will not intend a dualism between spirit and matter, however dualistic his antithesis between spirit and flesh may seem later on in Galatians 5.…But the word ‘flesh’ also embraces the thought of a merely human relationship, of a heritage determined by physical descent, as in the allegory of Galatians 4” (199 [emphasis added]). On the contrary, it is precisely the dualism between flesh and spirit which makes possible this very allegory, so this is exactly what Paul intends. This “physical descent” is an affair of matter, just as spiritual kinship is an affair, tautologically, of the spirit, so there is no “but” here. And this is just what makes Paul's gospel new vis-à-vis traditional Jewish ideologies of sin and redemption (including this very Psalm), which, as has been often shown, also presuppose the need for God's mercy, since no one can be completely righteous. What is new in Paul is not the notion that one cannot be justified by acquiring merits but the notion that faith is the spiritual signified of which convenantal nomism is the material signifier, and that in Christ the signified has completely replaced the signifier. As Dunn has put it, “The new age calls for a practice of the law (including circumcision)that need not include the outward rite ” (Dunn 1988, 121). Physical relationship = physical practices (circumcision the very symbol of genealogy) = literal meaning, but spiritual relationship (Israel in the spirit) = faith = allegory. It is in this sense that Paul can appear to be abrogating the Law at the same time he claims to be fulfilling it; he fulfills the alleged allegorical sense, while abrogating the literal (doing). The allegorical is universal while the letter is particular. The allegorical gives life, but the letter kills.