Is it possible to have an array from hstore in PostgreSQL

I am a complete newbie to PostgreSQL. And I was really amazed at the hstore data type provided by Postgres. Well, I use the Rails 3 framework and am developing a simple application that uses PostgreSQL. I want to save an array of hashes in a field. For instance:

authors: [
           {
             name: "abc",
             email: "abc@example.com"
           },
           {
             name: "xyz",
             email: "xyz@example.com"
           }
         ]

Is this possible in PostgreSQL using Rails 3? If so, can someone make it clear how?

thank

+5
source share
2 answers

Of course, you can create an array-of-hstore column in Rails 4, for example. this column specification in table creation:

t.hstore :properties, :array => true

Rails 4.0 , , , ; , , .

( ) https://github.com/rails/rails/issues/11135, , , .

+7

All Articles