matt1
January 9, 2019, 8:07pm
1
Hello here !
I’m trying to use a hstore
column but I’m getting
** (Postgrex.Error) ERROR 42704 (undefined_object) type "hstore" does not exist
https://github.com/elixir-ecto/postgrex mark as supported type
is this the correct way?
def change do
create table(:services) do
add :data, :hstore
timestamps()
end
thanks in advance!
NobbZ
January 9, 2019, 8:39pm
2
As far as I know, you need to run CREATE EXTENSION hstore;
for each database that you want to use a hstore
column.
2 Likes
Hi, I’m just curious Why hstore
, but not jsonb
?
Would there be any reason for preferring jsonb over hstore if the requirement was only for text and there are were no nested objects?
matt1
January 10, 2019, 12:56pm
6
Hello Van!,
I only need a key-value
thing, it’s there any performance or reason to use jsonb instead of hstore?
I will need to make filters, groupings and aggregations over the values of this column (and will be a huge table)
Thanks in advance
kip
January 10, 2019, 4:01pm
7
Craig Kerstiens notes in this blog post :
At this point it’s probably worth replacing hstore use with jsonb in all new applications.
2 Likes