I don't think you can do this directly with qlikview. Because the data is in two separate databases qlikview and you have to use sql selects to get the data qlikview needs to load all the data from both tables.
The obvious solution is to retrieve a distinct list of deviceid's from mysql and load these into a (temporary) table in the postgresql database. Then you can create an sql statement that only returns the records from the postgresql table that have an deviceid that also exists in the deviceid list from mysql.
I assume that your data is huge, i.e millions of rows. This is a situation where you should utilize Qlikview's in-memory computing to get you the results in a fraction of seconds.
Gysbert's idea is the solution that works out of QlikView.
If you want to do it in QlikView then these are the steps :
1 - Load the table from PostgreSql to QlikView.
2 - Load the table from MySQL.
3 - Inner join between the two tables using Resident load.
In addition to QlikView's performance advantage, you could also verify and reconcile your data easily.
I hope this helps!
Thanks to both Gysbert Wassenaar and Multi View for saving me a lot of time in researching how to do this just to find out that it is not possible. After all I ended up in using the method described my MultiView, eg. loading the whole tables from both databases into memory and then joining them. This was because the databases are not mine and I have no write access to them so I could not create a temporary table as suggested by Gysbert. It now takes me about 10 minutes to load all data but, what the heck, at least it works.