Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading PostGIS layers with no specified geometry loads all features in the attribute table. #38565

Closed
SrNetoChan opened this issue Sep 2, 2020 · 5 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PostGIS data provider

Comments

@SrNetoChan
Copy link
Member

Describe the bug

I have a table where the geometry field is not restricted to a Geometry type. I can save polygons, points or lines.

When I load it in QGIS, I need to load in 3 different layers for specific geometry type. So far so good

In the current LTR (3.10) if you open the attribute table of the polygons layer, you will see the full list of features, including the features in which geometries are lines or points. Besides, If you label the features, it will also label invisible features (from points or lines.

I believe this was not the way it worked in the past. In 3.14 it seems to be fixed.

How to Reproduce

  1. In postgis, create a table with a generic geometry column
CREATE TABLE test as (
gid serial primary key,
geom geometry(Geometry, 4326));
  1. In QGIS, using data source manager, load the table 3 times for, points, lines, and polygons
  2. Edit each layer adding at leas one feature and save
  3. Open one of the layers attribute table, and confirm that all the features from all layers appear.

QGIS and OS versions

QGIS version 3.10.9-A Coruña QGIS code revision bf47e9d
Compiled against Qt 5.9.5 Running against Qt 5.9.5
Compiled against GDAL/OGR 2.2.3 Running against GDAL/OGR 2.2.3
Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.7.1-CAPI-1.11.1 27a5e771
Compiled against SQLite 3.22.0 Running against SQLite 3.22.0
PostgreSQL Client Version 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1) SpatiaLite Version 4.3.0a
QWT Version 6.1.3 QScintilla2 Version 2.10.2
PROJ.4 Version 493
OS Version Ubuntu 18.04.5 LTS
Active python plugins Mergin; socarto_recart_tools; db_manager; processing

Additional context

@SrNetoChan SrNetoChan added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 2, 2020
@elpaso elpaso added the Data Provider Related to specific vector, raster or mesh data providers label Sep 14, 2020
@elpaso
Copy link
Contributor

elpaso commented Sep 14, 2020

Is this a regression? (just for tagging it correctly).

@elpaso elpaso self-assigned this Sep 14, 2020
@elpaso
Copy link
Contributor

elpaso commented Sep 14, 2020

I'm wondering what should happen for NULL geometries. I guess they should appear in all three layers, what do you think?

@SrNetoChan
Copy link
Member Author

Is this a regression? (just for tagging it correctly).

I think it's a regression. I don't remember to have this problems in the past. But I can't say for sure.

@SrNetoChan
Copy link
Member Author

I'm wondering what should happen for NULL geometries. I guess they should appear in all three layers, what do you think?

Yes, that makes sense.

@elpaso
Copy link
Contributor

elpaso commented Sep 14, 2020

Duplicates #34629 (that was not backported)

elpaso added a commit to elpaso/QGIS that referenced this issue Sep 14, 2020
Plus a new test case, fixes qgis#35367 and qgis#38565

The new test case needs forward port to master
nyalldawson pushed a commit to nyalldawson/QGIS that referenced this issue Oct 5, 2020
Plus a new test case, fixes qgis#35367 and qgis#38565

The new test case needs forward port to master
nyalldawson pushed a commit that referenced this issue Oct 23, 2020
Plus a new test case, fixes #35367 and #38565

The new test case needs forward port to master
@gioman gioman added PostGIS data provider and removed Data Provider Related to specific vector, raster or mesh data providers labels Jan 4, 2021
@elpaso elpaso closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PostGIS data provider
Projects
None yet
Development

No branches or pull requests

3 participants