psql -d template0 -c 'create extension hstore;'
if you get error like database "template0" is not currently accepting connections try this one solution
UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
but this solution can cause problem when you you will do pg_upgrade be carefull