#741 closed bug (fixed)
identify not working for some postgis layers
Reported by: | rhys | Owned by: | nobody |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | Data Provider | Version: | Trunk |
Keywords: | postgis, identify | Cc: | |
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
Identify returns no features found when in fact features are within the region clicked.
Looking at the query sent to the server it seems that there are two problems:
- the column names aren't being properly quoted so this will raise an error and abort the xaction.
- all columns are being converted to text and not all columns are convertible to text. In my case I had a bytea column and that raised an error which aborted the transaction.
This might also affect the attribute table.
Attachments (1)
Change History (7)
comment:1 by , 16 years ago
by , 16 years ago
Attachment: | qgspostgresprovider.cpp.diff added |
---|
patch fixing part of ticket 741..... I think
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied. Please test to make sure it solves the issue and doesn't introduce any other issues.
comment:3 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The problem with this patch is that all the numeric columns now appear as 0. This is because their values are now transfered in binary format, but in the postgresprovider, they are interpreted as strings.
The problem with the primary key coming as 0 has already been adressed in a former fix.
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
the quoting part looks like a good thing. You could have mixed-case or uppercase column names that postgres will choke on unless properly quoted.
There's no support for BLOB attributes in QGIS anywhere anyway, so it's probably best to simply ignore columns that are of unsupported types, ie. bytea and maybe more.
I did that with r7443.
Further, when the tool does identify a feature (i.e. neither of the aforementioned problems raise an error and aborts the transaction) the primary key of the table always comes back as 0. Also affects the attribute table.