Yesterday (August, 7th), Tom Lane committed: Log Message: ----------- Recognize functional dependency on primary keys. This allows a table's other columns to be referenced without listing them in GROUP BY, so long as the primary key column(s) are listed in GROUP BY.   Eventually we should ...

Let's assume you have some simple database with "articles" - each article can be in many "categories". And now you want to get list of all articles in given set of categories. Standard approach: select a.* from ...

Let's assume you have very simple table with users: # \d users Table "public.users" ...

When I was working for one of customers we found some strange thing. We needed to found number of distinct sessions per day. Table layout was very simple: