[Qgis-user] Alternative schemas for postgis geometry_columns?

Mike Toews mwtoews at sfu.ca
Mon Dec 28 10:37:50 PST 2009


Mike Toews wrote:
> 2. Create views to the two tables in the public schema (assuming you 
> kept this as from the default):
>
> CREATE OR REPLACE VIEW spatial_ref_sys AS SELECT * FROM 
> postgis.geometry_columns;
> CREATE OR REPLACE VIEW spatial_ref_sys AS SELECT * FROM 
> postgis.geometry_columns;
... oops, corrections:

CREATE OR REPLACE VIEW public.spatial_ref_sys AS SELECT * FROM 
postgis.spatial_ref_sys;
CREATE OR REPLACE VIEW public.geometry_columns AS SELECT * FROM 
postgis.geometry_columns;

But yes, the "ALTER DATABASE mydatabase SET search_path=public,postgis;" 
option is probably the best since now you can use the functions in SQL 
like "select st_area(geom);" (rather than "select postgis.st_area(geom);").

-Mike



More information about the Qgis-user mailing list