I'm posting this here for search-engine's sake, so future people having this same problem can find the solution here.
After installing PostgreSQL from FreeBSD's ports, and running su - pgsql -c initdb for the first time, I got this common error: could not create semaphores : No space left on device This page: http://www.postgresql.org/docs/current/static/postmaster-start.html ... and many others tell you to recompile your kernel with different System V semaphores limits. I knew this couldn't be it, because I had installed PostgreSQL successfully on many FreeBSD laptops and desktops. I tried uninstalling and re-installing. No luck. Same error when running initdb. Then I went into "top" and made sure to entirely kill all active postgresql processes. Then I ran initdb again and everything was fine. So --- I think if you install PostgreSQL from FreeBSD ports, and start the server, and THEN run initdb, it will give you this error. If you make sure that ALL PostgreSQL processes are stopped (see ps aux or top) -- then it should work fine. ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match