Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use both schema and table name retrieving oid, to fix #3329
fixed endian deduction corrupted in r13340


git-svn-id: http://svn.osgeo.org/qgis/trunk@14919 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Dec 15, 2010
1 parent dbb5a1c commit 650d97b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2957,8 +2957,10 @@ bool QgsPostgresProvider::deduceEndian()
if ( i < PQnfields( res ) )
{
// get the table name
res = connectionRO->PQexec( QString( "SELECT relname FROM pg_class WHERE oid=%1" ).arg( oidValue ) );
query = QString::fromUtf8( PQgetvalue( res, 0, 0 ) );
res = connectionRO->PQexec( QString( "SELECT pg_namespace.nspname,pg_class.relname FROM pg_class,pg_namespace WHERE pg_class.relnamespace=pg_namespace.oid AND pg_class.oid=%1" ).arg( oidValue ) );
QString schemaName = QString::fromUtf8( PQgetvalue( res, 0, 0 ) );
QString tableName = QString::fromUtf8( PQgetvalue( res, 0, 1 ) );
query = quotedIdentifier( schemaName ) + "." + quotedIdentifier( tableName );
}
else
{
Expand All @@ -2972,6 +2974,7 @@ bool QgsPostgresProvider::deduceEndian()
Result oidResult = connectionRO->PQexec( firstOid );
// get the int value from a "normal" select
oidValue = QString::fromUtf8( PQgetvalue( oidResult, 0, 0 ) );
query = mQuery;
}

QgsDebugMsg( "Creating binary cursor" );
Expand Down

0 comments on commit 650d97b

Please sign in to comment.