My DataGrip IDE can't find MERGE function even though it is in postgresql 15.1 - datagrip

because of the interest we have in postgresql 15, my team and I would like to migrate to this new version. As we work with docker, I loaded the postgres:15 image instead of the old postgres:13 image and got it on my PC.
Now my problem is that I can't find a way to use Postgres:15 on my DataGrip IDE.
I can still write postgresql 14 code in DataGrip.
select version();
in a query console in DataGrip gets me version 15.1 version response but new commands such as MERGE can't be found by the IDE.
I found out after some research that the old version persisted in a terminal call of psql so i deleted the old cluster because they had the same port and name and now when i call psql in a terminal, I can write in postgresql 15.1 but still not on DataGrip.

There's a plan to implement it from 2023.1: https://youtrack.jetbrains.com/issue/DBE-16310

Related

Oracle 12.2 - how to force APEX installation during database install?

Now that, since 12.2, Oracle no longer install APEX by default, is there a way to force the APEX installation during installation of the database? It's quite a pain having to manually re-install APEX after each 12c install.
One way you can accomplish this is by creating your own Database Template which includes APEX. Mike Dietrich has an excellent blog post about database templates here.
Keep in mind, that will install the version of APEX that is in the database home, which may not always be the latest version of APEX.
Whatever you do, I advise against installing APEX common (in CDB$ROOT), and only install it locally in a PDB.

How to dumping database created in Mac OS X with neo4j Desktop?

I have been trying to dump a database I have created using neo4j Desktop app version 3.3.0 on Mac OS X. The documentation said that I need to use neo4j-admin on command line. This was not installed as part of the Desktop version, so I installed neo4j v3.3.0 with homebrew, and got neo4j-admin.
But while running command:
neo4j-admin dump --database=graph.db --to=~/mydatabase.db
I always get the error:
command failed: database does not exist: graph.db
I have searched here and on google, and the only thing I found has been
Neo4j 3.2.3: dump command does not find database
But the answer there is quite vague and I am not too sure what it means, as I am new to neo4j. I gathered that the desktop version is not compatible with the command-line, and that one needs to stick purely with the command-line version, am I understanding this wrong?
I can find graph.db in:
$NEO4J_HOME/data/databases
But neo4j-admin seems to just refuse to find it, and setting the environment variables did not solve the problem. And I cannot supply a path to the database as neo4j-admin doesn't take paths.
If I know where neo4j-admin is trying to look for the database, then I can hopefully solve the problem by provide a symbolic link to it, but at the moment I have no idea where it is looking.
Any help would be greatly appreciated.
neo4j-admin is probably looking for graph.db in the same directory that your Homebrew Neo4j is installed. You can find out where that is by doing which neo4j-admin, then checking that directory with ls -al to see where Homebrew's actually storing the files.
It'll be somewhere like /usr/local/Cellar/neo4j/<version number>/bin, and by default (at least with Neo4j 3.1.1) it'll expect the database to be in /usr/local/Cellar/neo4j/<version number>/libexec/data/databases/.

What setting causes ENUM to be un-available in MySQL Workbench?

I'm trying to do a simple thing: add a column with datatype ENUM in a MySQL Workbench model. The problem is, the choice is just not there. I cannot select 'ENUM'.
If I open an old project or create a new one in the same Workbench I do have the choice, so it seems to be a setting, but I don't have a clue where to look. It's not some SQL thing, because an export and import (reverse engineer) in a new model also shows the ENUM columns.
To be clear: it is NOT that I'm typing something like enum(choice,choice2) and so generating a syntax error, the dropdown has no ENUM.
Tested on:
Mysql Workbench version: 5.2.47 CE (revision 10398) on Windows 7
Mysql Workbench version: 5.2.40 (revision 8790) on Ubuntu 13.04
Mysql Workbench version: 6.0 community (build 6.0.3.11035) (BETA) on Windows 7
Settings for all projects are the same ('default'), in my case
Default target mysql version: 5.5
Storage engine: InnoDB
SQL_MODE to be used: TRADITIONAL,ALLOW_INVALID_DATES
There seem to be several missing types, at least:
BIT
ENUM()
SET()
I consider this now an official "bug" and therefore a real solution will not be forthcoming.
Only thing you can do is start a new model, and re-create all your work there.

Debug PostgreSQL function using pgAdmin

I refer this to enable the debugger in the PostgreSQL server in order to debugging the plpgsql function by stepping through the code using pgadmin.
I have already set shared_preload_libraries = '$libdir/plugins/plugin_debugger.dll' in the postgresql.conf, run pldbgapi.sql , and restarted the server.
These steps should have been run successfully and plugin_debugger.dll should be loaded successfully as can be verified by using the command show shared_preload_libraries, and I can see the debugging option in the context menu with a right click on a function in pgAdmin.
When choosing "Debugging" --> Debug, a window pops up to allow me to enter the values for the input parameters. But after that, when I press OK, it does not respond at all.
Any ideas or did I miss something in the setup of the debugger on the server?
I am using PostgreSQL 8.3 and pgAdmin 1.14
You have to enable debugging in two places. On PGAdmin and on the database itself. That article you referenced does a wonderful job explaining it but there were some nuances.
PGAdmin
When updating your postgresql.conf file to load the debugging library, I was running PGAdmin on Windows so the file was here:
C:\Program Files\PostgreSQL\9.4\data\postgresql.conf
And the path to the plugin_debugger.dll was actually
$libdir/plugin_debugger.dll
not
$libdir/plugins/plugin_debugger.dll
as specified in the article. So your postgresql.conf would need a line like this
shared_preload_libraries = '$libdir/plugin_debugger.dll'
Search for the actual .dll if you're in doubt. If you're on Linux the file you'll be looking for is plugin_debugger.so. Don't forget that changing the postgresql.conf file will require a restart for the change to take effect.
PostgreSQL Database
Assuming you're running your PostgreSQL database on a Linux server this gist does an excellent job at explaining how to download the dependencies for enabling debugging. Make sure you're running as root when you install.
The part that's easy to miss is issuing the command against the actual database you want to debug. For newer versions on PostgreSQL all you'll need to do is this:
CREATE EXTENSION IF NOT EXISTS pldbgapi;
If that doesn't return an error, you should be good to go.
Some additional things of note:
As mentioned above, you can only debug when running as a super user account
From their docs you can only debug pl/pgsql functions. So if your function says something like LANGUAGE c PGAdmin won't even show a right-click Debug menu option when you select the function. Look for something that has LANGUAGE plpgsql and the Debug menu should show.
Ken,
Have you tried pgAdmin 1.8 to rule out issue with PgAdmin 1.14/ PostgreSQL 8.3 interaction. It's been a while since I've used 8.3 and for the article I wrote -- which you are referring to, I was testing with 1.14/ PostgreSQL 9.1 so it could very well be an issue with the interaction with older version. Unfortunately I don't have a 8.3 anymore to test with.
I vaguely remember having the issue you had once, but it was when I had another shared library in my postgresql.conf in addition to the pldebugger. Can't remember which one that was, but removing the other shared library fixed my issue.
Hope some of these suggestions help,
Regina
I had the same problem.
Make sure the only shared lib you´re loading in the postgres.conf is the debugger.
Nothing else. Not even the profiler.
If you get a SSL error when trying to debug a function, reconnect to the server.

Magento Upgrade Issue from 1.4.2 to 1.6

Error in file:
/usr/local/sites/client/magento_site/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'customer_form_attribute' already exists
I tried upgrading this using this tutorial from turnkeye to go from 1.4.1 -> 1.4.2 and then to 1.6 but after all the mage upgrading was complete, when I hit the website to upgrade the database I get errors about database tables that already exist and it appears to be running a database upgrade script for a version of magento before 1.4.2. I know this error is extremely common and I have seen many blogs posts about it and read all that I have found -- I see no resolution besides starting a fresh install.
I've heard people say this can happen if a previous upgrade didn't complete successfully but I don't think that is the case here -- I think it was a fresh install at 1.4.1 (at least I don't believe I ever upgraded it). Anyone know why this is happening or how to fix it?
Note 1: I also tried the upgrade by overwriting the 1.4.1 files via SSH with successive version of magento -- always the same database errors though. If I remove the mysql-upgrade script that is failing, then another one fails in its place with a simliar 'table already exists' error.
Note 2: I also made sure I cleared /var/cache and /var/session and even tried reindexing. No success.
Looks like it is just complaining about a table already existing. Either install a fresh version of you database from before you tried to upgrade then clear cache and sessions and try again
Or
Just open the file referenced and temporarly comment out the part that is installing the table again. That should allow you to by pass the error.
Then you can download the magento Database Repair Tool to ensure that your tables are correct.

Resources