CREATE VIEW planning.current_apps AS SELECT * FROM planning.all_apps WHERE decision_date IS NULL;


In order to open a view in QGIS you will need a primary key column, ideally as the first column in the view which QGIS will select by default.



INSERT INTO geometry_columns(
            f_table_catalog, f_table_schema, f_table_name, f_geometry_column, 
            coord_dimension, srid, "type")
    VALUES ('', 'schema_name', 'view_name', 'wkb_geometry',2, 27700, 'GEOMETRY');

Replace 'schema_name' with the name of the schema where you created the view and 'view_name' with the name of the view. The "type" could also be POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. 


CREATE VIEW planning.current_apps AS SELECT * FROM planning.all_apps WHERE decision_date IS NULL;


In order to open a view in QGIS you will need a primary key column, ideally as the first column in the view which QGIS will select by default.



INSERT INTO geometry_columns(
            f_table_catalog, f_table_schema, f_table_name, f_geometry_column, 
            coord_dimension, srid, "type")
    VALUES ('', 'schema_name', 'view_name', 'wkb_geometry',2, 27700, 'GEOMETRY');

Replace 'schema_name' with the name of the schema where you created the view and 'view_name' with the name of the view. The "type" could also be POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION.