Hmmm. I see that Scotland's People has
Peter, baptised 6 August 1837
Helen, born 19 March, baptised 14 April 1839
Susan, born 24 December 1841, baptised 23 January 1842
David, born 31 July, baptised 1 September 1844
Peter in South Leith, the others in Nicholson Street Associate kirk ("Other Churches" section in SP).
And it seems that Catherine died in Melrose.
The 1841 census (FreeCEN transcription) has Alexr, 30; Catherine, 30; James, 5, born
Ireland; Peter, 3; and Hellen 2, everyone but James born in Midlothian. However another transcription says James was also born in Midlothian so you have to check the original to see which one is correct.
In 1851 in Melrose: Alexander, 45, widower; Daniel, son, 18; James, son, 14; Peter, son, 12; Helen, daughter, 11. FreeCEN says that Alexander, Daniel and James were born in
Dunse, Berwickshire, Peter in Leith and Helen in Edinburgh. Another transcription says that Alexander, Daniel and James were born in
Roxburghshire, Peter and Helen in Midlothian. Again, you must check the original to see which is correct.
Digression - how the ***** can so-called transcriptions, which are supposed to be an accurate representation of what is on the identical original document, differ so significantly?
And that's without trying the notoriously inaccurate Anc***** transcriptions.