1

I have downloaded the plv8 installation package from xTuple using this link. I have run the installation batch file in that package. I've checked the relevant files are now in bin, lib and share/extension.

I have given my user superuser permissions with:

ALTER USER administrator WITH superuser

When I try to create the extension, I receive a Permission Denied error:

CREATE EXTENSION IF NOT EXISTS plv8
> ERROR:  could not open extension control file "C:/Program Files/PostgreSQL/12/share/extension/plv8.control": Permission denied

I can't work out what's wrong.

cbp
  • 25,252
  • 29
  • 125
  • 205
  • You have to install the software before you can create the extension in the database. I'm not sure about PL/v8, but typically that involves compiling the software. Many people don't have the necessary tools (C compiler, ...) installed on a Windows machine, and even if you have, building a PostgreSQL extension on Windows can be challenging. Best get in touch with the people who maintain the extension and ask them for help (if the documentation doesn't say anything about Windows). – Laurenz Albe Jul 16 '20 at 14:59
  • Link on the question is outdated. Working link and installation guide is available here: https://www.xtuple.com/en/knowledge/installing-plv8 – ofarukcaki Jul 10 '21 at 17:49

1 Answers1

0

First of all, thank you for providing the link to the packaged extension.

I installed the PLV8 extension using the .bat file, and then I had to restart the PostgreSQL service on my Windows machine.

After that, running the create extension plv8; command in pgAdmin worked without a problem. I verified that the extension is installed by trying to execute the same command again and getting an "ERROR: extension "plv8" already exists" message.

I think you have have forgotten to restart the PostgreSQL service after installation of the extension package.

Dmitriy G
  • 13
  • 1
  • 3
  • Thanks Dmitriy, actually at the time I hacked a fix by giving network service write permissions to the folder in Program Files, and it worked, but i figured that probably wasn't the right approach so didn't leave an update here. – cbp Jul 30 '20 at 03:11