This is a fork of osm2pgsql. It adds a --relation-index flag, which takes a .relidx file generated from relindex in osmindex repo.
For general usage, please refer to the original repo. For any support, raise an issue, but you're probably on your own.
My code is trash, C++ is an unfamiliar language to me. But it does what I need it to, maybe it will do what you need it to, too.