On Windows very simple:

  • PostgreSQL and R-language must be already installed – if not, just download and install
  • download propper archive from: http://www.joeconway.com/plr/
  • unpack and dirtibute files according to README.txt
  • add/ modify environment variables according to README.txt
  • restart computer – in Windows is this the easiest way

On Ubuntu:

  • Installation of R-language:
    • sudo apt-get install r-base
  • Installation of PL/R language into PostgreSQL:
    • download source, untar it, copy plr directory into PostgreSQL contrib directory
    • cd plr
    • sudo USE_PGXS=1 make
    • sudo USE_PGXS=1 make install

After those installations you can create extensin PL/R in database you want using command: CREATE EXTENSION PLR