The nature and glory of the church, 1-3. The increase, honor, and comfort of the members thereof, 4-7.
1 [A Psalm or Song for the Sons of Korah.]
His foundation is in the holy mountains.
2  The LORD loves the gates of Zion/ 
more than all the dwellings of Jacob.
3  Glorious things are spoken of you,/ 
O city of God./ 
[Selah.]
4  "I will make mention of Rahab and Babylon/ 
to those who know me./ 
Behold, Philistia, Tyre, and also Cush:/ 
'This one was born there.'"
5  And of Zion it shall be said,/ 
"This and that man was born in her./ 
And the Highest himself shall establish her."
6  The LORD shall reckon when he registers the people:/ 
"This man was born there."/ 
[Selah.]
7  The singers as well as the players on instruments shall be there./ 
All my springs are in you.
Matthew Henry Commentary - Psalms, Chapter 87[➚]
John Calvin's Chapter Summary:
The miserable and distressing condition in which the Church was placed after the Babylonish captivity, might be apt to sink the minds of the godly into despondency; and, accordingly, the Holy Spirit here promises her restoration in a wonderful and incredible manner, so that nothing would be more desirable than to be reckoned among the number of her members.
[v.6] - "when he registers the people" - From Matthew Poole's Commentary: "The sense is, when God, the Maker and Governor of this city, shall take a survey of all his citizens and subjects. It is an allusion to princes or governors of cities that use to write and keep a register of all their people." From the Pulpit Commentary: "He shall enregister every individual among the converted nations as a true citizen of Zion, entitled to all covenant privileges."