connection to postGis/postgreSQL databased - windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

connection to postGis/postgreSQL databased - windows

steve
Hello,

I am using windows 7 and can not figure out how to connect to my postgreSQL database .  In the orbisGIS program, I see a box called GeoCatalog.  But I right-click, I see the choice Add a file or folder; but not an option for connecting to a database?  Note, I am able to open up, view, and query a shapefile.

Thank you,
Steve
Reply | Threaded
Open this post in threaded view
|

Re: connection to postGis/postgreSQL databased - windows

Gwendall Petit
Administrator
Dear Steve,

First, welcome in this Mailing List.
Could you please tell us the release number of OrbisGIS that you're using ?

If you're using the latst one (V5.1), you're right, there is no UI in the Geocatalog to connect to a PostGIS db.

To do so, if you launched OrbisGIS in a default mode (based on H2GIS), you have to connect thanks to a LINKED TABLE instruction (executed in the SQL Console).

The link is dynamic in the sense that if data is changed in the remote database, the information is updated in the linked table.

Default syntax
CREATE LINKED TABLE name ( driverString , urlString , userString , passwordString , originalSchemaString , originalTableString ) ;
Exampe with a table (named 'building') stored in a "ref_ign' schema, in a PostGIS db
CREATE LINKED TABLE My_schema.My_Table_Building
('org.orbisgis.postgis_jts_osgi.Driver', 'jdbc:postgresql_h2://190.00.00.00:5432/ref_geo', 'login', 'password', 'ref_ign', 'building);
Note that if you choose to launch OrbisGIS in "PostGIS mode" (see http://doc.orbisgis.org/en/latest/users/quickstart.html#database), you should see directly all the present in your remote db.

Hope it helps.

Best regards

Gwendall
OrbisGIS / H2GIS team