<p>No, the tags should not need to be sorted. That looks like a bug. I will investigate. Thanks for the examples to reproduce. </p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/osm2pgsql/issues/35#issuecomment-18779175'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/g8smGCFOcVLF28Q-xX3zcWTpl64m4ZJf83iwD5itR4HUC916gAzbtuLTVhP3k4EK.gif' height='1' width='1'></p>