That's a ports patch file. You don't have to apply it.
Assuming you put your ports in /usr/ports:
Drop that patch file in /usr/ports/databases/postgresql/patches/
Name it patch-src_pl_plperl_GNUmakefile
Then you have to build postgresql yourself.
Code:
cd /usr/ports/databases/postgresql
make package
make install # If you are ready to install on this machine
You might run into some problems with wxallowed, so we'll see. Also it'll take a while as it builds all of it's dependencies.