There appears to be working connections to PostgreSQL databases in the QGIS modeler. I have added and configured them and they connect to what they are supposed to but the outputs from them don't appear to be available to subsequent functions! See attached. What am I missing?

enter image description here

1 Answer 1


Try the following model to take database infos (connexion, schema, table) to load table as a layer. It will write then to an output table named out2 in the same database (but will not add it as layer). In this particular case, I've linked PostGIS table reading to Export PostGIS table but in your case, you can link the first Processing algorithm to others algorithms like usual.

The model is available at https://gist.github.com/ThomasG77/61afda568887fcc603e1f9ef963925ec but you need to load it ("Processing" > "Graphical Modeler...", then in new Window, menu "Model" > "Open Model...").

General Model Designer overview

enter image description here

The tip is mainly in below screenshot and use "PostgreSQL execute and load SQL"

enter image description here

  • can I use this method to load a spatial table (layer) from my postgis database in the qgis graphical modeler to perform operations on it and export results to QGIS. Having a difficult time to get this to work for me case but I am missing somethig.
    – MJM
    Apr 14, 2022 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.