What is the best way to store lists in postgresql? What kind of field do I have to use? do I have to serialize it?
This is an example of data that I want to store:
id ( number ), name ( text ), events ( list )
1, john connor, ["aaa","bbb","ccc"]
2, jack bush, ["ttt","hhh","lll"]
...
Normalization(google it - you will find a lot). The first step is called 1st Normal Form (1NF) and part of that is removing all repeating groups. An array or list of any kind violates that. It only leads to maintenance and data issues down the line. As mentioned pull your list out into another table with a column for values. You can always rebuild the list or array with a query but avoid the data abnormalities you will get with a list or array.