Skip to content
Permalink
Browse files

Fix some postgres field precision and length inconsistencies

  • Loading branch information
m-kuhn committed Aug 29, 2013
1 parent 2f2e088 commit a9c05d77cf2f1cefedaf01e3176faad17271ba0c
Showing with 6 additions and 6 deletions.
  1. +1 −1 src/app/qgsaddattrdialog.cpp
  2. +5 −5 src/providers/postgres/qgspostgresprovider.cpp
@@ -81,7 +81,7 @@ void QgsAddAttrDialog::setPrecisionMinMax()
int maxPrecType = mTypeBox->itemData( idx, Qt::UserRole + 5 ).toInt();
mPrec->setVisible( minPrecType < maxPrecType );
mPrec->setMinimum( minPrecType );
mPrec->setMaximum( qMin( maxPrecType, mLength->value() ) );
mPrec->setMaximum( qMax( minPrecType, qMin( maxPrecType, mLength->value() ) ) );
}

void QgsAddAttrDialog::accept()
@@ -157,9 +157,9 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
//fill type names into sets
mNativeTypes
// integer types
<< QgsVectorDataProvider::NativeType( tr( "Whole number (smallint - 16bit)" ), "int2", QVariant::Int )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer - 32bit)" ), "int4", QVariant::Int )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer - 64bit)" ), "int8", QVariant::LongLong )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (smallint - 16bit)" ), "int2", QVariant::Int, -1, -1, 0, 0 )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer - 32bit)" ), "int4", QVariant::Int, -1, -1, 0, 0 )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer - 64bit)" ), "int8", QVariant::LongLong, -1, -1, 0, 0 )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (numeric)" ), "numeric", QVariant::Double, 1, 20, 0, 20 )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (decimal)" ), "decimal", QVariant::Double, 1, 20, 0, 20 )

@@ -170,10 +170,10 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
// string types
<< QgsVectorDataProvider::NativeType( tr( "Text, fixed length (char)" ), "char", QVariant::String, 1, 255 )
<< QgsVectorDataProvider::NativeType( tr( "Text, limited variable length (varchar)" ), "varchar", QVariant::String, 1, 255 )
<< QgsVectorDataProvider::NativeType( tr( "Text, unlimited length (text)" ), "text", QVariant::String )
<< QgsVectorDataProvider::NativeType( tr( "Text, unlimited length (text)" ), "text", QVariant::String, -1, -1, -1, -1 )

// date type
<< QgsVectorDataProvider::NativeType( tr( "Date" ), "date", QVariant::Date )
<< QgsVectorDataProvider::NativeType( tr( "Date" ), "date", QVariant::Date, -1, -1, -1, -1 )
;

QString key;

0 comments on commit a9c05d7

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