jsonb_set() strictness considered harmful to data

2019-10-20 Thread Floris Van Nee
FWIW I've been bitten by this 'feature' more than once as well, accidentally erasing a column. Now I usually write js = jsonb_set(js, coalesce(new_column, 'null'::jsonb)) to prevent erasing the whole column, and instead setting the value to a jsonb null value, but I also found the STRICT behavio

'too many range table entries' error with partitioned tables and aggregations

2019-06-21 Thread Floris Van Nee
Hi all, Recently we hit a strange 'too many range table entries' error for some particular queries in our database. Some googling revealed that it's an uncommon error usually occurring due to strange database design [1]. However, I feel like the case in which it occurs this time, although unco

GIN multi-column index

2018-10-03 Thread Floris Van Nee
Hi, I've been looking at using GIN indices in some of my tables and was wondering something about their behavior when using them as a multi-column index. Suppose we have a table 't' with column 'a' as int and column 'b' as int[]. Suppose we also have a query like: select * from t where a=1 and