The Police Act of 1805 standardised the running of police forces to patrol Scotland’s burghs and led to the creation of a professional force in Edinburgh.
Previously, retired soldiers formed the town guard and continued to do so until 1817 when they were disbanded. The High Constables of Scotland were also charged with protecting the peace, patrolling Edinburgh’s streets in times of disorder and attending ceremonial duties to protect the king. They continue to exist as an organisation until today undertaking ceremonial duties.
The surprising thing about policemen in the 19th century is that they were responsible for street pavement repairs and street lights as well as catching criminals. The police force was run by a board of commissioners independent of the council and in 1831 Edinburgh a town of 100,000 there were 312 policemen. The police model in Edinburgh followed a Parisian style until William Haining was appointed superintendent of the Edinburgh police.
In 1843 the Edinburgh police force was reorganised by Superintendent Haining assisted by another London officer called W F N Smith moved from Greenwich and at that point, Edinburgh moved to an English style of policing. See Origins of the Metropolitan Police for background on how the London police were organised.
In 1848 the town council expressed concerns that these reforms were not working and appointed Richard Moxey as interim chief superintendent to look into the state of the force and supply regular reports on manpower and effectiveness. (ref – The Scotsman 1848, 9 Feb page 3)