1

I am thinking from the perspective that (I believe) jsonb is more efficient and can get indexed more easily.

1
  • 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.
    – user1822
    Commented Jan 24, 2023 at 6:57

1 Answer 1

1

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[].

2
  • For context, I was wondering if jsonb would produce better performance for typical checks, like checking if array contains value, than GIN index.
    – Gajus
    Commented Jan 23, 2023 at 19:43
  • No, it should be about the same. Commented Jan 23, 2023 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.