How to restrict sequence like ID type to C type like int64_t, uint64_t, int32_t?
I don't think you can restrict this by the choice of the datatype. 

However you can create a check constraint that ensures that no value is inserted that could not be represented in your programming language:

alter table foo 
   add constraint check_type_range check (int_column &lt; 32767);


You will have to replace the actual value with the one that matches the chosen datatype (I don't do C, so I don't know what those limits are).