How to apply patch on postgresql 9.2
Don't. Instead update to PostgreSQL 9.2.23, which includes a better fix.



If you really must patch it: clone PostgreSQL's source code from git, check out 9.2, apply patch, compile.

git clone git://git.postgresql.org/git/postgresql.git
cd postgresql
git checkout REL9_2_STABLE
patch -p1 &lt; ~/Downloads/pg_dump_grouplock.patch
./configure ...


See the PostgreSQL documentation for compile instructions.