0

I use computers at my university. I cannot install programs on these computers. I don't have PostgreSQL installed on these machines.

I need to create a geographic database, as I need to edit very large shapefile files of the order of 1.5 million polygons, so the native shapfile file is not good for editing that amount. Creating this database would help me edit these polygons faster.

How could I create a PostGIS database without having PostgreSQL? It is possible? if possible could I use this database without having PostgreSQL behind it?

OBS: I have QGIS installed, would there be a plugin that does this?

9
  • 1
    What do you need this Postgis database (and thus Postgresql) for exactly? Qgis includes Spatialite, you might want to check if this covers your need docs.qgis.org/3.22/en/docs/training_manual/databases/…
    – Kasper
    Commented Feb 1, 2023 at 20:34
  • 4
    There is no such thing as a "PostGIS database." PostGIS is an EXTENSION within PostgreSQL. While you could technically extract PostgreSQL and PostGIS as an unprivileged user, then manually run the server in a Command Prompt window, and configure it and create a new database, and enable the "postgis" EXTENSION in that database, you would need to gracefully shut it down and potentially zip the software/data tree to use it on a different machine the next time. You can't use PostGIS without a PostgreSQL instance.
    – Vince
    Commented Feb 1, 2023 at 20:39
  • 2
    This is an example of an XY Problem. Please Edit the Question to focus on the task that running PostGIS without PostgreSQL would have solved.
    – Vince
    Commented Feb 1, 2023 at 20:41
  • 2
    You don't necessarily need to install PostgreSQL(PG) on your computer. You could create a free PG database in the cloud (for example AWS free tier: aws.amazon.com/rds/free), install the PostGIS extension on it, and then connect to it from QGIS without installing anything locally. PostGIS does not exist without PostgreSQL, unfortunately. Commented Feb 2, 2023 at 1:49
  • 4
    Since it's not possible to install PostGIS on your university computers without PostgreSQL, and installing/using PostgreSQL/PostGIS without admin rights is exceedingly tedious, I strongly suggest you start researching SQLite, SpatialLite, and GeoPackage with QGIS for your solution.
    – Vince
    Commented Feb 2, 2023 at 13:41

1 Answer 1

1

PostGIS is a PostgreSQL extension, therefore, it's not possible to have it without having a PostgreSQL server with at least one database.

You can then install PostGIS as

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology; -- if need be

A nice option for your case would be to use a dockerized PostGIS database, using the official Docker image available at: https://registry.hub.docker.com/r/postgis/postgis/

But that means the Docker engine has to be installed on the machine. Maybe ask your IT department for that. Docker provides nice isolation features so it would be hard to break something on the host normally.

Otherwise you can maybe try to install a "portable" version of PostgreSQL, such as https://sourceforge.net/projects/pgsqlportable/ as (I didn't test it) as discussed here: https://www.postgresql.org/message-id/5410C071.5090701%40hogranch.com

2
  • I am not allowed to install any software. my idea was something portable and executable. Commented Feb 12, 2023 at 20:24
  • @wesleysc352 see update for installing a portable version of PostgreSQL. Commented Feb 24, 2023 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.