“If you’ve used the history command in your terminal, psql supports a similar “reverse search” by typing “ctrl-r”. Type ctrl-r, then SEL to match any SELECT statements you’ve run before.”
→ It doesn’t work for me on OSX. This solved it: postgresql - Is there a psql equivalent of bash's reverse-search-history? - Database Administrators Stack Exchange