T
T
th3mis2015-11-24 20:21:57
PostgreSQL
th3mis, 2015-11-24 20:21:57

PostgreSQL is there a type with flags (status) sets?

Good day,
There are various combinations of statuses:

  1. 1,4,29
  2. 4,18,42
  3. etc

It is not very efficient to store and LIKE or == c "".join() statuses in the string, although I still do it now.
How to most competently implement a selection using a DBMS, without creating columns for each possible status?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kazmiruk, 2015-11-24
@kazmiruk

www.postgresql.org/docs/9.3/static/arrays.html

E
evnuh, 2015-11-24
@evnuh

Array?
But in a good way this is done through an intermediate table user_id | status

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question