I am thinking from the perspective that (I believe) jsonb
is more efficient and can get indexed more easily.
-
I would decide this based on the type of queries that will be needed. Some things can't be done with jsonb and some things can't be done with arrays.– user1822Jan 24 at 6:57
1 Answer
There is no advantage in using a JSON type for a plain array, but I guess there is no big disadvantage either. Keep it simple and use text[]
.
-
For context, I was wondering if jsonb would produce better performance for typical checks, like checking if array contains value, than GIN index.– GajusJan 23 at 19:43
-