Using PostGIS I want to collect all attributes into one polygon. The old table looks like this:
Column | Type
---------+------
xyz_cols | `xyz`
geometry | geometry(MultipolgyonZ, 2193)
Performing the query:
CREATE TABLE new_table AS
SELECT
1::INT as id,
ST_Collect(geom)
FROM
old_table
which works but I lose all geometry information and the output table is like this:
Column | Type
---------+------
id | INT
geometry | geometry
Even if I wrap the ST_Collect in a ST_Multi() I lose the geometry information.