Sequences with composite primary key
问题 Using PostgreSQL, how do I manage a sequence (auto incremented Integer id) for the following scenario- Table named 'businesses' which has 'id' and some more columns. Table named 'users' which has: a composite primary key, composed of a 'business_id', and an 'id', and have the 'id' reset it's counting for each 'business_id' when I insert now rows. a simple column 'name'. something like having a separate sequence per business. Example When I run the following queries: insert into users