Postgres 9.4 was released in December 2014 adding the FILTER clause to aggregate functions and this clause is quite useful when you want to count or sum specific records when executing group by.
How many minutes has passed since the beginning of this job? How many hours do we have to wait? If you’ve asked these kind of questions while programming on Ruby on Rails you’ll probably get no answer on Rails docs. But there is a solution.
Have you ever needed to use a helper method inside your controller? I did, a few…
Sometimes you need to support different versions of an API inside your ruby code. And, sometime, you will need to compare version strings in order to make a feature available.
If you are used to format string via % operator you should be careful with dynamic content evaluation. Here is how I handle special cases when using dynamic e-mail subjects.
By default Postgres will order by ASC and NULL values will be placed on the end of list, but with the NULLS {FIRST|LAST} option you can setup the ordering by NULL values as you wish: