Firebird 2.5 reports "is not a valid database" although it is - firebird

I've got two computers both running Firebird (let's called them A and B) and two database files (let's call them a.fdb and b.fdb), both copied to both computers. On B I get the message
b.fdb is not a valid database
The other files work, on A both files work.
This would be easy to explain, if B was an older version, but it's a newer one (it was FB 2.1, and because of this problem I installed FB 2.5). The files a.fdb and b.fdb have ODS 11.1 and 10.1, respectively. It looks like new versions of FB wouldn't support ODS 10.1 anymore, which I can't believe. But I see no other explanation, can you?

I had the same problem with an old database.
In my case even the gbak command presented the "is not a valid database". (I also tried with the FIX_FSS_METADATA option)
I found that if the database was created in an 32bits environment it can't be opened in a 64bits one.
So, what I had to do was:
Create a VM with a 32bits environment (in my case I created a VM with Windows XP)
Copy the database to this VM and make a backup using GBAK
Copy the backup file to my machine (64bits)
Run a restore using GBAK
After all this I could open the database again.
Hope it helps!

Try to make backup and restore of database.

In my case I can't open a database whose was created in 32 bits in a 64 bits, so try to install firebird in 32 bits

Related

Find libpq.dll version running on my pc for compiling against Postgres database

I just compiled a new version of an executable file developed with DELPHI (XE6) running against Postgres 11.8 database.
In order to distribute it, I believe I have to distribute the same version of libpq.dll that the program was compiled with, and simple as it seems, that is my problem, that among the many versions of libpq.dll that I have in my computer I don't know what is the actual one that Delphi is running locally and compiling with.
I tried to distribute the new version of the .exe file only (trying to run against the old version of libpq.dll) over the previous distribution, and it did not work (Throws an error when trying to open the first DB table)
The story is that I am new working with this program (And with Delphi also); There is a previous version of the program distributed on many PCs and working fine, I am just trying to distribute the new version that works fine on my PC. I installed 11.8 version of postgres (From the 9.5) on the server and the program distributed on all PCs kept working fine after the database actualization.
Thank you in advance any help will be kindly welcome.
You can find the version of the libpd.dll that your Delphi application load by using ProcessExplorer.
Run your program, connect to the database to be sure the DLL is loaded. Then run ProcessExplorer, find your application in the list, select it. Then use the tool to show all DLL loaded by your application. Locate libpq.dll in the list and right click properties. You'll get the info you want.
btw: You can also use ProcessMonitor to track which DLL is loaded, discover his path and then looking at the properties.
One way to obtain the version of a dll is get it from its version resource, like this:
function GetDLLVersion(const FullPathToDLL:string):string;
const
dSize=$400;
var
d:array[0..dSize-1] of byte;
p:PVSFixedFileInfo;
l:cardinal;
begin
if GetFileVersionInfo(PChar(FullPathToDLL),0,dSize,#d[0]) then
if VerQueryValue(#d[0],'\',pointer(p),l) then
Result:=Format('%d.%d.%d.%d',[
p.dwProductVersionMS shr 16,
p.dwProductVersionMS and $FFFF,
p.dwFileVersionLS shr 16,
p.dwFileVersionLS and $FFFF]);
end;

Changing installation directory of installed DB2 in AIX 7.1

I have installed DB2 10.1 in AIX 7.1 at /opt/IBM/db2/V10.1. But there is a script which is expecting DB2 at /opt/db2_10_1.
I am not sure if it is possible to change the directory of an installed software and if I do it, what are the points I have to keep in my mind before performing this step.
FYI- I am not an AIX or DB2 expert. I am just performing this task as instructed.
Did your instructions specify a non-default path for the Db2-installation?
(The path /opt/IBM/db2/V10.1 is a typical default for AIX )
Do not manually hack to change the installation directory of Db2, just because a script is badly written! Responsible admins would never allow such mistakes on production environments.
It is an error for a script to hard-code a Db2-installation path. That script should be coded correctly to determine the Db2-installation path, or to have that information provided via configuration or arguments.
A possible option is to create a symbolic link so that /opt/db2_10_1 points to the real path at /opt/IBM/db2/V10.1 , but this is not guaranteed to work for all situations, it depends on how badly written is the script - so other different errors may appear later from that script (although Db2 itself will function normally).
A separate matter is that it is unwise to install a Db2 version that is already out of support (end of life). Does the business understand the consequences of installing an out-of-support version? (unless the business has purchased an extended support contract from IBM).
You have to make new install
stop instance
rename sqllib directory
recreate instance using db2icrt in new binaries in install directory
import catalogued database with db2cfimp previously exported using db2cfexp

psql binary file missing- is there any way of replacing it without unistall/reinstall of Postgres?

I've had as few issues trying to upgrade postgresql-server. I've reverted back to the older version now (9.0.3) and the service is running and accessible via pgadmin/other gui tools.
However, I can't access it via the psql command (as user postgres). This may be possibly because the psql binary seems to be missing. I feel this may have happened when I uninstalled a version of postgres that I had intended to revert to.
I can't reinstall version 9.0.3 because the repo is no longer valid.
Is there any way I can install only the psql binary file and nothing else. I was considering copying the psql binary file from another server, although because the other servers have different versions of postgresql, I'm not sure if this is a good idea (?)
I think psql binaries didn't disapear from your system.
It's just that you had symbolic links from /usr/bin to your 9.0.3 binaries.
When you installed a newer version, this links where replaced to point to the new version and when you uninstalled it, they were dropped.
Try locate to find your binaries. Then you would be able to recreate your symbolic links in /usr/bin.
If you want to try 9.0.3 - you can always build it from source:
https://www.postgresql.org/ftp/source/v9.0.3/
But many distros package pqsl-client seperate from the server and you can use a newer version of psql instead (or at least try).
There are also archives of almost any distro out there and you could fetch that single rpm/deb packge from there.

pgadmin4 : postgresql application server could not be contacted.

I have installed PostgreSQL 9.6.2 on my Windows 8.1. But the pgadmin4 is not able to contact the local server. I have tried several solutions suggested here in stackoverflow, tried to uninstall and reinstall PostgreSQL 9.6.2 , tried to modify the config.py, config_distro.py, and delete the files in Roaming folder,i tried standalone pgadmin4 installation, but no success.However, in my local machine i am able to access the server using psql.exe and log as as superuser (postgres user). Can you please suggest any possible solutions to starting/running pgadmin4 ? Thank you.
I found the same issue when upgrading to pgAdmin 4 (v1.6). On Windows I found that clearing out the content inside C:\Users\%USERNAME%\AppData\Roaming\pgAdmin\sessions folder fixed the issue for me. I believe it was attempting to use the sessions from the prior version and was failing. I know the question was marked as answered, but downgrading may not always be an option.
Note: AppData\Roaming\pgAdmin is a hidden folder.
Start pgAdmin 4 as administrator.
Do the following steps:
Right click pgAdmin 4 icon
Select "Run As Administrator"
I had the same issue on Windows 10, with a new installation of PostgreSQL 10.
I solved it by including the path C:\PostgreSQL\10\bin ({your path to postgresql}\bin) to system environment variables.
To access environment variables: Control Panel > System and security > System or right click on PC, then > Advance system settings > Environment variables > System variables > Path > Edit.
I've been dealing with this for awhile (frustrating). So much that I have instructions on my desktop consolidating all of these ideas. Here is my magic combination to the solution:
Delete from App Data C:\Users\%USERNAME%\AppData\Roaming\pgAdmin
Add to Path Variables C:\Program Files\PostgreSQL\9.6\bin (I actually added it to both user and system)
Right click and start as admin.
You don't have to do this every time but when it gets out of wack try these steps.
What finally worked was downgrading to pgadminIII-v.1.22:
It seems in most of the cases Postgres trying to use information from previous sessions to find/connect the server and failing. Clearing out the previous session info helped me, it is a combination of 2 already mentioned answers above:
Navigate to Postgres session's folder
C:\Users\YourUsernameOrAdmin\AppData\Roaming\pgAdmin\sessions
Delete all the data from this folder.
Start PgAdmin in administrator mode.
Cheers!
if you are using Mac OS X here is a fix:
Open terminal and run this command
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log restart
and for other OS just restart your Postgresql server, it will solve
Then start pgAdmin4, it will start as normal
Share or comment if saved someone
Deleting the contents of C:\Users\%USERNAME%\AppData\Roaming\pgAdmin directory worked for me!
I had same issue on windows. I had v1.6 installed as well as v2.0. Uninstalling v1.6 allowed me to login.
I had the same problem, but running it as an admin worked.
Have you recently installed a new version of pgAdmin ?
This issue (and the misleading message) is simply due to the fact that old versions of pgAdmin are unable to read the settings saved by a newer version of pgAdmin !
Make sure you're starting the right version of pgAdmin (your shortcuts are likely to point to the old version !) and/or uninstall the old version: the upgrade wizard doesn't do it for you !
Deleting contents of folder C:\Users\User_Name\AppData\Roaming\pgAdmin\sessions helped me, I was able to start and load the pgAdmin server
I had the same issue on the macosx and I renamed .pgadmin (in /users/costa) to .pgadminx and I was able to start pgAdmin4.
In Windows Just go to this path and clear it
,that works !!
C:\Users\%USERNAME%\AppData\Roaming\pgAdmin
I was able to solve the problem by changing the pgAdmin web interface port.
I believe this problem occurred on my computer because I have several other services consuming webs ports like qBittorrent, IDEJetbrains, etc.
Right-clicking on the pgAdmin logo near the clock is possible to configure it.
I Fixed it in windows 10 just running pgAdmin 4 as Run as Administrator .
If you use older postgresql version like 9.x and its services is running,PgAdmin 4 confused which server is base database.
So stop the service older version or new one.Run PgAdmin 4 as Administrator
Its worked for me
This is often a firewall problem. The firewall log then shows dropped packets between 127.0.0.1: and 127.0.0.1:, where the latter is the port shown in the Browser to get no connection with. This means, that the connection between pgAdmin client (high_port_1) and pgAdmin server (high_port_2) is blocked. Check your firewall log and if you find dropped packets like described, adapt your firewall settings accordingly.
If none of the methods help try checking your system and user environments PATH and PYTHONPATH variables.
I was getting this error due to my PATH variable was pointing to different Python installation (which comes from ArcGIS Desktop).
After removing path to my Python installation from PATH variable and completely removing PYTHONPATH variable, I got it working!
Keep in mind that python command will not be available from command line if you remove it from PATH.
I use the cmd prompt on Windows 10 with psql postgres postgres.
Then I launch pgAdmin4 and it works.
I had this problem with pgadmin4 v2.1 on linux fedora 27
Solved by installing a missing dependency:
python3-flask-babelex
Just click on that pgadmin 4 icon and run as administrator. Allow the access permissions. It will start locally.
I need to add this here because I've had several issues with this message. If you have recently upgraded to High Sierra you will find the latest (pgadmin 4.20) will keep appearing with the message "Application Server Could Not be Contacted". What this actually means on Macs is that python was unable to configure your environment in ~/.pgadmin
This directory stores all the things you setup and configure and even logs of what was ran on your user copy usage of pgadmin.
The way to fix this issue on High Sierra is down to sqlite3. If you look in that directory you'll see everything is stored in sqlite3 files.
When version 4.20 of pgadmin was released it was shipped with a version later than sqlite3.19 and the problem arises because High Sierra is shipped with sqlite3.19, so to fix this issue, you need to replace the old version of sqlite3 with the latest on your packager.
Now be aware, MacosX+ all use sqlite to store details for the majority of apps on your mac, so you'll need to make sure you do not just wipe the old version but you'll have to have both versions co-existing together in harmony to avoid anything major occurring on your mac.
1) download brew https://brew.sh/
2) update brew and upgrade brew to make sure it's up-to-date
3) brew install sqlite3
4) mv /usr/bin/sqlite3 /usr/bin/sqlite3.os
5) ln -s /usr/local/Cellar/sqlite/3.21.0/bin/sqlite3 /usr/bin/sqlite3
6) /usr/bin/sqlite3 -version (check version is later than 3.19)
You can now proceed to open up pgadmin as normal
Got this issue after I upgraded PostgreSQL 9.4 to 9.6. The 9.4 binary package had PgAdmin 3 while 9.6 came with PgAdmin 4. I resolved it after a clean installation (I completely uninstalled and reinstalled) of PostgreSQL.
However, under different circumstances, you could try running the pgAdmin 4 application as an Administrator. This should fix the error.
downloaded pgadmin 4 v2.0 and install it no problem atm on force installation. try it. that was solution for me.
For my case in Windows 10 for postgresql 10 version, it worked by changing SERVER_MODE to False in config_distro.py placed in web folder, as per these configuration settings: https://www.pgadmin.org/docs/pgadmin4/dev/desktop_deployment.html.
There are other settings mentioned in this answer (https://superuser.com/a/1131964) regarding python but I just changed SERVER_MODE and it worked.
Kill it in Windows Task Manager and then try again. It seems that there is some sort of a problem when accessing the server from different applications.
As for me on windows 2012r2 it's start to work only after I reinstall pgAdmin 4 to folder c:\pgAdmin4. With out spaces and any special chars.
And all so I give full permission to this folder in NTFS.
It worked for me after installing python2.7 for pgAdmin 4 v2
Happens mostly when you have multiple versions of pgadmin installed or while trying to upgrade. Even I tried everything from killing the "running PID on port 5432" to "changing the server mode". In my case I uninstall postgres and re-install it again on different port(5433).
Later, I opened it through cmd(right click on cmd and select "run cmd as an Administrator").

postgres odbc connection fails

I am trying to set up a new postgres odbc connection for an application.
This is done on 32-bit Windows 7 system. I installed latest postgresql 9.6 & psqlodbc 0905, and there were no errors. When I add the odbc connection string and test connectivity with postgres login, it fails with the following error:
Test connection failed because of an error in initialized provider.
Specified driver could not be loaded due to system error 182:
(PostgreSQL UNICODE, C:\Program
Files\psqlODBC\0905\bin\psqlodbc35w.dll)
Here's the connection string:
Driver={PostgreSQL
UNICODE};Server=127.0.0.1;Port=5432;Database=postgres;
Uid=postgres;Pwd=postgres;
I then installed Visual C++ redistributable packager versions 2008 and 2010 later. Rebooted the box. Still same issue.
Postgres + odbc + other installs were complete and without any errors.
This is getting too frustrating.
Please.. any ideas on how to fix this will be helpful.?!
Update: I have tested the following:
1. Installed older postgres & psdqlodbc version
2. Added psqlodbc path to PATH env variable at the start
3. Uninstalled standalone psqlodbc installs, and installed Stackbuilder from postgresql package to download and install psqlodbc component.
All of these have not not been any useful.
Final Update: I was able to fix this by using psqlodbc_09_03_0400. For whatever reason, other versions kept throwing error.
Apparently, according to the Microsoft index of error codes, error 182 means ERROR_INVALID_ORDINAL, which with the help of this answer I believe means that the postgresql ODBC driver is loading another DLL and trying to call a function within it that does not exist.
The most likely cause for this would be that the system is loading a wrong version of a DLL on which psqlodbc depends. In fact I found this thread where someone else was having the same issue (although back in 2005).
This could happen if you had installed some other package containing one of the DLLs that psqlodbc relies on, or maybe even another version of psqlodbc.
Try changing the windows search path to put the directory containing the psqlodbc drivers at the front to confirm if this is the case. If that works you might want to try to narrow the problem down until you can find exactly what DLL is conflicting, and if possible remove it.
It is also possible that there is some packaging issue with the psqlodbc package you are using - if that is the case you could try uninstalling that one and installing an earlier version.
Final Update: I was able to fix this by using psqlodbc_09_03_0400. For whatever reason, other versions kept throwing error.