How do I install pglogical extension on Windows machine? - pglogical

I need to migrate an enterprise production database from a Windows source machine running Postgres 9.5 to an Ubuntu destination machine running Postgres 11.6 with < 15 mins downtime. I plan to do this with pglogical, which requires the extension being loaded on both source and destination. I am having trouble with the source side because it is Windows.
I have very little Postgres-Windows experience and can neither find any helpful literature on the specific situation nor can I figure out for myself how to presumably install from source.

I've dug and dug and so far the only answer I've been able to find is "ugh... Windows". It seems like the only way to build from source is using Visual Studio, which I don't have or know how to use.
Sources:
https://www.2ndquadrant.com/en/blog/compiling-postgresql-extensions-visual-studio-windows/
https://postgrespro.ru/list/thread-id/1835275

Alex, the 2ndQuadrant article you link to in your own comment solves this. A few of the project or build options noted there have moved a little bit in the newer VisualStudio Community editions, so I can see where you got hung-up.
Just for kicks I compiled 32-bit DLL on my oldest Windows instance. I included the /Release path so you can grab my DLL & see if it works for you. It's (a) 32-bit because I'm assuming worst-case for an old v9.5 install, and (b) targets Postgres 9.6 because that's what I had installed. Unless there were major API changes though, it should connect to v9.5 without any issues:
https://github.com/mbijon/winpglogical/tree/master
If you find you need a version that entirely matches Postgres 9.5, grab my solution files & VS Community 20xx. Load the project & update the Additional Include Directories in Project Config to target your v9.5 paths. That should be all that's needed to link v9.5 Postgres libs.

Related

Native package of JavaFX 8 app with with javafx-maven-plugin on 32-bit Windows fails to load due to MSVCR100.dll missing

I am packaging my app into exe with javafx-maven-plugin. x64 version works well. But then I package x86 version on 32-bit Windows 7 (running in VirtualBox if that's important) with 32-bit JDK 1.8.0_161 and 32-bit Maven. The resulting application installs, but fails to run, claiming that MSVCR100.dll is missing even though it is in the runtime\bin folder. I googled around and found out that this is a JDK bug that was supposedly fixed way back in u40. So why does this still happen?
If I copy that dll manually next to the .exe it starts on one machine (again, in VirtualBox), but for some reason silently crashed on another (real one this time, fresh installation). Found an identical problem in javafx-gradle-plugin issues, though it got resolved when building on newest Win10 version, whereas I'm building on newest Win7.
If I just install Microsoft Visual C++ 2010 Redistributable Package then everything works, obviously, but I don't want user having to do that. So how do I copy .dll with Inno Setup script and how do I figure out the reason behind silent crashing?
I don't think this is related to Windows being 32 bit and it just happens to coincide with your two testing computers. I posted a question that is related here: Failed to find library: jvm.dll. What's going on here?
What you are experiencing is likely a bug on java(fx)packager as described here: https://bugs.openjdk.java.net/browse/JDK-8191176. That bug report claims the bug started on 8u155 and was solved by 8u171 but I am experiencing the bug all the way to the latest 8u172 b03 as I describe here: https://github.com/javafxports/openjdk-jfx/issues/59
I also tried going to 8u144 before the bug existed and I found that building the installer fails because of a missing MSVC dll (surprise! surprise!). I described the problem here: Where/how to get the MSVC dlls Java 1.8.0_144 wants?
There may be another .dll on which MSVCR100.dll depends and which is not present on specific machine.
That is a reason why the Redistributable Package installs everything together.
Try to find another dependencies using http://dependencywalker.com/, it looks like you need more dlls than MSVCR100.dll.
Or simply install Redistributable Package on each machine. Installing it multiple times does not harm any application or system.

Installing 32 and 64-bit Oracle client but 32-bit installer crashes

I am trying to install Oracle 12c instant 32-bit client alongside my 64-bit installation because I can't connect Visual Studio to the 64-bit version (throws BadImageFormatException). I run the installer and give it another directory for home, so it's like this:
64-bit: D:\app\MyUser\product\12.1.0\dbhome_1 (previously installed)
32-bit: D:\app\Lazar\product\12.1.0\dbhome_x84
The installer performs the checks and sends me to next step. I click install and it crashes!
Can someone please help?
I've actually run into the same problem. It looks like it is some sort of issue with the registry.
It appears to be a missing registry entry for the location of the Oracle Inventory. The below blog explains the following steps to add the missing registry key:
Open regedit
Go to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
Create a new key with name "Oracle"
Go to Oracle and then create a new String Value with name "inst_loc"
Give the value as "C:\Program Files (x86)\Oracle\Inventory"
Retry installation
This blog post has more detail on the fix (though not much) and is where I originally found my solution.
https://oracledba1949.wordpress.com/2016/03/11/oracle-12-1-0-2-32bit-client-installation-on-windows-2012-x64bit/
I also had the same issue and finally realized that Oracle installer doesn't support both 64bit and 32bit versions alongside. At least as you have mentioned in the question, it has got a bug. Here how I resolved the problem.
Hence both 64bit & 32bit versions unable to install alongside, first, uninstall the 64bit version.
Run the command %ORACLE_HOME%\deinstall\deinstall.bat
If any errors occur while uninstall, refer to the log and correct accordingly.
Recommend to restart the computer.
Install the 32bit version.
This will resolve your problem.

Adaptive server anywhere ASA SqlAnywhere 8.0 ODBC driver

Well, I've searched the interwebs like crazy and I am unable to find this driver.
I am trying to convert data from a client's database that was built using the ASA 8.0 engine. ASA 8 has been out of support since 2008. The software company that created this no longer supports it, so can't provide me with the drivers. I've scoured the web and can't find anything.
I managed to get the installation files for this old software called BailCredit built by a company called SentryLink. I found what I presume to be the ODBC driver in the installation files (dbodbc8.dll) and I've tried manually registering that (Windows Server 2008 R2) but didn't get anywhere. When I try to create a new datasource, the ODBC Data Source Administrator gives me an error.
My company has done hundreds of data migrations and this is the first time I've had to resort to this.
I'd post a link to the database file, but simply can't because of privacy.
Please help if you can! Thanks in Advance.
Matt
For 64 Bit operating system you need to copy the dll's to %windir%\syswow64\ so you need to change install.cmd to the following code. The rest is the same.
COPY %~dp0dbcon8.dll %windir%\syswow64\dbcon8.dll
COPY %~dp0dblgen8.dll %windir%\syswow64\dblgen8.dll
COPY %~dp0dbodbc8.dll %windir%\syswow64\dbodbc8.dll
regedit %~dp0SAS8.REG
pause
It take's me a few hours to figure it out i hope it help someone else.
This is how I finally solved it.
OPTION 1:
Get a copy of the following files from a computer with a working setup of the SQL Anywhere ODBC driver:
dbodbc8.dll
dbcon8.dll
dblgen8.dll
Create an install.cmd file with this:
COPY %~dp0dbcon8.dll %SystemRoot%\system32\dbcon8.dll
COPY %~dp0dblgen8.dll %SystemRoot%\system32\dblgen8.dll
COPY %~dp0dbodbc8.dll %SystemRoot%\system32\dbodbc8.dll
regedit %~dp0SAS8.REG
pause
Create an SAS8.REG file with this:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Adaptive Server Anywhere 8.0]
"Driver"=hex(2):25,00,57,00,49,00,4e,00,44,00,49,00,52,00,25,00,5c,00,73,00,79,\
00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,62,00,6f,00,64,00,62,00,\
63,00,38,00,2e,00,64,00,6c,00,6c,00,00,00
"Setup"=hex(2):25,00,57,00,49,00,4e,00,44,00,49,00,52,00,25,00,5c,00,73,00,79,\
00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,62,00,6f,00,64,00,62,00,\
63,00,38,00,2e,00,64,00,6c,00,6c,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"Adaptive Server Anywhere 8.0"="Installed"
Run install.cmd
This will work when Windows is installed in C:\WINDOWS, otherwise edit the registry entries.
OPTION 2:
If someone left a copy of the Powerbuilder CD in the client's computer, look for the folder asa801runtime and install that to get the ODBC driver working
EDIT:
Example connection string with default username/password:
Driver={Adaptive Server Anywhere 8.0};UID=dba;PWD=sql;DatabaseName=base;EngineName=gestion;CommLinks=TCPIP(HOST=GRA06:2638)
Answering my own question:
I wasn't able to find this commercially available anywhere. I happened to be able to get my hands on the installation for the software package that was using SQLAnywhere 8. By installing this, it installed the necessary drivers (but only worked on 32-bit OS).

How can I enable auto-updates in a Qt cross-platform application?

I love applications that are able to update themselves without any effort from the user (think: Sparkle framework for Mac). Is there any code/library I can leverage to do this in a Qt application, without having to worry about the OS details?
At least for Windows, Mac and user-owned Linux binaries.
I could integrate Sparkle on the Mac version, code something for the Linux case (only for a standalone, user-owned binary; I won't mess with distribution packaging, if my program is ever packaged), and find someone to help me on the Windows side, but that's horribly painful.
It is not a complete solution, but a cross-platform (Windows, Mac, Linux) tool for creating packages for auto-updates and installing them is available at https://github.com/mendeley/Update-Installer. This tool does not deal with publishing updates or downloading them.
This was written for use with a Qt-based application but to make the update installer small, standalone and easy to build, the installer uses only standard system libraries (C++ runtime, pthreads/libz/libbz2 on Linux/Mac, Win32 API on Windows, Cocoa on Mac, GTK with fallback on Linux). This simplifies delivering updates which include new versions of Qt and other non-system libraries that your application may depend on.
Before considering this though, I would suggest:
If you are only building for two platforms, consider using standard and well-tested auto-update frameworks for those platforms - eg. Sparkle on Mac, Google's Omaha on Windows or auto-update systems built into popular install frameworks (eg. InstallShield). I haven't tried BitRock.
On Mac, the Mac App Store may be a good option. See https://bugreports.qt.io/browse/QTBUG-16549 though.
On Linux, consider creating a .deb package and a simple repository to host it. Once users have a repository set up, the system-wide software update tools will take care of checking for and installing new releases. The steps for setting up a new repository however are too complex for many new Ubuntu/Debian users. What we did, and also what Dropbox and Google have done, is to create a .deb package which sets up the repository as part of the package installation.
A few other notes on creating an updater:
On Windows Vista/7, if the application is installed system-wide (eg. in C:\Program Files\$APPNAME) your users will see a scary UAC prompt when the updater tries to obtain permissions to write to the install directory. This can be avoided either by installing to a user-writable directory (I gather that this is what Google Chrome does) or by obtaining an Authenticode certificate and using it to sign the updater binary.
On Windows Vista/7, an application .exe or DLL cannot be deleted if in use, but the updater can move the existing .exe/DLL out of the way into a temporary directory and schedule it for deletion on the next reboot.
On Ubuntu, 3rd-party repositories are disabled after distribution updates. Google works around this by creating a cron-job to re-add the repository if necessary.
Shameless plug: Fervor, a simple multiplatform (Qt-based) application autoupdater inspired by Sparkle.
Shameless plug: this a relatively old question, but I thought that it may be useful to mention a library that I created recently, which I named "QSimpleUpdater". Aside from notifying you if there's a newer version, it allows you to download the change log in any format (such as HTML or RTF) and download the updates directly from your application using a dialog.
As you may expect from a Qt project, it works on any platform supported by Qt (tested on Windows, Mac & Linux).
Links:
Website
GitHub repository
Screenshot:
Though it works a bit differently than Sparkle, BitRock InstallBuilder contains an autoupdater written in Qt that can be used independently (disclaimer, I am the original BitRock developer). It is a commercial app, but we have free licenses for open source projects.
I've developed an auto-updater library which works beautifully on Mac OS X, Linux and pretty much every Unix that allows you to unlink a file while the file is still open. The reason being that I simply extracted the downloaded package on top of the existing application. Unfortunately, because I relied on this functionality, I ran into problems on Windows as Windows does not let you unlink an open file.
The only alternative I could find is to use MoveFileEx with the replace on reboot flag, but that is awful.
However, renaming the working directory of the application works on Windows 7 and Windows XP. I haven't tried Windows Vista yet.
I have found WebUpdate to be quite useful, though it's written with the wxWidgets. But don't worry, it's a separate app which handles your updates. The steps to integrate it are pretty simple - just write two XML files and run the updater. And yes, it's cross-platform.
The advantage of it is it will automatically download and unzip/install all you required and not just provide a popup with a notification about a new version and a link to download it. Another thing you can do with it is customizable actions.
Project's main page is here, you can read the docs or take a look at the official tutorial.
The blog post Mixing Cocoa and Qt may solve the problem for the Mac platform.
You can use UpdateNode which gives you all the possibilities to update your software. It's using a cross platform Qt client and is free for Open Source!
UPDATE
Just did some further analysis on that and really like this solution:
Pros:
Free for Open Source!!! Even the client is Open Source: https://github.com/updatenode/unclient
The client is already localized in several languages
Very flexible in terms of updates. You can even update single non-binaries.
Provides additionally a way to display messages though the client.
Ready to use binaries & installer for all common Linux distributions, single Windows binary, as well as installer and a solution for Mac (which I have not tried, as I don't have a Mac)
Easy to use web service, nice statistics and update check is integrated within few minutes
Cons:
I am missing a multi-user management in the online service. Maybe they will do it in future - I will definitely suggest that in their feedback portal
The client is a GUI client only - so, you will need to shrink it down to run without a GUI frontend (maybe only necessary for people like me ;-) )
So, bottom line, as this solution is quite new, I think there is lot of potential here. I will definitely use it in my project and I am looking forward for more from them! Thumbs up!
This is an old question but there is not Squirrel in answers which is BEST SOLUTION , here is what I'm doing in qt 5.12.4 with qt quick "my qml app" you can do this in any other language
I'm doing this in windows there is mac version of squirrel too, I don't know about Linux
download nuget package explorer release
https://github.com/NuGetPackageExplorer/NuGetPackageExplorer/releases
open nuget package explorer and add this directory 'lib/net45' it doesn't matter you have a .net app or not, I did this for my qt application otherwise it won't work.
add all files into this folder specify your version in the metadata
save nupkg file
download squirrel release https://github.com/Squirrel/Squirrel.Windows/releases
add squirrel to windows environment path
open cmd and cd to directory of nupkg file
squirrel --releasify file_name.nupkg -> now inide releases folder, there should be setup.exe file which will install app and other files.
to create new version do 2,3,4,7,8 again if its an update it will create delta file which is only needed file to update, put this files into your service directory for example in updates folder of your website which you need to disable directory browsing in IIS , and to auto-update application you need to call Update.exe which is in parent folder of application root directory appdir/../update.exe --update http://yourserver.com/upates/ after application restart app should start with new version
you can find documentation for squirrel in https://github.com/Squirrel/Squirrel.Windows/blob/develop/docs/getting-started/0-overview.md and nuget package explorer here https://github.com/NuGetPackageExplorer/NuGetPackageExplorer and you can use only nuget.exe too if you don't want to use nuget package explorer which can be used for dynamic generation of versions, which can be download from https://www.nuget.org/downloads
That easy. Now you have auto-update app which will download updates from the server and auto-update app. For more info you can read documentations.
note: for iis uses https://github.com/Squirrel/OldSquirrelForWindows/issues/205
I suggest you read on plugin and how to create and use them. If your application architecture is modular and be split into different plugins. Take a look at Google Auto Update utility http://code.google.com/p/omaha/. We use this.
Thibault Cuvelier is writing a tutorial (in French) to develop an updater. I know the explanations are in French (and everyone is not understanding French), but I think this can be readable with a web translator like Google Translate. With this you will have a cross-platform updater, but you need to write it by yourself.
For what I know, the only part of the updater that is explained in the tutorial, is the file downloading part. In the case this can help you, refer to the tutorial, Un updater avec Qt.
I hope that helps.
OK, so I guess I take it as a "no (cross-platform) way". It's too bad!
I have found a solution that can be automated with built-in self-extracting patches and updates. for windows. I have started using their sdk. take a look at the massive documentation here, https://agersoftware.com/docs/ the sdk is called securesdk and comes with their app, SecureDelta sdk. does a great job on any kind of files, better results than lzma-included delta updaters

When installing an ODBC driver, Windows Installer keeps putting it in SystemFolder

I'm working on an installer that, among other things, installs a web server.
As part of the setup, I'm setting up an ODBC driver and data source. I'm
trying to put a bunch of utility files, including the third party ODBC driver DLL,
into a certain folder, but when I run the installer, it insists on changing
that directory to the SystemFolder directory. Why is it doing this, and is
there any way that I can make it install the files where I want them to go?
Strangely enough, it was actually working correctly up until I added a bunch
more files to that particular folder. In case it's relevant, the files that I'm having trouble with are in a merge module.
(I'm temporarily getting around the problems that this is causing by
installing the DLL to the SystemFolder, but I'd much rather avoid DLL hell by
having it installed where I want it to go, not where Windows Installer seems
to think it should go.)
I should also point out that I'm using Wise Installation Studio 7.0 as my development environment.
It would seem that it's not Windows Installer that insists on the ODBC Driver DLL being installed in the SystemFolder directory, but Wise. We found this solution for getting rid of an Error 1918 problem that we were also seeing, which says to take the driver entries out of the ODBCDriver table, and stick them in as Registry entries instead. After implementing that fix, we tried moving our DLL to where we really want it to be installed, and the installer was happy with that.

Resources