0

I created two tables using This -> https://stackoverflow.com/a/30204854/16681212 method. Now I need another table that is doing the same thing but based on both id's. So each STUFF should be able to have multiple items starting with another sequence per Stuff (makes sense? :D)

thing_id stuff_id item_id
1 1 1
1 1 2
2 1 1
2 2 1
2 2 2
2 2 3
2 3 1
3 1 1
3 2 1
3 2 2

and so on, which makes every combination unique.

I don't know how and if this is possible with the tables I already created and the method above, as I'm just starting out on PostgreSQL. Any help appreciated!

Alina
  • 1
  • 1
  • The method presented in the referenced link is a very poor approach. It is excessively complex, vulnerable to multiple failure modes, and scales extremely poorly. Imagine the explosion of sequences that would result as the number of objects increases. The original question associated with that post might be suitable as a puzzle question, but it has no real value with regard to good database design. – JohnH Jul 25 '23 at 19:24

0 Answers0