CREATE EXTENSION pljava failed on PostgreSql 9.6 - postgresql

I try to install pljava for postgesql 9.6 in Ubuntu 16.04, but it fails with error.
A gradlew script makes an installation, but it fails with the following error"
Failed to execute: CREATE EXTENSION pljava; because: ERROR: could not access file "pljava-so-1.5.1-BETA1": No such file or directory
A gradlew source:
Sql sql = establishConnection()
try {
sql.execute("SET pljava.libjvm_location TO '${javaNative}';")
sql.execute("SET pljava.vmoptions TO '-Xshare:on -XX:+DisableAttachMechanism';")
sql.execute("ALTER DATABASE postgres SET pljava.libjvm_location FROM CURRENT;")
sql.execute("ALTER DATABASE postgres SET pljava.vmoptions FROM CURRENT;")
sql.execute("CREATE EXTENSION pljava;")
} finally {
sql.close()
}
As i understand, it fails during a creation of extension pljava, commands above was executed without any errors.
According to #ChapmanFlack advice:
I have no any mentions about pljava-so-1.5.1-BETA1 file at pg_config --libdir directory. Also i didn't find that file at pg_config --sharedir
grep LOAD pljava--1.5.1-BETA1.sql output following:
touched off by the LOAD command, making possible a decent installation
LOAD command, but finds the CREATE EXTENSION command instead). So,
temporarily LOAD 'pljava-so-1.5.1-BETA1'; Ok, the LOAD succeeded, so
everything happened ... unless ... the same PostgreSQL turns LOAD into
a (successful) no-op in that case, meaning To fail fast in that case,
expect that the LOAD actions should have
I think PL/Java builds from a prebuilt, because of that line at gradlew:
commandLine 'java', '-jar', '../installer/build/dependencies/pljava-pg9.6.jar'
I would be appreciate for any advice

Related

Unable to use pgmail

Does anyone use pgmail?
In order to use it, I need to first install postgresql-tcl. However, even after installing it on postgresql-12 - while running below command:
CREATE EXTENSION pltcl;
I'm getting below error:
ERROR: could not open extension control file "/usr/pgsql-12/share/extension/pltcl.control": No
such file or directory
What I have tried:
I followed https://tunnelix.com/messing-around-pltcl-on-postgresql/ and instead of CREATE EXTENSION , I used CREATE LANGUAGE. However, I again I got below error:
shiwangini1=# CREATE language pltcl;
ERROR: could not access file "$libdir/pltcl": No such file or directory
What else can I do to make it working?
Thanks in advance!

Installing php extension for SQL Anywhere on server with CentOS, Plesk, php-fpm

we got a new WebServer with CentOS, Plesk and php-fpm.
Now we don't get the php extension running.
What we did:
installed latest SQL Anywhere 17 (ebf29577)
copied php-7.3.0_sqlanywhere_r.so to /opt/plesk/php/7.3/lib64/php/modules/
loading php-7.3.0_sqlanywhere_r.so via /opt/plesk/php/7.3/etc/php.d/sqlanywhere.ini
this leads to an error:
WARNING: [pool plesk-php73-fpm.plesk-service.localdomain] child 11616 said into stderr: "NOTICE: PHP message: PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0"
(This leads to php 7.3 fpm is not loading at all)
next try was to switch from FPM to CGI: same error
module is loadable itself within shell if LD_LIBRARY_PATH was enhanced with path /opt/sqlanywhere17/lib64/
some tries getting the cause by strace did not help
Has anybody an idea or maybe even successfully installed php extension.
Thanks
Florian
after a lot of tests we found a solution:
in Plesk Domain php settings we had to add:
[php-fpm-pool-settings]
env[LD_LIBRARY_PATH]="/opt/sqlanywhere_v2/lib64:$LD_LIBRARY_PATH"
Now all libs are found and it works
For me solution was, creating custom handler:
plesk bin php_handler --add -displayname "PHP SQLAnywhere 7.4" -path /opt/php-custom-handlers/7.4/php-sqlanywhere.fcgi -clipath /opt/plesk/php/7.4/bin/php -phpini /opt/plesk/php/7.4/etc/php.ini -type fastcgi
php-sqlanywhere.fcgi contents:
#!/bin/bash
LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64
export LD_LIBRARY_PATH
exec /opt/plesk/php/7.4/bin/php-cgi "$#"
And finally using this handler on domain php settings and adding on additional directives:
extension=sqlanywhere.so

Problem upon Installing PostgreSQL 12.1 Win8.1: “the database cluster initialisation failed”

I'm getting an error at the end of installing PostgreSQL 12.1 which is "the database cluster initialisation failed"
I have been searching all the day, so here what I tried:
1- Run the installation file as Administrator: didn't work.
2- Change the directory of "Data" to different place other than C:: didn't work.
3- Changed the whole installation directory to C:\Postgre or F:.... : didn't work
4- Turned off the KasperSky antivires: didn't work
5- Checked if there is an old Postgre user: not found
I checked the log file and I found the following :
Script output:
WScript.Shell Initialized...
Scripting.FileSystemObject initialized...
Called CreateDirectory(F:\PostgersSql\data)...
Called CreateDirectory(F:\PostgersSql)...
Called ClearAcl (F:\PostgersSql\data)...
Executing batch file 'rad712E9.bat'...
Called Die(Failed to reset the ACL (F:\PostgersSql\data))...
Failed to reset the ACL (F:\PostgersSql\data)
Any one can tell me what is causing this error?

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

Postgresql 11.1: "Problem running post-install step. Installation may not complete correctly. Error with configuration or permissions."

I checked the log file and I think this is the part that caused the problem:
Setting up database
[15:30:54] Configuring pg11 to point to existing data dir D:\John's Files\My Documents\Code\Databases\PostgreSQL\data\pg11
Setting PostgreSQL port
= 5432
Executing C:\Installed Software\Developer Software\PostgreSQLv11.1/pgc config pg11 --datadir "D:\John's Files\My Documents\Code\Databases\PostgreSQL\data\pg11"
Script exit code: 1
Script output: ################################################
# FATAL SQL Error in check_release
# SQL Message = near "s": syntax error
# SQL Statement = SELECT r.component FROM releases r, versions v
WHERE r.component = v.component
AND r.component LIKE '%D:\John's Files\My Documents\Code\Databases\PostgreSQL\data\pg11%' AND v.is_current = 1
################################################
Script stderr: Program ended with an error exit code
Error with configuration or permissions. Please see log file for more information.
Problem running post-install step. Installation may not complete correctly
Error with configuration or permissions. Please see log file for more information.
I think the problem is the apostrophe in "John's". Does anyone know if that's right? Is there a fix to this problem? I don't want to rename my directory because Postgresql can't handle apostrophes.