How to store data that depends on dynamic number of parameters
maybe you want a table that has a composite type as part of the key.

create extension hstore;

create table stats (client int, key hstore, value text , primary key (client, key));


insert into stats values 
  (1,'"product"=&gt;"gum","store"=&gt;"711"','USD 0.49')
 ,(1,'"product"=&gt;"soda","store"=&gt;"711"','USD 0.99')
 ,(2,'"vehicle"=&gt;"prefect 351","fuel"=&gt;"nitromethane"','950kW')
 ,(2,'"vehicle"=&gt;"prefect 351","fuel"=&gt;"ULP-97RON"','600kW')
;

select * from stats where client=2 and key=hstore(array['vehicle','prefect 351','fuel','nitromethane']);


or perhaps with the value column as hstore also, perhaps he wants to store "loudness" and "power"