User Tools

Site Tools


dba:postgres:gis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dba:postgres:gis [2025/12/29 22:11] mlivolsidba:postgres:gis [2025/12/30 16:01] (current) mlivolsi
Line 1: Line 1:
 ====== Adding GIS Support to Postgres ====== ====== Adding GIS Support to Postgres ======
  
 +<code>
 create role gis_admin login password 'gis_password'; create role gis_admin login password 'gis_password';
  
Line 6: Line 7:
 create database gis; create database gis;
 grant all privileges on database gis to gis_admin; grant all privileges on database gis to gis_admin;
 +</code>
  
 psql   -h <//hostname//> --username=gis_admin --password --dbname=<//dbname//> psql   -h <//hostname//> --username=gis_admin --password --dbname=<//dbname//>
Line 28: Line 30:
   </code>   </code>
  
-=== transfer ownership ===+=== Transfer ownership ===
  
 <code> <code>
Line 34: Line 36:
 ALTER SCHEMA tiger_data OWNER TO gis_admin;  ALTER SCHEMA tiger_data OWNER TO gis_admin; 
 ALTER SCHEMA topology OWNER TO gis_admin; ALTER SCHEMA topology OWNER TO gis_admin;
-</code> 
  
 CREATE FUNCTION exec(text) returns text language plpgsql volatile AS $f$ BEGIN EXECUTE $1; RETURN $1; END; $f$; CREATE FUNCTION exec(text) returns text language plpgsql volatile AS $f$ BEGIN EXECUTE $1; RETURN $1; END; $f$;
Line 47: Line 48:
     relkind IN ('r','S','v') ORDER BY relkind = 'S')     relkind IN ('r','S','v') ORDER BY relkind = 'S')
 s; s;
 +</code>
  
 +=== Testing out the installation ===
 +<code>
 SET search_path=public,tiger; SET search_path=public,tiger;
  
Line 62: Line 66:
 -- Should return 1 -- Should return 1
 SELECT topology.createtopology('my_new_topo',26986,0.5); SELECT topology.createtopology('my_new_topo',26986,0.5);
 +
 +</code>
dba/postgres/gis.1767046297.txt.gz · Last modified: by mlivolsi