I have data stored in PostGIS. When I view its properties in QGIS, it says:

SRS: EPSG:4326 - WGS 84

However, when I want retrieve the SRID value directly using the Find_SRID function, it returns 0. And by looking at the data, SRID is really 0 in PostGIS.


select * from geometry_columns;


f_table_name | f_geometry_column | coord_dimension | srid |  type


vector       | wkb_geometry      |               2 |    0 | POINT

vector       | wkb_geometry      |               2 |    0 | POINT

buff_out     | wkb_geometry      |               2 |    0 | POLYGON

buff_out     | wkb_geometry      |               2 |    0 | POLYGON

Question: Why is SRID for the same data different in QGIS and in PostGIS? How do I get the correct SRID value from PostGIS?

I am using PostGIS 9.5.

  • 7
    0 in PostGIS means no SRID given. In your QGIS probably the WGS84 is the default projection. The default projection is used in QGIS when the SRID is not given. You should define the correct SRID in PostGIS and QGIS will use the same.
    – Zoltan
    Commented Jul 22, 2018 at 12:52
  • 1
    Instead of querying the geometry_columns table, can you see what ST_SRID(geom) reports from the table itself? Commented Jul 22, 2018 at 18:03
  • i wanted to try ST_SRID() too but I dont understand what should I pass it as the (geom) argument..
    – Jan Pisl
    Commented Jul 22, 2018 at 23:32
  • 1
    @JanPisl throughout the PostGIS docs and Q/A, geom refers to the identifier/name of the data's geometry column; it's wkb_geometry in this case, e.g. SELECT ST_SRID(wkb_geometry) FROM <your_table>
    – geozelot
    Commented Jul 23, 2018 at 7:03

2 Answers 2


QGIS serves mostly as a visualization tool, where you are importing information from a Geospatial Database, this means it can't update the DB as when you change the layer property, it only affects that layer that lives in that QGIS project.

To update the SRID in PostGIS you should declare it as:

SELECT UpdateGeometrySRID('vector','wkb_geometry',4326);

To update the SRID in PostgreSQL/PostGIS you can run:

ALTER TABLE vector ALTER COLUMN wkb_geometry TYPE geometry(POINT,4326) using ST_SetSRID(wkb_geometry, 4326);

This does the exact same thing as YPCA's answer, but is standard SQL.

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.