Sample Header Ad - 728x90

Using PostgreSQL to hold an array of data

0 votes
1 answer
191 views
I am trying to use a postgreSQL data base column to store values from an array (or point to an enum table which does this). I will get an array of data like ['one','two','five']. The array can contain any amount of items from 0 to 10. I have an enum table with these values:
id    value
1     one
2     two
3     three
4     four
5     five
I want my database cell to point to all of the values that are contained in the array. Is this even possible or is there a common way to structure database tables to fix this issue. So my desired solution when passed the array ['one','two','five'] would be to have a single cell in my database hold the enum pointers 1, 2, 5.
Asked by tdammon (115 rep)
Oct 6, 2020, 04:04 PM
Last activity: Jun 24, 2025, 12:06 AM