Skip to content
Permalink
Browse files

include key= field in all postgres data source uris (only for views b…

…efore)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12369 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 8, 2009
1 parent a5801be commit 6dece232f3350ac6ca0bbc20147f57a4eb6a13ee
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/providers/postgres/qgspostgresprovider.cpp
@@ -159,8 +159,8 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
if ( mCurrentSchema == mSchemaName )
{
mUri.clearSchema();
setDataSourceUri( mUri.uri() );
}

if ( mSchemaName == "" )
mSchemaName = mCurrentSchema;

@@ -250,6 +250,11 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
{
valid = false;
}
else
{
mUri.setKeyColumn( primaryKey );
setDataSourceUri( mUri.uri() );
}

// Close the database connection if the layer isn't going to be loaded.
if ( !valid )
@@ -1097,9 +1102,6 @@ QString QgsPostgresProvider::getPrimaryKey()
// From the view columns, choose one for which the underlying
// column is suitable for use as a key into the view.
primaryKey = chooseViewColumn( cols );

mUri.setKeyColumn( primaryKey );
setDataSourceUri( mUri.uri() );
}
}
else
@@ -3159,9 +3161,6 @@ QString QgsPostgresProvider::description() const
return POSTGRES_DESCRIPTION;
} // QgsPostgresProvider::description()




/**
* Class factory to return a pointer to a newly created
* QgsPostgresProvider object

0 comments on commit 6dece23

Please sign in to comment.
You can’t perform that action at this time.