
tothpeter08
High Performance PostgreSQL for Rails: reverse search does not work in psql (Page 42)
“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
First Post!

andatki
Good catch. Sure enough, I had that file set and didn’t realize that it was the source of that functionality and not built-in to psql.
Here are the contents of my ~/.editrc
file:
bind "^R" em-inc-search-prev
This is part of my dotfiles: https://github.com/andyatkinson/dotfiles
With this file present, then reverse search works within psql as described. I’ll add something about this to the Rideshare repository for others. Thanks for reporting it!
Popular Pragmatic topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim