NixOS/nixpkgs — pull request #1681 by bjornfor (2014-02-05 10:21:07+00:00)
Title: postgresql: provide a default pager for "psql"

When psql is started without the environment variable $PAGER set, it
tries to run "more" from $PATH (or "less", if ```__CYGWIN__``` was defined
during compilation). On NixOS, $PAGER is generally set to "less -R", but
when psql is run with sudo it is not set:

```
$ sudo psql postgres
psql (9.2.6)
Type "help" for help.

postgres=# \?
sh: more: command not found
postgres=#
```

One could of course run "sudo -E" or install "more" into a profile, but
I think it's better to provide a working default pager by compiling in
the full path to "less" (which is the default pager on NixOS). This is
what this commit does.

The closure size of postgresql (9.2) doesn't really change, it is 225
MiB before and after this change.

WARNING: This causes lots of rebuilding (Qt, KDE, ...). Changes like these makes me wonder whether we should have a "lots-of-rebuilding" branch that is merged periodically (every other week?), so that we can batch up these small changes that cause a lot of rebuilds.