MERGE with Postgresql 11 - postgresql

Wanted to know if PostgreSQL 11 does support MERGE or not.
I read on following articles -
https://wiki.postgresql.org/wiki/SQL_MERGE
https://wiki.postgresql.org/wiki/SQL_MERGE_Patch_Status
Path overview says that - "Patch for SQL Standard MERGE statement has been submitted to PostgreSQL core"
I also find out other answers here, but all of them for older version only, please help me identify if MERGE functionality is implemented with PostgreSQL 11 or not?

Related

How can I differentiate odoo databases according to odoo version?

In my system I have all those databases which falls under openerp version 7, 8 and 9. I want to differentiate them and take only those databases which falls under odoo version 8. I have checked in postgres files as well as in .openerp-server file. But I didn't get any thing which can help me. How to differentiate the databases?
AFAIK there is no obvious place in the database to look for that.
It would be possible to write a script that would inspect the data model looking for known differences between versions to detect the corresponding one.
But no such tool exists at the moment.
Personally, I solve this by always including the version number in the database name, such as dev-v8 or dev-v9.
Here is an answer..
You can execute following query :
SELECT * FROM ir_module_module WHERE name='base' AND latest_version like '9.%'

Find the host name in postgresql [duplicate]

This question already has an answer here:
Find PostgreSQL server hostname on which it runs
(1 answer)
Closed 8 years ago.
Is it possible with easy syntax like MS SQL Server do
SELECT HOST_NAME()
in postgresql 9.3.2?
I have read some articles but no result !
No, the default build doesn't have that. It is easy however to extend PostgreSQL with new native functions and someone already did it: http://pgxn.org/dist/hostname/ .
Another way would be to install an additional db language (PostgreSQL is great like that - you have the option of using arbitrary languages instead of pl/pgsql) and use the language's own functions to do that. There are e.g. pl/python (http://www.postgresql.org/docs/9.1/static/plpython-funcs.html) and pl/perl (http://www.postgresql.org/docs/9.1/static/plperl-trusted.html -- see also the discussion about trusted and untrusted languages).

Comparing Oracle 10g and Oracle 11g Schema

I have a task at hand wherein we need to compare two database schemas at two different versions.
Actually an application has been upgraded to use Oracle 11g , older version of the application used Oracle 10g. Basically what needs to be checked is the differences in the schemas of the two different versioned applications mainly to check if no functionality is broken or no relevant schema change is missed
I did some R&D and found many tools are available to compare schemas, DB Solo etc. But my requirement being to compare two schemas at 2 different versions. The tools are available to compare schemas at same version.
Some of the solutions I came up with after having discussions with seniors
1) establish a DB link between the 2 DB schemas and do a comparison of USER_OBJECTS. This solution is however not feasible for us.
2) If we can get a TEXT like dump of both the schemas, a basic text comparison would give the schema differences.
However, I do not know how Solution 2 would be possible.
I have seen some older posts like
Compare two schemas and update the old schema with the new columns of new schema but I need a more simplistic solution!
Your help is appreciated.
Did you already try "Tools"->"Database Diff" from Oracle SQL Developer ?

Communicating with Informix from PostgreSQL? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Please help me to setup connectivity from PostgreSQL to Informix (latest versions for both). I would like to be able to perform a query on Informix from PostgreSQL. I am looking for a solution that will not require data exports (from Informix) and imports (to PostgreSQL) for every query.
I am very new in PostgreSQL and need detailed instructions.
As Chris Travers said, what you're seeking to do is not easy to do.
In theory, if you were working with Informix and needed to access PostgreSQL, you could (buy and) use the Enterprise Gateway Manager (EGM) and use the ODBC driver for PostgreSQL to allow Informix to connect to PostgreSQL. The EGM would do its utmost to appear to be another Informix database while actually accessing PostgreSQL. (I've not validated that PostgreSQL is supported, but EGM basically needs an ODBC driver to work, so there shouldn't be any problem — 'famous last words', probably.) This will include an emulation of 2PC (two-phase commit); not perfect, but moderately close.
For the converse connection (working with PostgreSQL and connecting to Informix), you will need to look to the PostgreSQL tool suite — or other sources.
You haven't said which version you are using. There are some limitations to be aware of but there are a wide range of choices.
Since you say this is import/export, I will assume that read-only options are not sufficient. That rules out PostgreSQL 9.1's foreign data wrapper system.
Depending on your version David Fetter's DBI-Link may suit your needs since it can execute queries on remote tables (see https://github.com/davidfetter/DBI-Link). It hasn't been updated in a while but the implementation should be pretty stable and usable across versions. If that fails you can write stored procedures in an untrusted language (PL/PythonU, PL/PerlU, etc) to connect to Informix and run the queries there. Note there are limits regarding transaction handling you will run into in this case so you may want to run any queries on the other tables using deferred constraint triggers so everything gets run at commit time.
Edit: A cleaner way occurred to me: use foreign data wrappers for import and a separate client app for export.
In this approach, you are going to have four basic components but this will be loosely coupled and subject to proper transactional controls. You can even use two-phase commit if you want. The four components are (not providing a complete working example here but at least a roadmap to one):
Foreign data wrappers for data import, allowing you to see data from Informix.
Views of data to be exported.
External application which manages the export aspect, written in a language of your choice. This listens on a channel like LISTEN export_informix;
Triggers on underlying tables which make view of data to be exported which raise a NOTIFY export_informix
The notifications are riased on the commit and so basically you have two stages to your transaction in this way:
Write data in PostgreSQL, flag data to be exported. Commit.
Read data from PostgreSQL, export to Informix. Commit on both sides (TPC?).

AS400 DB2 Journals search

I am new to DB2 administration on AS400, could you point me to the best practices/tools to search for errors in the DB2 journals?
So far I use the DSPJRN command but I am unable to make research.
thanks.
Can you describe what the "error" is that you are looking for. Journal records my themselves don't really have errors (I think).
I haven't worked on an AS400 for about 10 years, but when I did use it last century I did do some work with Journals looking for the change history of a row over time and found all of the answers I needed in the online manuals.
From memory somehow I think I wrote a export program to save the output of the DSPJRN program and uploaded it into a DB2 Table so that I could query it with SQL.
DSPJRN JRN(<LIBRARY>/QSQJRN) FILE(<LIBRARY>/CXPBU00001) RCVRNG(<LIBRARY>/QSQJRN<JOURNAL_NUMBER)
5=Display entire entry on a record
F6 Display only entry
F15 Display only entry specific data
From their you can get a job description: <NUMBER>/<USER>/<SYSTEM>
wrkjob <NUMBER>/<USER>/<SYSTEM>
And from their option 4 or 10 to see job logs
The journals can be saved in files aka tables. You can create some programs/SQL to search these tables. On the iSeries one does not have other 'native' tools then the iSeries commands and/or some programming/quering.
I don't know if they are any 'non-native' tools. Remember that DB2/400 is really just one of the many implementations of Universal Database/2. I won't be suprised if a Windows or Linux tools can analyze the iSeries implementation too. They same is true for MQ. A typical iSeries command/menu interface on the iSeries itself (which works fine by the way). Beautifull graphical tools on other platforms that can connect to this iSeries MQ.\
On a second thought, a standard tool for the iSeries is the iSeries navigator. I will check this out on my work tomorrow