Closed aazaff closed 8 months ago
Easy explanation -- postgis extension no longer includes raster support by default as of 3.x. You need to explicitly install it separately now. Details here. CREATE EXTENSION postgis_raster;
I tested this successfully on the new devazlib database. I also created the extension on prod, BUT the actual raster tables and associated triggers have not been brought over. Leaving that set top @NoisyFlowers
Wait, what?
Why weren't they brought over? Would they have been if the extension was installed?
The sql above bears only passing resemblance to the sql that is executed by azlibConfigPG. For instance, I never explicitly create a sequence or mess with ownership or constraints. I don't know what this means.
Yes, it would have worked the extension was installed in advance. But I'm not doing another pg_restore...
The only raster setup I execute is
create table gisdata.rasters
(
raster_id serial PRIMARY KEY,
collection_id integer REFERENCES public.collections(collection_id),
metadata_id integer REFERENCES gisdata.metadata(metadata_id),
raster raster,
srid integer,
tile_size text
);
CREATE INDEX rasters_id_idx ON gisdata.rasters (raster_id);
CREATE INDEX rasters_collection_id_idx ON gisdata.rasters (collection_id);
No idea what all that other stuff is. I assume that's code generated by pg_backup? I also assume we can ignore it and stick with this?
Pretty sure that's all handled by the PRIMARY KEY and REFERENCES specifiers.
Yes, that's what's generated by pg_dump, which I think is just a more formal/full-length way of saying what you've already stated. At least for the create and index, but aren't there related triggers too?
None that I create.
Done. Table and indexes created in prod db
The import of the table
gisdata.rasters
fails because the type raster is not recognized. Luckily we have never actually used this table in the past and it is empty of data anyway so nothing should actually be affected. Nevertheless we should address this eventually.