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.
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.