In general it is better to use a join table instead of an array of integers. This ensures you can use foreign key references, and will index better. There is no built in support for driving associations via an array of integers. If you’re just doing has many then the associated table should hold the parent id. If you need M:N associations, use a join table.
Thanks. Actually, this is only part of the story. There will be a Restaurants table, each serving various dishes. There will be joins across them e.g. user <> dishes he likes <> restaurants serving those dishes. But since PostgreSQL supports those array of integer fields, I thought that could ensure good performane and make it easy to look up the associations.
I would definitely start with the “normal” way of modeling this in Postgres which would be via join tables, and then optimize when you’ve got millions of rows and you have specific access patterns you know you need to optimize for.