linguistic:paraphrasing
Postwar and the territories

Polk was anxious to establish a territorial government for Oregon but the matter became embroiled in the arguments over slavery, though few thought Oregon suitable for it. Bills to establish a territorial government passed the House twice but died in the Senate. By the time Congress met again in December, California and New Mexico were in U.S. hands, and Polk in his annual message urged the establishment of territorial governments in all three. The Missouri Compromise had settled the issue of the geographic reach of slavery within the Louisiana Purchase by prohibiting slavery in states north of 36°30′ latitude, and Polk sought to extend this line into the newly acquired territory. This would have made slavery illegal in Oregon and San Francisco but allowed it in Los Angeles. Such an extension of slavery was defeated in the House by a bipartisan alliance of Northerners. In 1848 Polk signed a bill to establish the Territory of Oregon and prohibit slavery in it.

In December 1848, Polk sought to establish territorial governments in California and New Mexico, a task made especially urgent by the onset of the California Gold Rush. The divisive issue of slavery blocked the idea. Finally in the Compromise of 1850 the issue was resolved.

Polk had misgivings about a bill creating the Department of the Interior (March 3, 1849). He feared the federal government usurping power over public lands from the states. Nevertheless, he signed the bill.