Ticket #741 (closed bug: fixed)

Opened 6 years ago

Last modified 4 years ago

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:
Platform Version: Platform: All
Must Fix for Release: No 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

qgspostgresprovider.cpp.diff Download (0.8 KB) - added by rhys 6 years ago.
patch fixing part of ticket 741..... I think

Change History

Changed 6 years ago by rhys

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.

Changed 6 years ago by rhys

patch fixing part of ticket 741..... I think

Changed 6 years ago by gsherman

  • status changed from new to closed
  • resolution set to fixed

Patch applied. Please test to make sure it solves the issue and doesn't introduce any other issues.

Changed 6 years ago by mhugent

  • status changed from closed to reopened
  • resolution fixed deleted

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.

Changed 6 years ago by gsherman

So is the issue only the handling of bytea fields?

Changed 6 years ago by jef

  • status changed from reopened to closed
  • resolution set to fixed

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.

Changed 4 years ago by anonymous

  • milestone Version 0.9.1 deleted

Milestone Version 0.9.1 deleted

Note: See TracTickets for help on using tickets.