Depending on the table I'm working on, the geometry column does not always have the same name, for example in my data it is called sometimes "the_geom", "geometry", "geom", or even "geometrie". How can I get the name of this attribute in QGIS?

  • What does your geometry column contain what you can't access via $geometry?
    – Erik
    Feb 1 '21 at 11:00

If you open DatabaseManager, you can navigate to 'virtual layers'. Select your layer and look in the tab 'info'.

enter image description here

Here you get a list of all your fields, the geometry-field included.

  • Thanks, however there is a problem, I tried with a random table. The field name is different in QGIS DB Manager ("geometry") and in PostgreSQL (" geometrie ", the real name). It looks like whatever the name of the geometry column, it is renamed by default "geometry" in DB Manager. Am I right or wrong ?
    – Eliasse
    Feb 1 '21 at 13:06
  • 1
    @Eliasse You can access your postgres-table via DBmanager. Select the table and look in the info-tab. There the name of your geometrycolumn will be shown as registered in PostGIS
    – PieterB
    Feb 1 '21 at 18:34
  • Thanks it's working !
    – Eliasse
    Feb 8 '21 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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