Skip to content
Permalink
Browse files
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 650d97b0d306e6f96e15c406d87816b1a71e5b3b
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/providers/postgres/qgspostgresprovider.cpp
@@ -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
{
@@ -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" );

0 comments on commit 650d97b

Please sign in to comment.