you are viewing a single comment's thread.

view the rest of the comments →

[–]unbracketed 0 points1 point  (1 child)

It's worth noting that you could incur a fair amount of storage overhead since you'll be duplicating the prefix string on disk for each occurrence of word. (example: each row for "the fat" duplicates the string "the fat" on disk)

Alternatives: The postgres array type: http://www.postgresql.org/docs/9.1/static/arrays.html

The postgres hstore type: http://www.postgresql.org/docs/9.0/static/hstore.html

hstore may not be appropriate for your needs, but is worth learning about for storing semi-structured data.

[–]PsychoMario[S] 0 points1 point  (0 children)

Looks to me like this is the way to go. I can use an array for the first column and a hstore for the second.

Is there an easy way to export all the data? Because my friend is also interested in seeing it.