Even if you specify LENGTH="9", under Postgres SERIAL fields are always created as BIGSERIAL, which seems like a bug to me.
I know this is fine for ordinary Moodle cases, because LENGTH="10", but sometimes when working on special tables where database efficiency (size) is critical you do actually want 32-bit IDs.
An issue that probably doesn't affect core code but might be of interest to some plugin developers.
Anyway I have attached a patch that modifies the xmldb base class generator so that it can use a different word for sequences that are LENGTH="9" or less, and modified postgres generator to use this. It is quite simple and self-explanatory and appears to work although I haven't much tested it. If you're ok with the patch perhaps you could check it in - or comment if you want me to commit it (tell me whether MOODLE_18_STABLE or just HEAD).