the above link suggests 128mb for shmmax and 2097152 pages for shmall. To change it, use:
$ sysctl -w kernel.shmmax=134217728
$ sysctl -w kernel.shmall=2097152
$ echo 134217728 >/proc/sys/kernel/shmmax
$ echo 2097152 >/proc/sys/kernel/shmall
To make this permanent, put the first code (without sysctl -w) in /etc/sysctl.conf or the 2nd in /etc/rc.local or so.
btw. I have found this with google, was the first hit for 'shmmax postgre'.