Problem with server upgrade from 12 to 13 and 32-bit applications - postgresql

I have a 64-bit Postgres server and 32-bit Windows applications. This worked perfectly until I upgraded Postgres from 12 to 13. The new server works well but applications raise an error authentication method 10 not supported on login.
I edited 13/data/pg_hba.conf, replaced the authentication method from scram-sha-256 to md5 in all entries, and restarted the server but the problem remained.
I think I need a new version of 32-bit libpq.dll but cannot find any newer than this from Postgres 10. Two questions. Will a newer version of libpq.dll solve the issue? And if so, where can I find it?

The problem is analogous to that described in PostgreSQL authentication method 10 not supported. An additional difficulty in my case was that I could not get the dlls from the server installation due to a 64-bit vs 32-bit incompatibility. I have just found a solution and post it that may be useful to others in the same situation.
Download the binaries for Postgres 10.17 Win x86-32 from this page. You can find the file libpq.dll in lib folder but it is not enough as it needs two other (new) libraries: libcrypto-1_1.dll and libssl-1_1.dll. Copy the libraries and make available to your 32-bit applications. These three libraries are necessary for proper login. The lib folder contains more libraries that your application may need.
Note that the authentication method scram-sha-256 is safer than md5 so it is no reason to replace it in the way described in the question.

Related

How to install plv8 in postgresql 14 for windows?

I tried installing plv8 from
[1]: https://martendb.io/v3/documentation/admin/installing-plv8-windows
but it did not work.
The challenge is Windows and Version 14. The solution you point to has only the files going up to PG Version 12. It works on 12, I used that on 12.
But I am also trying to find the windows version of this extension for PG 14. So far, people have updated the Linux builds for working with 14.
The correct, full answer is to download the source from github.
Install Version 14 of PG (You need the header files). Install the tools spelled out in the PLV8\Windows directory README. And then compile everything locally. This is what the Linux users do to get the binaries for their specific system.
we are grabbing the source from here: https://github.com/plv8/plv8/tree/master
We are working on this right now. We will push the compiled (under windows 10 x64) Versions up to another GIT and publish the link for others as our way of supporting this. (But it's not trivial, this stuff is made more for the Linux side of things)

What to deploy for Firebird 4 clients?

Using Firebird 2, we had to deploy 3 files with our applications to be able to connect to remote firebird servers:
fbclient.dll
msvcr80.dll
Microsoft.VC80.CRT.manifest
The first file was retrieved from the "normal" Firebird installer, the other 2 files from the "embedded" installer.
Firebird 4 doesn't provide an embedded installer, and I don't find proper information what to deploy for clients.
Reading this: https://ib-aid.com/download/docs/fb4migrationguide.html#_installing_client looks like Firebird 3 has lower demands. Is that the case? I just need communication-encryption and longer passwords, so FB3 would also be fine. (BTW, following the guide didn't bring success, otherwise I would not ask).
The minimum necessary files are listed in the document you link:
If we speak about installing Firebird client only, you need to have
fbclient.dll file. Firebird 4.0 client requires Microsoft Runtime C++
2017 with the same bitness as fbclient.dll. If Microsoft Runtime is
not installed, you may just copy it’s two files, msvcp140.dll and
vcruntime140.dll that are included in ZIP for Windows.
So the absolute minimum you need is fbclient.dll, and in some cases you may also need msvcp140.dll and vcruntime140.dll when those are not already installed on your system.
In addition, it is advisable to include firebird.msg for error messages, and for some use cases, adding the ICU files is advisable (if you use the functions of fbclient to render/parse WITH TIME ZONE types).
If you want wire compression, you'll also need zlib1.dll, and if you want to use Chacha wire encryption instead of the less secure ARC4, then you also need plugins/chacha.dll (the chacha.dll needs to be in a plugins folder relative to fbclient.dll).
All these libraries must be the same bitness as your application. As discussed in the comments, the problem seems to have been that you tried the 64-bit DLLs from a 64-bit Firebird installation, while your application was 32-bit.
If your application is 32-bit, then obtain the files from a 32-bit installation or zip kit, or look in the WOW64(*) folder of a 64-bit installation (from the installer, the 64-bit zip kit doesn't contain this directory). This WOW64 folder contains the 32-bit files fbclient.dll, msvcp140.dll and vcruntime140.dll (for the additional DLLs you need to use a 32-bit installer or zip kit).
* This follows the awkward Windows naming of 64-bit Windows having 64-bit files in %WINDIR%\System32, and 32-bit files in %WINDIR%\SysWOW64

troubles connecting to a (remote) PostgreSQL database using FireDAC & Delphi 10.3.3

Using Delphi 10.3.3 I need to access a Postgress database on a remote server. I am trying using FireDac. I am not able to connect to the remote database, so I thought to create a testprog and a local PostgreSQL-database first. So I installed PostgreSQL 32 bit on my machine. Copied the libpq.dll to the same location as my exe, copied the libpq.dll to Windows\System32 as well. Checked the PATH, System32 is there. But still I get "Cannot load vendor library (libpq.dll). The specified module could not be found"
I tried 64 bit versions as well, I found different versions of the libpq.dll which I tried without success.
Do you have any experience in how to solve this ?
If you have the latest libpq.dll, does the remote database version matter ? I am new to PostgreSQL, how can I find the version ?
Just libpq.dll is not enough, you need other DLLs. You will find the full list here.

Unable to install PostgreSQL on dev machine

I'm trying to install PGSQL 8.3 (and 8.4 and 9.0) on my work laptop. At the end of the installation, the installer complains it can't init the cluster. Investigating more, I noticed that the service is not even installed. I did use the "OneClick Installer", not the pgAdmin stand alone install. I tried installing as Administrator and as a regular user. In all the cases, the pgsql system account is created and the files copied, but the service is not.
I successfully installed PGSQL many times on my home PC. Both the laptop and desktop use Windows 7 64 bits (former is Professional, later is Ultimate). The only differences I can think of are that the laptop is part of an Active Directory and uses McAfee, while the desktop is only on a workgroup and uses Windows Security Essentials.
Are you sure the postgres user is allowed to create files in the data directory? The installer defaults to putting the data directory where the binaries are installed (e.g. c:\Program Files) which is usually not writeable by a regular user (and I never understood why the installer contains such an idiotic default).
McAffee could be an issue though. I have heard several stories about virus scanners infering with the Postgres (or other DBMS). Can you turn McAffee off - at least for the data directory?
Another problem could be that the installer is not able to create the postgres windows user (that is used to run the service).
If you are a local administrator on that machine, try to create the user before the installer does it. The installer will then not try to create the user account.
As a last ressort, you could install PostgreSQL without the installer (this is what I usually do).
Download the ZIP file from http://www.enterprisedb.com/products-services-training/pgbindownload
Unzip it into a convenient location
Run initdb (make sure you do that using the postgres user account - the one that is used to run the service later!)
run pg_ctlr register to create the Windows service
If any of those steps fails you'll see a proper error message which is not always the case with the installer.
Anti-virus is a well known issue:
http://wiki.postgresql.org/wiki/Running_&_Installing_PostgreSQL_On_Native_Windows#Antivirus_software
PostgreSQL connection problems
(answer is from one the core developers)
Postgresql 8.4 and BitDefender 11
With earlier versions of PostgreSQL, I found I had to delete the user "postgres" before reinstalling would work. Not sure what versions had that problem, though.

Oracle Driver Installation

I am having Oracle 10g installed on my laptop and have downloaded ojdbc14.jar driver for the same. The problem is, my operating system is Windows 7, and I'm not having option to create a Data Source for Oracle since I m not having oracles driver installed. I m having option to create a Data Source for SQL server 6, but I want to get connected to Oracle. Please Help.
By 'Data Sources', I'm guessing that you mean Data Sources (ODBC), under Control Panel > Administrative Tools. Is this correct?
I've set up ODBC Data Sources that connect to Oracle databases before, but to do that I've needed the Oracle client to be installed. However, if you're having the full database installed on your laptop (as your question suggests), you won't need the client - that's only used to connect to databases running on other machines. I believe the full database contains everything in the client, so you should be able to set up an ODBC Data Source pointing to the database on your laptop once the database has been installed.
The ojdbc14.jar just contains the JDBC classes to talk to an Oracle database, and only programs written in Java (and other languages that run on the JVM such as Scala, Groovy or Clojure) can use it. This jar on its own not enough to be able to set up an ODBC data source.
Oracle currently has 1 version that is certified for windows 7. That version is 11.2. They have indicated that they plan to certify 10.2.0.5 if this happens there will likely be a patch that will be needed.
This is probably why the Data Source does not work, either ODBC or OLEDB.
Another possibility is that you have installed the 32bit version of Oracle and your OS is 64bit then you would need to use the 32bit Data Source administrative tools.
I have figured out the solution for my problem. All that I needed to do is put ojdbc14.jar file in my class path and then I was able to use it. Though by doing so, I needed to make some change in the code. I was no more able to use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") instead I needed to use Class.forName("oracle.jdbc.OracleDriver") also instead of using my data source as "jdbc:odbc:somename" I needed to use jdbc:oracle:thin:#localhost:1521:xe.