Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1021 closed patch (wontfix)

PostGIS layers lose the "public" schema in the table part of the URI

Reported by: smizuno Owned by: jef
Priority: major: does not work as expected Milestone:
Component: Data Provider Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

Have found this problem in 0.9.1: when a table in the public schema has symbology set up or a where clause set, the schema portion of the table disappears from the "Source for this layer" item in properties/metadata. When a project is saved, then loaded, that layer won't load.

HEAD has the same behavior as far as the schema being cleared, but the project layer will load.

I believe that this would affect any table whose schema is the current schema in the database.

Have found in qgspostgresprovider.cpp: in the constructor, about line 160 when the current schema is tested and equals the table's schema, mUri.clearSchema() is called. Then setDataSourceUri(mUri) is called.

Several lines in this area are unnecessary as mCurrentSchema is tested/set here and never used anywhere else.

I believe the table's schema should be preserved throughout all operations; I don't see any particular advantage other than a slightly shorter query string being sent to the database.

summary of patch submitted:

  1. qgspostgresprovider.cpp : in the constructor, removed "current_schema()" from the sql command that retrieves table privileges; removed the various tests and setting of variables relating to current_schema / mCurrentSchema; retained the setDataSourceUri() call
  1. qgspostgresprovider.h : removed mCurrentSchema from the header

Attachments (1)

patch_for_bug_1021.txt (1.6 KB ) - added by smizuno 16 years ago.

Download all attachments as: .zip

Change History (3)

by smizuno, 16 years ago

Attachment: patch_for_bug_1021.txt added

comment:1 by jef, 16 years ago

Resolution: wontfix
Status: newclosed

actually this is intentional and mimics OGR. See #843.

comment:2 by (none), 15 years ago

Milestone: Version 0.9.2

Milestone Version 0.9.2 deleted

Note: See TracTickets for help on using tickets.