I'm fairly new to SQL and have a set of existing PostGIS layers in our country coordinate system (EPSG: 2193).
I would like to create a view (or materialised view...but initially a simple view until I become better versed in SQL to generate a trigger) which simply re-projects this layer to EPSG 4326 (WGS84) for use in external software which only accepts geographic coordinate system data/4326.
I've not been able to find any examples to do this (most are related to re-projecting one geometry or geography. How can I do this?
CREATE OR REPLACE VIEW testview AS FROM "Forests" SELECT st_transform("Forests".geom,4326) as geom WHERE "Forests".forest_id = 'F_1'