Index: configure.in
===================================================================
--- configure.in	(revision 1082)
+++ configure.in	(working copy)
@@ -43,13 +43,14 @@ AM_CONDITIONAL(ENABLE_SK, test "x$enable
 AC_SUBST([ACLOCAL_AMFLAGS], ['-I macros ${ACLOCAL_FLAGS}'])
 
 #For gnome-doc-utils:
+AM_CONDITIONAL(HAVE_GNOME_DOC_UTILS, 1) # automake bails out without it
 GNOME_DOC_INIT([0.9.0])
 
 AC_LANG_CPLUSPLUS
 
 # Checks for libraries
 # We need libgnome only for gnome_help_display().:
-PKG_CHECK_MODULES(GLOM, bakery-2.4 >= 2.3.18 gtkmm-2.4 >= 2.6.1 gthread-2.0 gnome-vfsmm-2.6 >= 2.11.1 libgnomecanvasmm-2.6 >= 2.10.0 libxslt >= 1.1.10 pygda-1.2 pygtk-2.0 >= 2.6.0 libgnome-2.0 >= 2.6.0 iso-codes libgdamm-2.0 >= 1.3.7 libgtksourceviewmm-1.0 libgda >= 1.2.4 avahi-glib goocanvas)
+PKG_CHECK_MODULES(GLOM, bakery-2.4 >= 2.3.18 gtkmm-2.4 >= 2.6.1 gthread-2.0 gnome-vfsmm-2.6 >= 2.11.1 libgnomecanvasmm-2.6 >= 2.10.0 libxslt >= 1.1.10 pygda-3.0 pygtk-2.0 >= 2.6.0 libgnome-2.0 >= 2.6.0 iso-codes libgdamm-3.0 libgtksourceviewmm-1.0 libgda-3.0 avahi-glib goocanvas)
 
 GLOM_LIBS+=" --no-undefined"
 AC_SUBST(GLOM_CFLAGS)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 1082)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2007-04-01  Armin Burgmeier  <armin@openismus.com>
+
+	* several files: Merged changes from the GLOM_LIBGDA3 branch. Glom now
+	builds against the new libgda and pygda API. See the ChangeLog in that
+	branch for a more detailed view of what has changed.
+
 2007-03-20  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
 
 	* glom/libglom/connectionpool.cc: Modify the default pg_hba.conf to 
Index: glom/dialog_invalid_data.cc
===================================================================
--- glom/dialog_invalid_data.cc	(revision 1082)
+++ glom/dialog_invalid_data.cc	(working copy)
@@ -60,10 +60,7 @@ void Dialog_InvalidData::set_example_dat
   {
     case(Field::TYPE_DATE):
     {
-      Gnome::Gda::Date date = {0, 0, 0};
-      date.day = 31;
-      date.month = 1;
-      date.year = 2005;
+      Glib::Date date(31, Glib::Date::JANUARY, 2005);
       example_text = Conversions::get_text_for_gda_value(glom_type, Gnome::Gda::Value(date));
       break;
     }
Index: glom/libglom/connectionpool.h
===================================================================
--- glom/libglom/connectionpool.h	(revision 1082)
+++ glom/libglom/connectionpool.h	(working copy)
@@ -124,6 +124,7 @@ public:
   void set_database(const Glib::ustring& value);
 
   Glib::ustring get_host() const;
+  Glib::ustring get_port() const;
   Glib::ustring get_user() const;
   Glib::ustring get_password() const;
   Glib::ustring get_database() const;
Index: glom/libglom/utils.cc
===================================================================
--- glom/libglom/utils.cc	(revision 1082)
+++ glom/libglom/utils.cc	(working copy)
@@ -420,7 +420,7 @@ Utils::type_list_values_with_second Util
 
 
   //std::cout << "get_choice_values: Executing SQL: " << sql_query << std::endl;
-  Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->execute_single_command(sql_query);
+  Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->execute_select_command(sql_query);
 
   if(datamodel)
   {
@@ -510,10 +510,10 @@ Glib::ustring Utils::create_local_image_
 
   Glib::ustring result;
 
-  if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
+  if(value.get_value_type() == GDA_TYPE_BINARY)
   {
     glong size = 0;
-    const gpointer pData = value.get_binary(size);
+    gconstpointer pData = value.get_binary(size);
     if(size && pData)
     {
       //libgda does not currently properly unescape binary data,
Index: glom/libglom/data_structure/fieldtypes.cc
===================================================================
--- glom/libglom/data_structure/fieldtypes.cc	(revision 1082)
+++ glom/libglom/data_structure/fieldtypes.cc	(working copy)
@@ -20,6 +20,7 @@
 
 #include "fieldtypes.h"
 #include <iostream> //For debug output
+#include <libgda/gda-util.h> // For gda_g_type_to_string
 #include <glom/libglom/connectionpool.h>
 
 namespace Glom
@@ -37,10 +38,10 @@ FieldTypes::FieldTypes(const Glib::RefPt
     DATAMODEL_FIELDS_COL_GDATYPE = 3
   };
   
-  if(gda_connection && gda_connection->is_open())
+  if(gda_connection && gda_connection->is_opened())
   {
     //Read the Types information, so that we can map the string representation of the type (returned by CONNECTION_SCHEMA_FIELDS) to
-    //the Gda::ValueType used by Gnome::Gda::FieldAttributes.
+    //the Gda::ValueType used by Glib::RefPtr<Gnome::Gda::Column>.
     Glib::RefPtr<Gnome::Gda::DataModel> data_model_tables = gda_connection->get_schema(Gnome::Gda::CONNECTION_SCHEMA_TYPES);
     if(data_model_tables && (data_model_tables->get_n_columns() == 0))
     {
@@ -55,20 +56,21 @@ FieldTypes::FieldTypes(const Glib::RefPt
 
         //Get the types's string representation:
         Glib::ustring schema_type_string;
-        if(value_name.get_value_type() ==  Gnome::Gda::VALUE_TYPE_STRING)
+        if(value_name.get_value_type() == G_TYPE_STRING)
           schema_type_string = value_name.get_string();
     
         if(!schema_type_string.empty())
         {
           Gnome::Gda::Value value_gdatype = data_model_tables->get_value_at(DATAMODEL_FIELDS_COL_GDATYPE, i);
-          if(value_gdatype.get_value_type() ==  Gnome::Gda::VALUE_TYPE_TYPE)
+          if(value_gdatype.get_value_type() == G_TYPE_ULONG) // TODO: I think this might change to G_TYPE_GTYPE in a future libgda
           {
-            Gnome::Gda::ValueType gdatype = value_gdatype.get_vtype();
+	    // TODO: Perhaps we want to add a Gnome::Gda::get_ulong() in libgdamm
+            GType gdatype = static_cast<GType>(g_value_get_ulong(value_gdatype.gobj()));
 
             //Save it for later:
             m_mapSchemaStringsToGdaTypes[schema_type_string] = gdatype;
-            
-            Glib::ustring gdatypestring = Gnome::Gda::Value::type_to_string(gdatype); 
+
+            Glib::ustring gdatypestring = gda_g_type_to_string(gdatype); // TODO: What is this actually used for?
             //std::cout << "schema type: " << schema_type_string << " = gdatype " << (guint)gdatype << "(" << gdatypestring << ")" << std::endl;
             
             m_mapGdaTypesToSchemaStrings[gdatype] = schema_type_string; //We save it twice, to just to make searching easier, without using a predicate.
@@ -86,26 +88,26 @@ FieldTypes::~FieldTypes()
 {
 }
 
-Gnome::Gda::ValueType FieldTypes::get_gdavalue_for_schema_type_string(const Glib::ustring& schema_type_string) const
+GType FieldTypes::get_gdavalue_for_schema_type_string(const Glib::ustring& schema_type_string) const
 {
   type_mapSchemaStringsToGdaTypes::const_iterator iterFind = m_mapSchemaStringsToGdaTypes.find(schema_type_string);
   if(iterFind == m_mapSchemaStringsToGdaTypes.end())
-    return Gnome::Gda::VALUE_TYPE_UNKNOWN;
+    return GDA_TYPE_NULL;
   else
     return iterFind->second;
 }
 
-Glib::ustring FieldTypes::get_string_name_for_gdavaluetype(Gnome::Gda::ValueType field_type) const
+Glib::ustring FieldTypes::get_string_name_for_gdavaluetype(GType field_type) const
 {
   type_mapGdaTypesToSchemaStrings::const_iterator iterFind = m_mapGdaTypesToSchemaStrings.find(field_type);
   if(iterFind == m_mapGdaTypesToSchemaStrings.end())
   {
-    g_warning("FieldTypes::get_string_name_for_gdavaluetype(): returning unknowntype for field_type=%d", field_type);
+    g_warning("FieldTypes::get_string_name_for_gdavaluetype(): returning unknowntype for field_type=%ld", static_cast<long>(field_type));
 
     g_warning("  possible types are: ");
     for(type_mapGdaTypesToSchemaStrings::const_iterator iter = m_mapGdaTypesToSchemaStrings.begin(); iter != m_mapGdaTypesToSchemaStrings.end(); ++iter)
     {
-      g_warning("    gdatype=%d, sqltype=%s", iter->first, iter->second.c_str());
+      g_warning("    gdatype=%ld, sqltype=%s", static_cast<long>(iter->first), iter->second.c_str());
     }
     
     return "unknowntype";
Index: glom/libglom/data_structure/fieldtypes.h
===================================================================
--- glom/libglom/data_structure/fieldtypes.h	(revision 1082)
+++ glom/libglom/data_structure/fieldtypes.h	(working copy)
@@ -35,15 +35,15 @@ public:
   FieldTypes(const Glib::RefPtr<Gnome::Gda::Connection>& gda_connection);
   virtual ~FieldTypes();
 
-  Gnome::Gda::ValueType get_gdavalue_for_schema_type_string(const Glib::ustring& schema_type_string) const;
-  Glib::ustring get_string_name_for_gdavaluetype(Gnome::Gda::ValueType field_type) const;
+  GType get_gdavalue_for_schema_type_string(const Glib::ustring& schema_type_string) const;
+  Glib::ustring get_string_name_for_gdavaluetype(GType field_type) const;
   
 protected:
-  typedef std::map<Glib::ustring, Gnome::Gda::ValueType> type_mapSchemaStringsToGdaTypes;
+  typedef std::map<Glib::ustring, GType> type_mapSchemaStringsToGdaTypes;
   type_mapSchemaStringsToGdaTypes m_mapSchemaStringsToGdaTypes;
 
   //Duplicate information, to make searching easier:
-  typedef std::map<Gnome::Gda::ValueType, Glib::ustring> type_mapGdaTypesToSchemaStrings;
+  typedef std::map<GType, Glib::ustring> type_mapGdaTypesToSchemaStrings;
   type_mapGdaTypesToSchemaStrings m_mapGdaTypesToSchemaStrings;
 };
 
Index: glom/libglom/data_structure/field.cc
===================================================================
--- glom/libglom/data_structure/field.cc	(revision 1082)
+++ glom/libglom/data_structure/field.cc	(working copy)
@@ -38,6 +38,7 @@ bool Field::m_maps_inited = false;
 
 Field::Field()
 : m_glom_type(TYPE_INVALID),
+  m_field_info(Gnome::Gda::Column::create()),
   m_visible(true)
 {
   m_translatable_item_type = TRANSLATABLE_TYPE_FIELD;
@@ -107,17 +108,17 @@ void Field::set_glom_type(glom_field_typ
   m_glom_type = fieldtype;
 }
 
-Gnome::Gda::FieldAttributes Field::get_field_info() const
+Glib::RefPtr<Gnome::Gda::Column> Field::get_field_info() const
 {
   return m_field_info;
 }
 
-void Field::set_field_info(const Gnome::Gda::FieldAttributes& fieldInfo)
+void Field::set_field_info(const Glib::RefPtr<Gnome::Gda::Column>& fieldinfo)
 {
-  m_field_info = fieldInfo;
+  m_field_info = fieldinfo;
 
   //TODO: Maybe just do this in get_glom_type()?
-  set_glom_type( get_glom_type_for_gda_type(fieldInfo.get_gdatype()) );
+  set_glom_type( get_glom_type_for_gda_type(fieldinfo->get_g_type()) );
 }
 
 Gnome::Gda::Value Field::get_data() const
@@ -279,7 +280,8 @@ Glib::ustring Field::sql(const Gnome::Gd
         return "''"; //We want to ignore the concept of NULL strings, and deal only with empty strings.
       else
       {
-        str = glom_escape_text(value.get_string());
+        str = value.get_string();
+        str = glom_escape_text(str);
       }
 
       break;
@@ -301,8 +303,8 @@ Glib::ustring Field::sql(const Gnome::Gd
     }
     case(TYPE_BOOLEAN):
     {
-      if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BOOLEAN)
-        str = ( value.get_bool() ? "TRUE" : "FALSE" );
+      if(G_VALUE_TYPE(value.gobj()) == G_TYPE_BOOLEAN)
+        str = (value.get_boolean() ? "TRUE" : "FALSE" );
       else
         str = "FALSE";
 
@@ -310,13 +312,13 @@ Glib::ustring Field::sql(const Gnome::Gd
     }
     case(TYPE_IMAGE):
     {
-      if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
+      if(value.get_value_type() == GDA_TYPE_BINARY)
       {
-        long buffer_size = 0;
-        const gpointer buffer = value.get_binary(buffer_size);
-        if(buffer && buffer_size)
+        long buffer_length;
+        const guchar* buffer = value.get_binary(buffer_length);
+        if(buffer && buffer_length > 0)
         {
-          const std::string escaped_binary_data = std::string((char*)buffer, buffer_size);
+          const std::string escaped_binary_data = std::string(reinterpret_cast<const gchar*>(buffer), buffer_length);
           //Now escape that text (to convert \ to \\, for instance):
           str = glom_escape_text(escaped_binary_data) /* has quotes */ + "::bytea";
 
@@ -393,57 +395,57 @@ Glib::ustring Field::sql_find_operator()
 
 Glib::ustring Field::get_name() const
 {
-  return m_field_info.get_name();
+  return m_field_info->get_name();
 }
 
 void Field::set_name(const Glib::ustring& value)
 {
-  m_field_info.set_name(value);
+  m_field_info->set_name(value);
 }
 
 bool Field::get_auto_increment() const
 {
-  return m_field_info.get_auto_increment();
+  return m_field_info->get_auto_increment();
 }
 
 void Field::set_auto_increment(bool val)
 {
-  m_field_info.set_auto_increment(val);
+  m_field_info->set_auto_increment(val);
 }
 
 bool Field::get_primary_key() const
 {
-  return m_field_info.get_primary_key();
+  return m_field_info->get_primary_key();
 }
 
 void Field::set_primary_key(bool val)
 {
-  m_field_info.set_primary_key(val);
+  m_field_info->set_primary_key(val);
 }
 
 bool Field::get_unique_key() const
 {
-  return m_field_info.get_unique_key();
+  return m_field_info->get_unique_key();
 }
 
 void Field::set_unique_key(bool val)
 {
-  m_field_info.set_unique_key(val);
+  m_field_info->set_unique_key(val);
 }
 
 Gnome::Gda::Value Field::get_default_value() const
 {
-  return m_field_info.get_default_value();
+  return m_field_info->get_default_value();
 }
 
-void Field::set_default_value(const Gnome::Gda::Value& val)
+void Field::set_default_value(const Gnome::Gda::Value& value)
 {
-  m_field_info.set_default_value(val);
+  m_field_info->set_default_value(value);
 }
 
 Glib::ustring Field::get_sql_type() const
 {
-  if(false) //See generate_next_auto_increment() //m_field_info.get_auto_increment())
+  if(false) //See generate_next_auto_increment() //m_field_info->get_auto_increment())
     return "serial"; //See Postgres manual: http://www.postgresql.org/docs/7.4/interactive/datatype.html#DATATYPE-SERIAL. It's actually an integer..
   else
   {
@@ -458,14 +460,14 @@ Glib::ustring Field::get_sql_type() cons
       const FieldTypes* pFieldTypes = pConnectionPool->get_field_types();
       if(pFieldTypes)
       {
-        const Gnome::Gda::ValueType fieldType = m_field_info.get_gdatype();
+        const GType fieldType = m_field_info->get_g_type();
         strType = pFieldTypes->get_string_name_for_gdavaluetype(fieldType);
       }
     }
 
     if(strType == "unknowntype")
     {
-      g_warning("Field::get_sql_type(): returning unknowntype for field name=%s , glom_type=%d, gda_type=%d", get_name().c_str(), get_glom_type(), m_field_info.get_gdatype());
+      g_warning("Field::get_sql_type(): returning unknowntype for field name=%s , glom_type=%d, gda_type=%d", get_name().c_str(), get_glom_type(), (int)m_field_info->get_g_type());
     }
 
     return strType;
@@ -473,18 +475,21 @@ Glib::ustring Field::get_sql_type() cons
 }
 
 /// Ignores any part of FieldAttributes that libgda does not properly fill.
-bool Field::field_info_from_database_is_equal(const Gnome::Gda::FieldAttributes& field)
+bool Field::field_info_from_database_is_equal(const Glib::RefPtr<const Gnome::Gda::Column>& field)
 {
-  Gnome::Gda::FieldAttributes temp = m_field_info;
+  Glib::RefPtr<Gnome::Gda::Column> temp = m_field_info->copy();
 
-  temp.set_auto_increment( field.get_auto_increment() ); //Don't compare this, because the data is incorrect when libgda reads it from the database.
-  temp.set_default_value( field.get_default_value() ); //Don't compare this, because the data is incorrect when libgda reads it from the database.
-  temp.set_primary_key( field.get_primary_key() ); //Don't compare this, because the data is incorrect when libgda reads it from the database.
+  temp->set_auto_increment( field->get_auto_increment() ); //Don't compare this, because the data is incorrect when libgda reads it from the database.
 
-  return temp == field; 
+  Gnome::Gda::Value value = field->get_default_value();
+  temp->set_default_value(value); //Don't compare this, because the data is incorrect when libgda reads it from the database.
+
+  temp->set_primary_key( field->get_primary_key() ); //Don't compare this, because the data is incorrect when libgda reads it from the database.
+
+  return temp->equal(field); 
 }
 
-Field::glom_field_type Field::get_glom_type_for_gda_type(Gnome::Gda::ValueType gda_type)
+Field::glom_field_type Field::get_glom_type_for_gda_type(GType gda_type)
 {
   init_map();
 
@@ -497,26 +502,26 @@ Field::glom_field_type Field::get_glom_t
       result = iterFind->second;
     else
     {
-      // g_warning("FieldType::FieldType(Gnome::Gda::ValueType gda_type): Invalid gda type: %d",  gda_type);
+      // g_warning("FieldType::FieldType(GType gda_type): Invalid gda type: %d",  gda_type);
     }
   }
 
   return result;
 }
 
-Gnome::Gda::ValueType Field::get_gda_type_for_glom_type(Field::glom_field_type glom_type)
+GType Field::get_gda_type_for_glom_type(Field::glom_field_type glom_type)
 {
   init_map();
 
   //Get the ideal gda type used for that glom type;
   type_map_glom_type_to_gda_type::iterator iterFind = m_map_glom_type_to_gda_type.find(glom_type);
-  Gnome::Gda::ValueType ideal_gda_type = Gnome::Gda::VALUE_TYPE_UNKNOWN;
+  GType ideal_gda_type = G_TYPE_NONE;
   if(iterFind != m_map_glom_type_to_gda_type.end())
     ideal_gda_type = iterFind->second;
 
-  if(ideal_gda_type == Gnome::Gda::VALUE_TYPE_UNKNOWN)
+  if(ideal_gda_type == G_TYPE_NONE)
   {
-    g_warning("Field::get_gda_type_for_glom_type(): Returning VALUE_TYPE_UNKNOWN for glom_type=%d", glom_type);
+    g_warning("Field::get_gda_type_for_glom_type(): Returning G_TYPE_NONE for glom_type=%d", glom_type);
   }
   
   return ideal_gda_type;
@@ -530,20 +535,20 @@ void Field::init_map()
     //Fill maps.
 
     //Ideals:
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_NUMERIC] = TYPE_NUMERIC;
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_INTEGER] = TYPE_NUMERIC; //Only for "serial" (auto-increment) fields.
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_STRING] = TYPE_TEXT;
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_TIME] = TYPE_TIME;
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_DATE] = TYPE_DATE;
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_BOOLEAN] = TYPE_BOOLEAN;
-    m_map_gda_type_to_glom_type[Gnome::Gda::VALUE_TYPE_BINARY] = TYPE_IMAGE;
-
-    m_map_glom_type_to_gda_type[TYPE_NUMERIC] = Gnome::Gda::VALUE_TYPE_NUMERIC;
-    m_map_glom_type_to_gda_type[TYPE_TEXT] = Gnome::Gda::VALUE_TYPE_STRING;
-    m_map_glom_type_to_gda_type[TYPE_TIME] = Gnome::Gda::VALUE_TYPE_TIME;
-    m_map_glom_type_to_gda_type[TYPE_DATE] = Gnome::Gda::VALUE_TYPE_DATE;
-    m_map_glom_type_to_gda_type[TYPE_BOOLEAN] = Gnome::Gda::VALUE_TYPE_BOOLEAN;
-    m_map_glom_type_to_gda_type[TYPE_IMAGE] = Gnome::Gda::VALUE_TYPE_BINARY;
+    m_map_gda_type_to_glom_type[GDA_TYPE_NUMERIC] = TYPE_NUMERIC;
+    m_map_gda_type_to_glom_type[G_TYPE_INT] = TYPE_NUMERIC; //Only for "serial" (auto-increment) fields.
+    m_map_gda_type_to_glom_type[G_TYPE_STRING] = TYPE_TEXT;
+    m_map_gda_type_to_glom_type[GDA_TYPE_TIME] = TYPE_TIME;
+    m_map_gda_type_to_glom_type[G_TYPE_DATE] = TYPE_DATE;
+    m_map_gda_type_to_glom_type[G_TYPE_BOOLEAN] = TYPE_BOOLEAN;
+    m_map_gda_type_to_glom_type[GDA_TYPE_BINARY] = TYPE_IMAGE;
+
+    m_map_glom_type_to_gda_type[TYPE_NUMERIC] = GDA_TYPE_NUMERIC;
+    m_map_glom_type_to_gda_type[TYPE_TEXT] = G_TYPE_STRING;
+    m_map_glom_type_to_gda_type[TYPE_TIME] = GDA_TYPE_TIME;
+    m_map_glom_type_to_gda_type[TYPE_DATE] = G_TYPE_DATE;
+    m_map_glom_type_to_gda_type[TYPE_BOOLEAN] = G_TYPE_BOOLEAN;
+    m_map_glom_type_to_gda_type[TYPE_IMAGE] = GDA_TYPE_BINARY;
 
     m_map_type_names_ui[TYPE_INVALID] = _("Invalid");
     m_map_type_names_ui[TYPE_NUMERIC] = _("Number");
Index: glom/libglom/data_structure/field.h
===================================================================
--- glom/libglom/data_structure/field.h	(revision 1082)
+++ glom/libglom/data_structure/field.h	(working copy)
@@ -94,43 +94,43 @@ public:
   void set_glom_type(glom_field_type fieldtype);
 
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::get_name, so that we can use it in the same predicate template.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_name, so that we can use it in the same predicate template.
   virtual Glib::ustring get_name() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_name, for convenience
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_name, for convenience
   virtual void set_name(const Glib::ustring& value);
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::get_auto_increment.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_auto_increment.
   bool get_auto_increment() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_auto_increment.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_auto_increment.
   void set_auto_increment(bool val = true);
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::get_primary_key.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_primary_key.
   bool get_primary_key() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_primary_key.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_primary_key.
   void set_primary_key(bool val = true);
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::get_unique_key.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_unique_key.
   bool get_unique_key() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_unique_key.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_unique_key.
   void set_unique_key(bool val = true);
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::get_default_value.
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_default_value.
   Gnome::Gda::Value get_default_value() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_default_value.
-  void set_default_value(const Gnome::Gda::Value& val);
+  /// This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_default_value.
+  void set_default_value(const Gnome::Gda::Value& value);
 
 
   //TODO_Performance: Lots of code calls this just to call one of its methods:
-  Gnome::Gda::FieldAttributes get_field_info() const;
-  void set_field_info(const Gnome::Gda::FieldAttributes& fieldInfo);
+  Glib::RefPtr<Gnome::Gda::Column> get_field_info() const;
+  void set_field_info(const Glib::RefPtr<Gnome::Gda::Column>& fieldInfo);
 
   /// Ignores any part of FieldAttributes that libgda does not properly fill.
-  bool field_info_from_database_is_equal(const Gnome::Gda::FieldAttributes& field);
+  bool field_info_from_database_is_equal(const Glib::RefPtr<const Gnome::Gda::Column>& field);
 
   //These are not used much:
   Gnome::Gda::Value get_data() const;
@@ -194,8 +194,8 @@ public:
   /// Get the type from a translated name.
   static glom_field_type get_type_for_ui_name(const Glib::ustring& glom_type);
 
-  static glom_field_type get_glom_type_for_gda_type(Gnome::Gda::ValueType gda_type);
-  static Gnome::Gda::ValueType get_gda_type_for_glom_type(Field::glom_field_type glom_type);
+  static glom_field_type get_glom_type_for_gda_type(GType gda_type);
+  static GType get_gda_type_for_glom_type(Field::glom_field_type glom_type);
 
   static bool get_conversion_possible(glom_field_type field_type_src, glom_field_type field_type_dest);
 
@@ -206,11 +206,11 @@ protected:
   static void init_map();
 
   //The glom type to be used for the gda type:
-  typedef std::map<Gnome::Gda::ValueType, glom_field_type> type_map_gda_type_to_glom_type;
+  typedef std::map<GType, glom_field_type> type_map_gda_type_to_glom_type;
   static type_map_gda_type_to_glom_type m_map_gda_type_to_glom_type;
 
   //The gda type to be used for the glom type:
-  typedef std::map<glom_field_type, Gnome::Gda::ValueType> type_map_glom_type_to_gda_type;
+  typedef std::map<glom_field_type, GType> type_map_glom_type_to_gda_type;
   static type_map_glom_type_to_gda_type m_map_glom_type_to_gda_type;
 
   typedef std::list<glom_field_type> type_list_conversion_targets;
@@ -222,7 +222,7 @@ protected:
   static bool m_maps_inited;
 
   glom_field_type m_glom_type;
-  Gnome::Gda::FieldAttributes m_field_info;
+  Glib::RefPtr<Gnome::Gda::Column> m_field_info;
 
   Gnome::Gda::Value m_data; //Not used much.
 
Index: glom/libglom/data_structure/glomconversions.cc
===================================================================
--- glom/libglom/data_structure/glomconversions.cc	(revision 1082)
+++ glom/libglom/data_structure/glomconversions.cc	(working copy)
@@ -165,22 +165,23 @@ Glib::ustring Conversions::get_text_for_
 
 Glib::ustring Conversions::get_text_for_gda_value(Field::glom_field_type glom_type, const Gnome::Gda::Value& value, const std::locale& locale, const NumericFormat& numeric_format, bool iso_format)
 {
-  if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_NULL) //The type can be null for any of the actual field types.
+  if(value.is_null()) //The type can be null for any of the actual field types.
   {
     return "";
   }
 
-  if( (glom_type == Field::TYPE_DATE) && (value.get_value_type() == Gnome::Gda::VALUE_TYPE_DATE))
+  if( (glom_type == Field::TYPE_DATE) && (value.get_value_type() == G_TYPE_DATE))
   {
-    Gnome::Gda::Date gda_date = value.get_date();
+    Glib::Date gda_date = value.get_date();
+    //Gnome::Gda::Date gda_date = value.get_date();
 
     //tm the_c_time = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
     tm the_c_time;
     memset(&the_c_time, 0, sizeof(the_c_time));
 
-    the_c_time.tm_year = gda_date.year - 1900; //C years start are the AD year - 1900. So, 01 is 1901.
-    the_c_time.tm_mon = gda_date.month - 1; //C months start at 0.
-    the_c_time.tm_mday = gda_date.day; //starts at 1
+    the_c_time.tm_year = gda_date.get_year() - 1900; //C years start are the AD year - 1900. So, 01 is 1901.
+    the_c_time.tm_mon = gda_date.get_month() - 1; //C months start at 0.
+    the_c_time.tm_mday = gda_date.get_day(); //starts at 1
 
     return format_date(the_c_time, locale, iso_format);
 
@@ -190,7 +191,7 @@ Glib::ustring Conversions::get_text_for_
     return date.format_string("%x"); //%x means "is replaced by the locale's appropriate date representation".
     */
   }
-  else if((glom_type == Field::TYPE_TIME) && (value.get_value_type() == Gnome::Gda::VALUE_TYPE_TIME))
+  else if((glom_type == Field::TYPE_TIME) && (value.get_value_type() == GDA_TYPE_TIME))
   {
     Gnome::Gda::Time gda_time = value.get_time();
 
@@ -204,7 +205,7 @@ Glib::ustring Conversions::get_text_for_
 
     return format_time(the_c_time, locale, iso_format);
   }
-  else if( (glom_type == Field::TYPE_NUMERIC) && (value.get_value_type() == Gnome::Gda::VALUE_TYPE_NUMERIC))
+  else if( (glom_type == Field::TYPE_NUMERIC) && (value.get_value_type() == GDA_TYPE_NUMERIC))
   {
     const GdaNumeric* gda_numeric = value.get_numeric();
     std::string text_in_c_locale;
@@ -265,7 +266,7 @@ Glib::ustring Conversions::get_text_for_
 
 Gnome::Gda::Value Conversions::parse_value(double number)
 {
-  //This is just a way to get a NUMERIC Gda::Value from a numeric type:
+  //This is just a way to get a NUMERIC Gnome::Gda::Value from a numeric type:
   //Try to parse the inputted number, according to the current locale.
 
   GdaNumeric gda_numeric = {0, 0, 0};
@@ -313,10 +314,8 @@ Gnome::Gda::Value Conversions::parse_val
   {
     tm the_c_time = parse_date(text, the_locale, success);
 
-    Gnome::Gda::Date gda_date = {0, 0, 0};
-    gda_date.year = the_c_time.tm_year + 1900; //The C time starts at 1900.
-    gda_date.month = the_c_time.tm_mon + 1; //The C month starts at 0.
-    gda_date.day = the_c_time.tm_mday; //THe C mday starts at 1.
+    // The C time starts at 1900 and the C month starts at 0.
+    Glib::Date gda_date(the_c_time.tm_mday, static_cast<Glib::Date::Month>(the_c_time.tm_mon + 1), the_c_time.tm_year + 1900);
 
     return Gnome::Gda::Value(gda_date);
   }
@@ -395,7 +394,7 @@ Gnome::Gda::Value Conversions::parse_val
 
     //libgda currently assumes that this buffer is an already-escaped string.
     //TODO: Unescape the text when libgda has been fixed.
-    result.set(text.c_str(), text.size());
+    result.set(reinterpret_cast<const guchar*>(text.c_str()), text.size());
     success = true;
     return result;
   }
@@ -633,11 +632,12 @@ tm Conversions::parse_tm(const Glib::ust
 
 bool Conversions::value_is_empty(const Gnome::Gda::Value& value)
 {
+  if(value.is_null())
+    return true;
+
   switch(value.get_value_type())
   {
-    case(Gnome::Gda::VALUE_TYPE_NULL):
-      return true;
-    case(Gnome::Gda::VALUE_TYPE_STRING):
+    case(G_TYPE_STRING):
       return value.get_string().empty();
     default:
       return false; //None of the other types can be empty. (An empty numeric, date, or time type shows up as a null.
@@ -890,7 +890,7 @@ Gnome::Gda::Value Conversions::parse_esc
 
 Gnome::Gda::Value Conversions::convert_value(const Gnome::Gda::Value& value, Field::glom_field_type target_glom_type)
 {
-  const Field::glom_field_type source_glom_type = Field::get_glom_type_for_gda_type(value.get_value_type());
+  const Field::glom_field_type source_glom_type = Field::get_glom_type_for_gda_type(G_VALUE_TYPE(value.gobj()));
   if(source_glom_type == target_glom_type)
     return value; //No conversion necessary.
   else
@@ -907,10 +907,10 @@ Glib::RefPtr<Gdk::Pixbuf> Conversions::g
 {
   Glib::RefPtr<Gdk::Pixbuf> result;
 
-  if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
+  if(value.get_value_type() == GDA_TYPE_BINARY)
   {
     glong size = 0;
-    const gpointer pData = value.get_binary(size);
+    gconstpointer pData = value.get_binary(size);
     if(size && pData)
     {
       //libgda does not currently properly unescape binary data,
Index: glom/libglom/python_embed/pygdavalue_conversions.h
===================================================================
--- glom/libglom/python_embed/pygdavalue_conversions.h	(revision 1082)
+++ glom/libglom/python_embed/pygdavalue_conversions.h	(working copy)
@@ -6,12 +6,11 @@
 
 G_BEGIN_DECLS
 
-
 int
-pygda_value_from_pyobject(GdaValue *boxed, PyObject *input);
+pygda_value_from_pyobject(GValue *boxed, PyObject *input);
 
 PyObject *
-pygda_value_as_pyobject(const GdaValue *value, gboolean copy_boxed);
+pygda_value_as_pyobject(const GValue *value, gboolean copy_boxed);
 
 G_END_DECLS
 
Index: glom/libglom/python_embed/py_glom_relatedrecord.cc
===================================================================
--- glom/libglom/python_embed/py_glom_relatedrecord.cc	(revision 1082)
+++ glom/libglom/python_embed/py_glom_relatedrecord.cc	(working copy)
@@ -221,7 +221,7 @@ RelatedRecord_tp_as_mapping_getitem(PyOb
                   std::cout << "Debug: query string could not be converted to std::cout: " << ex.what() << std::endl;
                  }
             }*/
-            Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->execute_single_command(sql_query);
+            Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->execute_select_command(sql_query);
             if(datamodel && datamodel->get_n_rows())
             {
               Gnome::Gda::Value value = datamodel->get_value_at(0, 0);
@@ -310,7 +310,7 @@ RelatedRecord_generic_aggregate(PyGlomRe
           + " WHERE \"" + related_table + "\".\"" + related_key_name + "\" = " + *(self->m_from_key_value_sqlized);
 
         //std::cout << "PyGlomRelatedRecord: Executing:  " << sql_query << std::endl;
-        Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->execute_single_command(sql_query);
+        Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->execute_select_command(sql_query);
         if(datamodel && datamodel->get_n_rows())
         {
           Gnome::Gda::Value value = datamodel->get_value_at(0, 0);
Index: glom/libglom/python_embed/pygdavalue_conversions.c
===================================================================
--- glom/libglom/python_embed/pygdavalue_conversions.c	(revision 1082)
+++ glom/libglom/python_embed/pygdavalue_conversions.c	(working copy)
@@ -1,36 +1,49 @@
+#include <Python.h>
+#if PY_VERSION_HEX >= 0x02040000
+# include <datetime.h> /* From Python */
+#endif
 #include "pygdavalue_conversions.h"
-#include <datetime.h> /* From Python */
 
 
 /**
  * pygda_value_from_pyobject:
- * @value: the GdaValue object to store the converted value in.
+ * @value: the GValue object to store the converted value in.
  * @obj: the Python object to convert.
  *
  * This function converts a Python object and stores the result in a
- * GdaValue. If the Python object can't be converted to the
- * type of the GdaValue, then an error is returned.
+ * GValue. If the Python object can't be converted to the
+ * type of the GValue, then an error is returned.
  *
  * Returns: 0 on success, -1 on error.
  */
 int
-pygda_value_from_pyobject(GdaValue *boxed, PyObject *input)
+pygda_value_from_pyobject(GValue *boxed, PyObject *input)
 {
     /* Use an appropriate gda_value_set_*() function.
-       We cannot know what GdaValue type is actually wanted, so
+       We can not know what GValue type is actually wanted, so
        we must still have the get_*() functions in the python API.
      */
-    if (PyString_Check (input)) {
+
+    if (G_IS_VALUE (boxed)) g_value_unset (boxed);
+    if (input == Py_None) {
+      /* Leave value uninitialized to represent NULL value */
+    } else if (PyString_Check (input)) {
       const char* text = PyString_AsString (input);
-      gda_value_set_string (boxed, text);
+      g_value_init (boxed, G_TYPE_STRING);
+      g_value_set_string (boxed, text);
     } else if (PyInt_Check (input)) {
-      gda_value_set_integer (boxed, PyInt_AsLong (input));
+      g_value_init (boxed, G_TYPE_INT);
+      g_value_set_int (boxed, PyInt_AsLong (input));
     } else if (PyLong_Check (input)) {
-      gda_value_set_integer (boxed, PyInt_AsLong (input));
+      g_value_init (boxed, G_TYPE_INT);
+      g_value_set_int (boxed, PyInt_AsLong (input));
     } else if (PyFloat_Check (input)) {
-      gda_value_set_double (boxed, PyFloat_AsDouble (input));
+      g_value_init (boxed, G_TYPE_DOUBLE);
+      g_value_set_double (boxed, PyFloat_AsDouble (input));
     } else if (PyBool_Check (input)) {
-      gda_value_set_boolean (boxed, (input == Py_True));
+      g_value_init (boxed, G_TYPE_BOOLEAN);
+      g_value_set_boolean (boxed, (input == Py_True));
+#if PY_VERSION_HEX >= 0x02040000
     } else if (PyDateTime_Check (input)) {
          GdaTimestamp gda;
          gda.year = PyDateTime_GET_YEAR(input);
@@ -42,11 +55,12 @@ pygda_value_from_pyobject(GdaValue *boxe
          gda.timezone = 0;
          gda_value_set_timestamp (boxed, &gda);
      } else if (PyDate_Check (input)) {
-         GdaDate gda;
+         GDate gda;
          gda.year = PyDateTime_GET_YEAR(input);
          gda.month = PyDateTime_GET_MONTH(input);
          gda.day = PyDateTime_GET_DAY(input);
-         gda_value_set_date(boxed, &gda);
+         g_value_init (boxed, G_TYPE_DATE);
+         g_value_set_boxed(boxed, &gda);
      } else if (PyTime_Check (input)) {
          GdaTime gda;
          gda.hour = PyDateTime_TIME_GET_HOUR(input);
@@ -54,90 +68,93 @@ pygda_value_from_pyobject(GdaValue *boxe
          gda.second = PyDateTime_TIME_GET_SECOND(input);
          gda.timezone = 0;
          gda_value_set_time (boxed, &gda);
+#endif
     } else {
       g_warning("Unhandled python type.");
-      return -1; //failed.
+      return -1; /* failed. */
     }
 
-    return 0; //success.
+    return 0; /* success. */
 }
 
 /**
  * pygda_value_as_pyobject:
- * @value: the GdaValue object.
+ * @value: the GValue object.
  * @copy_boxed: true if boxed values should be copied.
  *
  * This function creates/returns a Python wrapper object that
- * represents the GdaValue passed as an argument.
+ * represents the GValue passed as an argument.
  *
  * Returns: a PyObject representing the value.
  */
 PyObject *
-pygda_value_as_pyobject(const GdaValue *boxed, gboolean copy_boxed)
+pygda_value_as_pyobject(const GValue *boxed, gboolean copy_boxed)
 {
-    GdaValueType value_type = GDA_VALUE_TYPE_UNKNOWN;
+    GType value_type = GDA_TYPE_NULL;
     PyObject* ret = 0;
 
-    value_type = gda_value_get_type ((GdaValue*)boxed);
+    value_type = G_VALUE_TYPE ((GValue*)boxed);
 
+#if PY_VERSION_HEX >= 0x02040000
     PyDateTime_IMPORT; /* So we can use PyDate*() functions. */
+#endif
 
-    if (value_type == GDA_VALUE_TYPE_NULL) {
+    if (value_type == GDA_TYPE_NULL) {
       Py_INCREF (Py_None);
       ret = Py_None;
-    } else if (value_type == GDA_VALUE_TYPE_BIGINT) {
-        ret = PyLong_FromLong (gda_value_get_bigint ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_BIGUINT) {
-        ret = PyLong_FromLong (gda_value_get_biguint ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_BINARY) {
-        glong size = 0;
-        const gchar* val = (const gchar*)gda_value_get_binary ((GdaValue*)boxed, &size);
-        ret = PyString_FromString (val); //TODO: Use the size.
-    } else if (value_type == GDA_VALUE_TYPE_BLOB) {
-        /* const GdaBlob* val = gda_value_get_blob ((GdaValue*)boxed); */
+    } else if (value_type == G_TYPE_INT64) {
+        ret = PyLong_FromLong (g_value_get_int64 ((GValue*)boxed));
+    } else if (value_type == G_TYPE_UINT64) {
+        ret = PyLong_FromLong (g_value_get_uint64 ((GValue*)boxed));
+    } else if (value_type == GDA_TYPE_BINARY) {
+        const GdaBinary* gdabinary = gda_value_get_binary((GValue*)boxed);
+        ret = PyString_FromString ((const char*)gdabinary->data); /* TODO: Use the size. TODO: Check for null GdaBinary. */
+    } else if (value_type == GDA_TYPE_BLOB) {
+        /* const GdaBlob* val = gda_value_get_blob ((GValue*)boxed); */
         ret = 0; /* TODO: This thing has a whole read/write API. */
-    } else if (value_type == GDA_VALUE_TYPE_BOOLEAN) {
-        ret = PyBool_FromLong (gda_value_get_boolean ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_DATE) {
-        const GdaDate* val = gda_value_get_date ((GdaValue*)boxed);
+    } else if (value_type == G_TYPE_BOOLEAN) {
+        ret = PyBool_FromLong (g_value_get_boolean ((GValue*)boxed));
+#if PY_VERSION_HEX >= 0x02040000
+    } else if (value_type == G_TYPE_DATE) {
+        const GDate* val = (const GDate*)g_value_get_boxed ((GValue*)boxed);
         if(val)
           ret = PyDate_FromDate(val->year, val->month, val->day);
-    } else if (value_type == GDA_VALUE_TYPE_DOUBLE) {
-        ret = PyFloat_FromDouble (gda_value_get_double ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_GEOMETRIC_POINT) {
-        const GdaGeometricPoint* val = gda_value_get_geometric_point ((GdaValue*)boxed);
+#endif
+    } else if (value_type == G_TYPE_DOUBLE) {
+        ret = PyFloat_FromDouble (g_value_get_double ((GValue*)boxed));
+    } else if (value_type == GDA_TYPE_GEOMETRIC_POINT) {
+        const GdaGeometricPoint* val = gda_value_get_geometric_point ((GValue*)boxed);
         ret = Py_BuildValue ("(ii)", val->x, val->y);
-    } else if (value_type == GDA_VALUE_TYPE_INTEGER) {
-        ret = PyInt_FromLong (gda_value_get_integer ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_MONEY) {
-        const GdaMoney* val = gda_value_get_money ((GdaValue*)boxed);
-        ret = PyFloat_FromDouble(val->amount); /* TODO: We ignore the currency. */
-    } else if (value_type == GDA_VALUE_TYPE_NUMERIC) {
-        const GdaNumeric* val = gda_value_get_numeric ((GdaValue*)boxed);
+    } else if (value_type == G_TYPE_INT) {
+        ret = PyInt_FromLong (g_value_get_int ((GValue*)boxed));
+    } else if (value_type == GDA_TYPE_NUMERIC) {
+        const GdaNumeric* val = gda_value_get_numeric ((GValue*)boxed);
         const gchar* number_as_text = val->number; /* Formatted according to the C locale, probably. */
         /* This would need a string _object_: ret = PyFloat_FromString(number_as_text, 0); */
-        ret = PyFloat_FromDouble (PyOS_ascii_strtod (number_as_text, 0));
-    } else if (value_type == GDA_VALUE_TYPE_SINGLE) {
-        ret = PyFloat_FromDouble (gda_value_get_single ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_SMALLINT) {
-        ret = PyInt_FromLong (gda_value_get_smallint ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_STRING) {
-        const gchar* val = gda_value_get_string ((GdaValue*)boxed);
+        ret = PyFloat_FromDouble (g_ascii_strtod (number_as_text, NULL));
+    } else if (value_type == G_TYPE_FLOAT) {
+        ret = PyFloat_FromDouble (g_value_get_float ((GValue*)boxed));
+    } else if (value_type == GDA_TYPE_SHORT) {
+        ret = PyInt_FromLong (gda_value_get_short ((GValue*)boxed));
+    } else if (value_type == G_TYPE_STRING) {
+        const gchar* val = g_value_get_string ((GValue*)boxed);
         ret = PyString_FromString (val);
-    } else if (value_type == GDA_VALUE_TYPE_TIME) {
-        const GdaTime* val = gda_value_get_time ((GdaValue*)boxed);
-        ret = PyTime_FromTime(val->hour, val->minute, val->second, 0); /* TODO: Should we ignore GdaDate::timezone ? */
-    } else if (value_type == GDA_VALUE_TYPE_TIMESTAMP) {
-        const GdaTimestamp* val = gda_value_get_timestamp ((GdaValue*)boxed);
+    } else if (value_type == GDA_TYPE_TIME) {
+#if PY_VERSION_HEX >= 0x02040000
+        const GdaTime* val = gda_value_get_time ((GValue*)boxed);
+        ret = PyTime_FromTime(val->hour, val->minute, val->second, 0); /* TODO: Should we ignore GDate::timezone ? */
+    } else if (value_type == GDA_TYPE_TIMESTAMP) {
+        const GdaTimestamp* val = gda_value_get_timestamp ((GValue*)boxed);
         ret = PyDateTime_FromDateAndTime(val->year, val->month, val->day, val->hour, val->minute, val->second, 0); /* TODO: Should we ignore GdaTimestamp::timezone ? */
-    } else if (value_type == GDA_VALUE_TYPE_TINYINT) {
-        ret = PyInt_FromLong (gda_value_get_tinyint ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_TINYUINT) {
-        ret = PyInt_FromLong (gda_value_get_tinyuint ((GdaValue*)boxed));
-    } else if (value_type == GDA_VALUE_TYPE_UINTEGER) {
-        ret = PyInt_FromLong (gda_value_get_uinteger ((GdaValue*)boxed));
+#endif
+    } else if (value_type == GDA_TYPE_SHORT) {
+        ret = PyInt_FromLong (gda_value_get_short ((GValue*)boxed));
+    } else if (value_type == GDA_TYPE_USHORT) {
+        ret = PyInt_FromLong (gda_value_get_ushort ((GValue*)boxed));
+    } else if (value_type == G_TYPE_UINT) {
+        ret = PyInt_FromLong (g_value_get_uint ((GValue*)boxed));
     } else {
-      g_warning ("gda_value_get_type() returned unknown type %d", value_type);
+      g_warning ("G_VALUE_TYPE() returned unknown type %d", value_type);
 
       Py_INCREF (Py_None);
       ret = Py_None;
@@ -145,4 +162,3 @@ pygda_value_as_pyobject(const GdaValue *
 
     return ret;
 }
-
Index: glom/libglom/connectionpool.cc
===================================================================
--- glom/libglom/connectionpool.cc	(revision 1082)
+++ glom/libglom/connectionpool.cc	(working copy)
@@ -234,23 +234,24 @@ sharedptr<SharedConnection> ConnectionPo
         bool try_another_port = true;
         while(try_another_port)
         { 
-          const Glib::ustring cnc_string_main = "HOST=" + get_host() + ";USER=" + m_user + ";PASSWORD=" + m_password + ";PORT=" + port;
+//          const Glib::ustring cnc_string_main = "HOST=" + get_host() + ";USER=" + m_user + ";PASSWORD=" + m_password + ";PORT=" + port;
+	  const Glib::ustring cnc_string_main = "HOST=" + get_host() + ";PORT=" + port;
 
           Glib::ustring cnc_string = cnc_string_main;
 
           if(!m_database.empty())
-            cnc_string += (";DATABASE=" + m_database);
+            cnc_string += (";DB_NAME=" + m_database);
           else
-            cnc_string += (";DATABASE=" + default_database);
+            cnc_string += (";DB_NAME=" + default_database);
 
           //std::cout << "debug: connecting: cnc string: " << cnc_string << std::endl;
           std::cout << std::endl << "Glom: trying to connect on port=" << port << std::endl;
 
           //*m_refGdaConnection = m_GdaClient->open_connection(m_GdaDataSourceInfo.get_name(), m_GdaDataSourceInfo.get_username(), m_GdaDataSourceInfo.get_password() );
           //m_refGdaConnection.clear(); //Make sure any previous connection is really forgotten.
-          m_refGdaConnection = m_GdaClient->open_connection_from_string("PostgreSQL", cnc_string);
-          if(m_refGdaConnection)
+          try
           {
+            m_refGdaConnection = m_GdaClient->open_connection_from_string("PostgreSQL", cnc_string, m_user, m_password);
             //g_warning("ConnectionPool: connection opened");
 
             //Remember what port is working:
@@ -261,7 +262,7 @@ sharedptr<SharedConnection> ConnectionPo
               m_pFieldTypes = new FieldTypes(m_refGdaConnection);  
 
             //Enforce ISO formats in the communication:
-            m_refGdaConnection->execute_single_command("SET DATESTYLE = 'ISO'");  
+            m_refGdaConnection->execute_non_select_command("SET DATESTYLE = 'ISO'");  
 
             //Open the database, if one has been specified:
             /* This does not seem to work in libgda's postgres provider, so we specify it in the cnc_string instead:
@@ -271,11 +272,11 @@ sharedptr<SharedConnection> ConnectionPo
             */
 
             //Get postgres version:
-            Glib::RefPtr<Gnome::Gda::DataModel> data_model = m_refGdaConnection->execute_single_command("SELECT version()");
+            Glib::RefPtr<Gnome::Gda::DataModel> data_model = m_refGdaConnection->execute_select_command("SELECT version()");
             if(data_model && data_model->get_n_rows() && data_model->get_n_columns())
             {
               Gnome::Gda::Value value = data_model->get_value_at(0, 0);
-              if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_STRING)
+              if(value.get_value_type() == G_TYPE_STRING)
               {
                 const Glib::ustring version_text = value.get_string();
 
@@ -295,9 +296,9 @@ sharedptr<SharedConnection> ConnectionPo
 
             return connect(); //Call this method recursively. This time m_refGdaConnection exists.
           }
-          else
+          catch(const Gnome::Gda::ConnectionError& ex)
           {
-            std::cout << "ConnectionPool::connect() Attempt to connect to database failed on port=" << port << ", database=" << m_database << std::endl;
+            std::cout << "ConnectionPool::connect() Attempt to connect to database failed on port=" << port << ", database=" << m_database << ": " << ex.what() << std::endl;
 
             bool bJustDatabaseMissing = false;
             if(!m_database.empty())
@@ -307,21 +308,22 @@ sharedptr<SharedConnection> ConnectionPo
               //If the connection failed while looking for a database,
               //then try connecting without the database:
               Glib::ustring cnc_string = cnc_string_main;
-              cnc_string += (";DATABASE=" + default_database);
+              cnc_string += (";DB_NAME=" + default_database);
 
               //std::cout << "debug2: connecting: cnc string: " << cnc_string << std::endl;
               std::cout << "Glom: connecting." << std::endl;
 
-              Glib::RefPtr<Gnome::Gda::Connection> gda_connection =  m_GdaClient->open_connection_from_string("PostgreSQL", cnc_string);
-              if(gda_connection) //If we could connect without specifying the database.
-              {
+              try
+	      {
+	        //If we could connect without specifying the database.
+                Glib::RefPtr<Gnome::Gda::Connection> gda_connection = m_GdaClient->open_connection_from_string("PostgreSQL", cnc_string, m_user, m_password);
                 bJustDatabaseMissing = true;
                 connection_to_default_database_possible = true;
                 m_port = port;
               }
-              else
+              catch(const Gnome::Gda::ConnectionError& ex)
               {
-                std::cerr << "    ConnectionPool::connect() connection also failed when not specifying database." << std::endl;
+                std::cerr << "    ConnectionPool::connect() connection also failed when not specifying database: " << ex.what() << std::endl;
               }
             }
 
@@ -412,6 +414,11 @@ Glib::ustring ConnectionPool::get_host()
   return m_host;
 }
 
+Glib::ustring ConnectionPool::get_port() const
+{
+  return m_port;
+}
+
 Glib::ustring ConnectionPool::get_user() const
 {
   return m_user;
@@ -462,8 +469,8 @@ bool ConnectionPool::handle_error(bool c
   {
     Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
 
-    typedef std::list< Glib::RefPtr<Gnome::Gda::Error> > type_list_errors;
-    type_list_errors list_errors = gda_connection->get_errors();
+    typedef std::list< Glib::RefPtr<Gnome::Gda::ConnectionEvent> > type_list_errors;
+    type_list_errors list_errors = gda_connection->get_events();
 
     if(!list_errors.empty())
     {
Index: glom/box_db_table.cc
===================================================================
--- glom/box_db_table.cc	(revision 1082)
+++ glom/box_db_table.cc	(working copy)
@@ -106,7 +106,7 @@ Box_DB_Table::type_vecFields Box_DB_Tabl
   int columns =  data_model->get_n_columns();
   for(int i = 0; i < columns; ++i)
   {
-    Gnome::Gda::FieldAttributes fieldinfo = data_model->describe_column(i);
+    Glib::RefPtr<Gnome::Gda::Column> fieldinfo = data_model->describe_column(i);
     sharedptr<Field> field(new Field());
     field->set_field_info(fieldinfo); //TODO: Get glom-specific information from document?
     result.push_back( field );
@@ -116,7 +116,7 @@ Box_DB_Table::type_vecFields Box_DB_Tabl
 }
 */
 
-Glib::ustring Box_DB_Table::postgres_get_field_definition_for_sql(const Gnome::Gda::FieldAttributes& field_info)
+Glib::ustring Box_DB_Table::postgres_get_field_definition_for_sql(const Glib::RefPtr<const Gnome::Gda::Column>& field_info)
 {
   Glib::ustring strResult;
 
@@ -124,7 +124,7 @@ Glib::ustring Box_DB_Table::postgres_get
   Glib::ustring strType = "unknowntype";
 
   //Postgres has a special "serial" datatype. (MySQL uses a numeric type, and has an extra "AUTO_INCREMENT" command)
-  if(false) //disabled for now - see generate_next_auto_increment() //field_info.get_auto_increment())
+  if(false) //disabled for now - see generate_next_auto_increment() //field_info->get_auto_increment())
   {
     strType = "serial";
   }
@@ -136,7 +136,7 @@ Glib::ustring Box_DB_Table::postgres_get
       const FieldTypes* pFieldTypes = pConnectionPool->get_field_types();
       if(pFieldTypes)
       {
-        const Gnome::Gda::ValueType fieldType = field_info.get_gdatype();
+        const GType fieldType = field_info->get_g_type();
         strType = pFieldTypes->get_string_name_for_gdavaluetype(fieldType);
       }
     }
@@ -188,23 +188,23 @@ Glib::ustring Box_DB_Table::postgres_get
   */
 
   //Unique:
-  if(field_info.get_unique_key())
+  if(field_info->get_unique_key())
     strResult += " UNIQUE";
 
   /* Posgres needs us to do this separately
   //Not Null:
-  if(!(field_info.get_allow_null()))
+  if(!(field_info->get_allow_null()))
     strResult += " NOT NULL";
   */
 
   //Default:
-  Gnome::Gda::Value valueDefault = field_info.get_default_value();
+  Gnome::Gda::Value valueDefault = field_info->get_default_value();
   const Glib::ustring& strDefault =  valueDefault.to_string();
   if(!strDefault.empty() && strDefault != "NULL")
     strResult += " DEFAULT " + strDefault; //TODO: Quote/Escape it if necessary.
 
   //Primary Key:
-  if(field_info.get_primary_key())
+  if(field_info->get_primary_key())
     strResult += " PRIMARY KEY";
 
   return strResult;
Index: glom/utility_widgets/db_adddel/db_adddel.cc
===================================================================
--- glom/utility_widgets/db_adddel/db_adddel.cc	(revision 1082)
+++ glom/utility_widgets/db_adddel/db_adddel.cc	(working copy)
@@ -1309,7 +1309,7 @@ void DbAddDel::on_treeview_cell_edited_b
     Gnome::Gda::Value value_old;
     row.get_value(tree_model_column_index, value_old);
 
-    const bool bValueOld = (value_old.get_value_type() == Gnome::Gda::VALUE_TYPE_BOOLEAN) && value_old.get_bool();
+    const bool bValueOld = (value_old.get_value_type() == G_TYPE_BOOLEAN) && value_old.get_boolean();
     bool bValueNew = !bValueOld;
     Gnome::Gda::Value value_new;
     value_new.set(bValueNew);
@@ -1898,7 +1898,7 @@ void DbAddDel::treeviewcolumn_on_cell_da
         {
           Gtk::CellRendererToggle* pDerived = dynamic_cast<Gtk::CellRendererToggle*>(renderer);
           if(pDerived)
-            pDerived->set_active( (value.get_value_type() == Gnome::Gda::VALUE_TYPE_BOOLEAN) && value.get_bool() ); 
+            pDerived->set_active( (value.get_value_type() == G_TYPE_BOOLEAN) && value.get_boolean() ); 
 
           break;
         }
Index: glom/utility_widgets/db_adddel/glom_db_treemodel.cc
===================================================================
--- glom/utility_widgets/db_adddel/glom_db_treemodel.cc	(revision 1082)
+++ glom/utility_widgets/db_adddel/glom_db_treemodel.cc	(working copy)
@@ -229,7 +229,7 @@ bool DbTreeModel::refresh_from_database(
     }
     try
     {
-      m_gda_datamodel = m_connection->get_gda_connection()->execute_single_command(sql_query);
+      m_gda_datamodel = m_connection->get_gda_connection()->execute_select_command(sql_query);
     }
     catch(const std::exception& ex)
     {
@@ -891,14 +891,14 @@ void DbTreeModel::get_record_counts(gulo
       //Ask the database how many records there are in the whole table:
       //TODO: Apparently, this is very slow:
       const Glib::ustring sql_query = "SELECT count(*) FROM \"" + m_found_set.m_table_name + "\"";
-      Glib::RefPtr<Gnome::Gda::DataModel> datamodel = m_connection->get_gda_connection()->execute_single_command(sql_query);
+      Glib::RefPtr<Gnome::Gda::DataModel> datamodel = m_connection->get_gda_connection()->execute_select_command(sql_query);
 
       if(datamodel)
       {
         if(datamodel->get_n_rows())
         {
           Gnome::Gda::Value value = datamodel->get_value_at(0, 0);
-          total = (gulong)value.get_bigint(); //I discovered that it's a bigint by trying it.
+	  total = (gulong)value.get_int64(); //I discovered that it's a int64 by trying it.
         }
       }
     }
Index: glom/utility_widgets/imageglom.cc
===================================================================
--- glom/utility_widgets/imageglom.cc	(revision 1082)
+++ glom/utility_widgets/imageglom.cc	(working copy)
@@ -225,7 +225,7 @@ Gnome::Gda::Value ImageGlom::get_value()
       //libgda currently assumes that this buffer is an already-escaped string.
       //TODO: Just use the raw buffer when libgda (in libgda-2.0) has been fixed:
       Glib::ustring binary_escaped = Conversions::get_escaped_binary_data((guint8*)buffer, buffer_size);
-      result.set(binary_escaped.c_str(), binary_escaped.size());
+      result.set(reinterpret_cast<const guchar*>(binary_escaped.c_str()), binary_escaped.size());
 
       g_free(buffer);
       buffer = 0;
Index: glom/utility_widgets/adddel/adddel.cc
===================================================================
--- glom/utility_widgets/adddel/adddel.cc	(revision 1082)
+++ glom/utility_widgets/adddel/adddel.cc	(working copy)
@@ -1617,8 +1617,9 @@ bool AddDel::row_has_duplicates(const Gt
     {
       Gtk::TreeModel::Row row = *iter;
 
-      //We can't just use ValueBase, because Glib::ValueBase has no operator==, because there is no g_value_equal
-      //Glib::ValueBase value_this_row;
+      //We can't just use Value, because Gnome::Gda::Value has no operator==, because there is no g_value_equal
+      //Gnome::Gda::Value value_this_row;
+      //TODO: Actually, Gnome::Gda::Value has an operator==
       //iter->get_value(col, value_this_row);
 
       Glib::ustring value_text;
@@ -1640,8 +1641,9 @@ bool AddDel::row_has_duplicates(const Gt
         if(iterCheck != iter) //Don't compare the row with itself
         {
           Gtk::TreeModel::Row check_row = *iterCheck;
-          ////Glib::ValueBase has no operator==, because there is no g_value_equal
-          //Glib::ValueBase value_check_row;
+          ////Gnome::Gda::Value has no operator==, because there is no g_value_equal
+          //Gnome::Gda::Value value_check_row;
+          //TODO: Actually, Gnome::Gda::Value has an operator==
           //iterCheck->get_value(col, value_check_row);
           //
           //if(value_check_row == value_this_row)
Index: glom/utility_widgets/dialog_choose_date.cc
===================================================================
--- glom/utility_widgets/dialog_choose_date.cc	(revision 1082)
+++ glom/utility_widgets/dialog_choose_date.cc	(working copy)
@@ -46,35 +46,31 @@ Dialog_ChooseDate::~Dialog_ChooseDate()
 
 void Dialog_ChooseDate::set_date_chosen(const Gnome::Gda::Value& value)
 {
-  if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_DATE) //Otherwise GtkCalendar defaults to the current (today's) date.
+  if(value.get_value_type() == G_TYPE_DATE) //Otherwise GtkCalendar defaults to the current (today's) date.
   {
-    Gnome::Gda::Date date = value.get_date();
+    Glib::Date date = value.get_date();
 
-    guint month = date.month;
+    guint month = static_cast<guint>(date.get_month());
     if(month != 0)
       --month; //Gtk::Calendar months start at 0.
 
-    m_calendar->select_month(month, date.year);
-    m_calendar->select_day(date.day);
+    m_calendar->select_month(month, date.get_year());
+    m_calendar->select_day(date.get_day());
   }
 }
 
 Gnome::Gda::Value Dialog_ChooseDate::get_date_chosen() const
 {
-  Gnome::Gda::Date date = {0, 0, 0};
   guint year = 0;
   guint month = 0;
   guint day = 0;
 
   m_calendar->get_date(year, month, day);
-  date.year = year;
 
-  date.month = month + 1; //GtkCalendar months start at 0.
-  if(date.month > 12)
-    date.month = 12;
-
-  date.day = day;
+  ++ month; //GtkCalendar months start at 0.
+  if(month > 12) month = 12;
 
+  Glib::Date date(day, static_cast<Glib::Date::Month>(month), year);
   return Gnome::Gda::Value(date);
 }
 
Index: glom/utility_widgets/datawidget.cc
===================================================================
--- glom/utility_widgets/datawidget.cc	(revision 1082)
+++ glom/utility_widgets/datawidget.cc	(working copy)
@@ -279,8 +279,8 @@ void DataWidget::set_value(const Gnome::
     if(checkbutton)
     {
       bool bValue = false;
-      if(!value.is_null() && value.get_value_type() == Gnome::Gda::VALUE_TYPE_BOOLEAN)
-        bValue = value.get_bool();
+      if(!value.is_null() && value.get_value_type() == G_TYPE_BOOLEAN)
+        bValue = value.get_boolean();
 
       checkbutton->set_active( bValue );
     }
@@ -326,10 +326,7 @@ int DataWidget::get_suitable_width(const
   {
     case(Field::TYPE_DATE):
     {
-      Gnome::Gda::Date date = {0, 0, 0};
-      date.day = 31;
-      date.month = 12;
-      date.year = 2000;
+      Glib::Date date(31, Glib::Date::Month(12), 2000);
       example_text = Conversions::get_text_for_gda_value(field_type, Gnome::Gda::Value(date));
       break;
     }
Index: glom/frame_glom.cc
===================================================================
--- glom/frame_glom.cc	(revision 1082)
+++ glom/frame_glom.cc	(working copy)
@@ -1062,7 +1062,7 @@ void Frame_Glom::update_table_in_documen
   //Add any new/changed information from the database to the document
   //The database should never change without the knowledge of the document anyway, so this should be unnecessary.
 
-  //TODO_performance: There are a lot of temporary Field and FieldAttributes instances here, with a lot of string copying.
+  //TODO_performance: There are a lot of temporary Field and Column instances here, with a lot of string copying.
 
   //For instance, changed field details, or new fields, or removed fields.
   typedef Box_DB_Table::type_vecFields type_vecFields;
@@ -1095,7 +1095,7 @@ void Frame_Glom::update_table_in_documen
         else //if it was found.
         {
           //Compare the information:
-          Gnome::Gda::FieldAttributes field_info_db = field_database->get_field_info();
+          Glib::RefPtr<Gnome::Gda::Column> field_info_db = field_database->get_field_info();
           sharedptr<Field> field_document =  *iterFindDoc;
           if(field_document)
           {
@@ -1104,7 +1104,7 @@ void Frame_Glom::update_table_in_documen
               //The database has different information. We assume that the information in the database is newer.
 
               //Update the field information:
-              field_info_db.set_auto_increment( field_document->get_auto_increment() ); //libgda does not report it from the database properly.
+              field_info_db->set_auto_increment( field_document->get_auto_increment() ); //libgda does not report it from the database properly.
               (*iterFindDoc)->set_field_info( field_info_db );
 
               document_must_to_be_updated = true;
@@ -1648,6 +1648,11 @@ bool Frame_Glom::create_database(const G
   }
   else
   {
+    // If we acquire a connection here, we get a runtime error saying that the
+    // database could not be create because the source database is still in
+    // use. I don't think we need this with libgda-3.0 anyway. armin.
+    // TODO: Cleanup.
+#if 0
     //This must now succeed, because we've already tried it once:
     sharedptr<SharedConnection> sharedconnection;
     try
@@ -1667,9 +1672,18 @@ bool Frame_Glom::create_database(const G
 
       return false;
     }
+#endif
 
+#if 1
+    // This seems to increase the change that the database creation does not
+    // fail due to the "source database is still in use" error. This might
+    // be subjective, though. armin.
+    std::cout << "Going to sleep" << std::endl;
+    Glib::usleep(2 * 1000 * 1000);
+    std::cout << "Awake" << std::endl;
+#endif
 
-    if(sharedconnection)
+    //if(sharedconnection)
     {
       Gtk::Window* pWindowApp = get_app_window();
       g_assert(pWindowApp);
@@ -1678,21 +1692,60 @@ bool Frame_Glom::create_database(const G
 
       //std::cout << "Frame_Glom::create_database():  debug: before calling sharedconnection->get_gda_connection." << std::endl;
 
-      Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
-      if(connection)
+      //Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
+      //if(connection)
       {
-        const bool test = connection->create_database(database_name);
-        if(!test)
-        {
-          //TODO: Discover the cause of the error somehow.
+	try
+	{
+	  Glib::RefPtr<Gnome::Gda::Client> client = Gnome::Gda::Client::create();
+	  Glib::RefPtr<Gnome::Gda::ServerOperation> op = client->prepare_create_database(database_name, "PostgreSQL");
+	  op->set_value_at("/SERVER_CNX_P/HOST", ConnectionPool::get_instance()->get_host());
+	  op->set_value_at("/SERVER_CNX_P/PORT", ConnectionPool::get_instance()->get_port());
+	  op->set_value_at("/SERVER_CNX_P/ADM_LOGIN", ConnectionPool::get_instance()->get_user());
+	  op->set_value_at("/SERVER_CNX_P/ADM_PASSWORD", ConnectionPool::get_instance()->get_password());
+	  client->perform_create_database(op);
+#if 0
+	  GError* error = NULL;
+	  GdaClient* client = gda_client_new(); //gda_connection_get_client(connection->gobj());
+	  //GdaClient* client = gda_connection_get_client(connection->gobj());
+	  GdaServerOperation* op = gda_client_prepare_create_database(client, database_name.c_str(), "PostgreSQL");
+	  gda_server_operation_set_value_at(op, ConnectionPool::get_instance()->get_host().c_str(), NULL, "/SERVER_CNX_P/HOST");
+	  gda_server_operation_set_value_at(op, ConnectionPool::get_instance()->get_port().c_str(), NULL, "/SERVER_CNX_P/PORT");
+	  gda_server_operation_set_value_at(op, ConnectionPool::get_instance()->get_user().c_str(), NULL, "/SERVER_CNX_P/ADM_LOGIN");
+	  gda_server_operation_set_value_at(op, ConnectionPool::get_instance()->get_password().c_str(), NULL, "/SERVER_CNX_P/ADM_PASSWORD");
+	  gda_client_perform_create_database(client, op, &error);
+	  xmlNodePtr ptr = gda_server_operation_save_data_to_xml(op, NULL);
+	  if(ptr)
+	  {
+	    xmlDocPtr xml = xmlNewDoc(NULL);
+	    xmlDocSetRootElement(xml, ptr);
+	    xmlDocDump(stdout, xml);
+
+	    std::cout << "Host: " << ConnectionPool::get_instance()->get_host() << std::endl;
+	    std::cout << "Port: " << ConnectionPool::get_instance()->get_port() << std::endl;
+	    std::cout << "User: " << ConnectionPool::get_instance()->get_user() << std::endl;
+	    std::cout << "Password: " << ConnectionPool::get_instance()->get_password() << std::endl;
+	  }
+	  if(error != NULL)
+	    throw Glib::Error(error);
+#endif
+#if 0
+          Glib::RefPtr<Gnome::Gda::Client> client = connection->get_client();
+	  Glib::RefPtr<Gnome::Gda::ServerOperation> op = client->prepare_create_database(database_name, "PostgreSQL");
+	  client->perform_create_database(op);
+#endif
+	}
+	catch(const Glib::Exception& ex) // libgda does not set error domain
+	{
           //I think a failure here might be caused by installing unstable libgda, which seems to affect stable libgda-1.2.
           //Doing a "make install" in libgda-1.2 seems to fix this:
-          std::cerr << "Frame_Glom::create_database():  Gnome::Gda::Connection::create_database(" << database_name << ") failed." << std::endl;
+          std::cerr << "Frame_Glom::create_database():  Gnome::Gda::Connection::create_database(" << database_name << ") failed: " << ex.what() << std::endl;
 
           //Tell the user:
           Gtk::Dialog* dialog = 0;
           try
           {
+	    // TODO: Tell the user what has gone wrong (ex.what())
             Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create(GLOM_GLADEDIR "glom.glade", "dialog_error_create_database");
             refXml->get_widget("dialog_error_create_database", dialog);
             dialog->set_transient_for(*pWindowApp);
Index: glom/base_db.cc
===================================================================
--- glom/base_db.cc	(revision 1082)
+++ glom/base_db.cc	(working copy)
@@ -193,8 +193,21 @@ Glib::RefPtr<Gnome::Gda::DataModel> Base
         std::cout << "Debug: query string could not be converted to std::cout: " << ex.what() << std::endl;
       }
     }
-    
-    result = gda_connection->execute_single_command(strQuery);
+
+    // TODO: Several functions call query_execute with non-select queries.
+    // Before libgda-3.0, execute_single_command returned always a datamodel
+    // on success. In case of a successful non-select command, we therefore
+    // create an empty datamodel to return, to make clear that the function
+    // succeeded. Probably, we should introduce another
+    // query_execute_non_select in the long term. 
+    if(strQuery.compare(0, 6, "SELECT") == 0)
+      result = gda_connection->execute_select_command(strQuery);
+    else
+    {
+      if(gda_connection->execute_non_select_command(strQuery) != -1)
+        result = Gnome::Gda::DataModelArray::create(1);
+    }
+
     if(!result)
     {
       std::cerr << "Glom  Base_DB::query_execute(): Error while executing SQL" << std::endl <<
@@ -255,7 +268,7 @@ Base_DB::type_vecStrings Base_DB::get_ta
 
         //Get the table name:
         Glib::ustring table_name;
-        if(value.get_value_type() ==  Gnome::Gda::VALUE_TYPE_STRING)
+        if(G_VALUE_TYPE(value.gobj()) ==  G_TYPE_STRING)
         {
           table_name = value.get_string();
 
@@ -387,9 +400,10 @@ Base_DB::type_vecFields Base_DB::get_fie
   {
     Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
 
-    Gnome::Gda::Parameter param_table_name("name", table_name);
-    Gnome::Gda::ParameterList param_list;
-    param_list.add_parameter(param_table_name);
+    Glib::RefPtr<Gnome::Gda::Parameter> param_table_name = Gnome::Gda::Parameter::create("name", table_name);
+    //Gnome::Gda::Parameter param_table_name("name", table_name);
+    Glib::RefPtr<Gnome::Gda::ParameterList> param_list = Gnome::Gda::ParameterList::create();
+    param_list->add_parameter(param_table_name);
 
     Glib::RefPtr<Gnome::Gda::DataModel> data_model_fields = connection->get_schema(Gnome::Gda::CONNECTION_SCHEMA_FIELDS, param_list);
 
@@ -411,22 +425,22 @@ Base_DB::type_vecFields Base_DB::get_fie
       guint rows_count = data_model_fields->get_n_rows();
       while(row < rows_count)
       {
-        Gnome::Gda::FieldAttributes field_info;
+        Glib::RefPtr<Gnome::Gda::Column> field_info = Gnome::Gda::Column::create();
 
         //Get the field name:
         Gnome::Gda::Value value_name = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_NAME, row);
-        if(value_name.get_value_type() ==  Gnome::Gda::VALUE_TYPE_STRING)
+        if(value_name.get_value_type() ==  G_TYPE_STRING)
         {
           if(value_name.get_string().empty())
             g_warning("Base_DB::get_fields_for_table_from_database(): value_name is empty.");
 
-          field_info.set_name( value_name.get_string() ); //TODO: get_string() is a dodgy choice. murrayc.
+          field_info->set_name( value_name.get_string() ); //TODO: get_string() is a dodgy choice. murrayc.
         }
 
         //Get the field type:
-        //This is a string representation of the type, so we need to discover the Gnome::Gda::ValueType for it:
+        //This is a string representation of the type, so we need to discover the GType for it:
         Gnome::Gda::Value value_fieldtype = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_TYPE, row);
-        if(value_fieldtype.get_value_type() ==  Gnome::Gda::VALUE_TYPE_STRING)
+        if(value_fieldtype.get_value_type() ==  G_TYPE_STRING)
         {
            Glib::ustring schema_type_string = value_fieldtype.get_string();
            if(!schema_type_string.empty())
@@ -435,8 +449,8 @@ Base_DB::type_vecFields Base_DB::get_fie
              const FieldTypes* pFieldTypes = connection_pool->get_field_types();
              if(pFieldTypes)
              {
-               Gnome::Gda::ValueType gdatype = pFieldTypes->get_gdavalue_for_schema_type_string(schema_type_string);
-               field_info.set_gdatype(gdatype);
+               GType gdatype = pFieldTypes->get_gdavalue_for_schema_type_string(schema_type_string);
+               field_info->set_g_type(gdatype);
              }
            }
         }
@@ -444,33 +458,33 @@ Base_DB::type_vecFields Base_DB::get_fie
         //Get the default value:
         /* libgda does not return this correctly yet. TODO: check bug http://bugzilla.gnome.org/show_bug.cgi?id=143576
         Gnome::Gda::Value value_defaultvalue = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_DEFAULTVALUE, row);
-        if(value_defaultvalue.get_value_type() ==  Gnome::Gda::VALUE_TYPE_STRING)
-          field_info.set_default_value(value_defaultvalue);
+        if(value_defaultG_VALUE_TYPE(value.gobj()) ==  G_TYPE_STRING)
+          field_info->set_default_value(value_defaultvalue);
         */
 
         //Get whether it can be null:
         Gnome::Gda::Value value_notnull = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_NOTNULL, row);
-        if(value_notnull.get_value_type() ==  Gnome::Gda::VALUE_TYPE_BOOLEAN)
-          field_info.set_allow_null(value_notnull.get_bool());
+        if(value_notnull.get_value_type() ==  G_TYPE_BOOLEAN)
+          field_info->set_allow_null(value_notnull.get_boolean());
 
 
         //Get whether it is a primary key:
         Gnome::Gda::Value value_primarykey = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_PRIMARYKEY, row);
-        if(value_primarykey.get_value_type() ==  Gnome::Gda::VALUE_TYPE_BOOLEAN)
-          field_info.set_primary_key( value_primarykey.get_bool() );
+        if(value_primarykey.get_value_type() ==  G_TYPE_BOOLEAN)
+          field_info->set_primary_key( value_primarykey.get_boolean() );
 
         //Get whether it is unique
         Gnome::Gda::Value value_unique = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_UNIQUEINDEX, row);
-        if(value_unique.get_value_type() ==  Gnome::Gda::VALUE_TYPE_BOOLEAN)
-          field_info.set_unique_key( value_unique.get_bool() );
-        else if(field_info.get_primary_key()) //All primaries keys are unique, so force this.
-          field_info.set_unique_key();
+        if(value_unique.get_value_type() ==  G_TYPE_BOOLEAN)
+          field_info->set_unique_key( value_unique.get_boolean() );
+        else if(field_info->get_primary_key()) //All primaries keys are unique, so force this.
+          field_info->set_unique_key();
 
         //Get whether it is autoincrements
         /* libgda does not provide this yet.
         Gnome::Gda::Value value_autoincrement = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_AUTOINCREMENT, row);
-        if(value_autoincrement.get_value_type() ==  Gnome::Gda::VALUE_TYPE_BOOLEAN)
-          field_info.set_auto_increment( value_autoincrement.get_bool() );
+        if(value_autoincrement.get_value_type() ==  G_TYPE_BOOLEAN)
+          field_info->set_auto_increment( value_autoincrement.get_bool() );
         */
 
         sharedptr<Field> field(new Field()); //TODO: Get glom-specific information from the document?
@@ -521,19 +535,19 @@ Base_DB::type_vecFields Base_DB::get_fie
 
       if(iterFindDatabase != fieldsDatabase.end() ) //Ignore fields that don't exist in the database anymore.
       {
-        Gnome::Gda::FieldAttributes field_info_document = field->get_field_info();
+        Glib::RefPtr<Gnome::Gda::Column> field_info_document = field->get_field_info();
 
         //Update the Field information that _might_ have changed in the database.
-        Gnome::Gda::FieldAttributes field_info = (*iterFindDatabase)->get_field_info();
+        Glib::RefPtr<Gnome::Gda::Column> field_info = (*iterFindDatabase)->get_field_info();
 
         //libgda does not tell us whether the field is auto_incremented, so we need to get that from the document.
-        field_info.set_auto_increment( field_info_document.get_auto_increment() );
+        field_info->set_auto_increment( field_info_document->get_auto_increment() );
 
         //libgda does not tell us whether the field is auto_incremented, so we need to get that from the document.
-        field_info.set_primary_key( field_info_document.get_primary_key() );
+        field_info->set_primary_key( field_info_document->get_primary_key() );
 
         //libgda does yet tell us correct default_value information so we need to get that from the document.
-        field_info.set_default_value( field_info_document.get_default_value() );
+        field_info->set_default_value( field_info_document->get_default_value() );
 
         field->set_field_info(field_info);
 
@@ -918,8 +932,8 @@ bool Base_DB::create_table_with_default_
   field_primary_key->set_primary_key();
   field_primary_key->set_auto_increment();
 
-  Gnome::Gda::FieldAttributes field_info = field_primary_key->get_field_info();
-  field_info.set_allow_null(false);
+  Glib::RefPtr<Gnome::Gda::Column> field_info = field_primary_key->get_field_info();
+  field_info->set_allow_null(false);
   field_primary_key->set_field_info(field_info);
 
   field_primary_key->set_glom_type(Field::TYPE_NUMERIC);
@@ -1005,8 +1019,8 @@ bool Base_DB::create_table(const sharedp
 
     //The field has no gda type, so we set that:
     //This usually comes from the database, but that's a bit strange.
-    Gnome::Gda::FieldAttributes info = field->get_field_info();
-    info.set_gdatype( Field::get_gda_type_for_glom_type(field->get_glom_type()) );
+    Glib::RefPtr<Gnome::Gda::Column> info = field->get_field_info();
+    info->set_g_type( Field::get_gda_type_for_glom_type(field->get_glom_type()) );
     field->set_field_info(info); //TODO_Performance
 
     Glib::ustring sql_field_description = "\"" + field->get_name() + "\" " + field->get_sql_type();
@@ -1029,7 +1043,7 @@ bool Base_DB::create_table(const sharedp
   //Actually create the table
   try
   {
-    Glib::RefPtr<Gnome::Gda::DataModel> data_model = query_execute( "CREATE TABLE \"" + table_info->get_name() + "\" (" + sql_fields + ")" );
+    Glib::RefPtr<Gnome::Gda::DataModel> data_model = query_execute( "CREATE TABLE \"" + table_info->get_name() + "\" (" + sql_fields + ");" );
     if(!data_model)
       table_creation_succeeded = false;
     else
@@ -1853,7 +1867,7 @@ Base_DB::type_map_fields Base_DB::get_re
 
           //Never give a NULL-type value to the python calculation for types that don't use them:
           //to prevent errors:
-          if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_NULL)
+          if(value.is_null())
             value = Conversions::get_empty_value(field->get_glom_type());
 
           field_values[field->get_name()] = value;
Index: glom/mode_data/box_data.cc
===================================================================
--- glom/mode_data/box_data.cc	(revision 1082)
+++ glom/mode_data/box_data.cc	(working copy)
@@ -92,7 +92,7 @@ Glib::ustring Box_Data::get_find_where_c
         bool use_this_field = true;
         if(field->get_glom_type() == Field::TYPE_BOOLEAN) //TODO: We need an intermediate state for boolean fields, so that they can be ignored in searches.
         {
-          if(!data.get_bool())
+          if(!data.get_boolean())
             use_this_field = false;
         }
 
Index: glom/mode_data/box_data_details.cc
===================================================================
--- glom/mode_data/box_data_details.cc	(revision 1082)
+++ glom/mode_data/box_data_details.cc	(working copy)
@@ -137,7 +137,7 @@ void Box_Data_Details::set_primary_key_v
 
 bool Box_Data_Details::init_db_details(const FoundSet& found_set, const Gnome::Gda::Value& primary_key_value)
 {
-  //std::cout << "Box_Data_Details::init_db_details(): primary_key_value.to_string()=" << primary_key_value.to_string() << std::endl;
+  //std::cout << "Box_Data_Details::init_db_details(): primary_key_value=" << primary_key_value.to_string() << std::endl;
 
   m_primary_key_value = primary_key_value;
 
@@ -148,7 +148,7 @@ bool Box_Data_Details::init_db_details(c
 
 bool Box_Data_Details::refresh_data_from_database_with_primary_key(const Gnome::Gda::Value& primary_key_value)
 {
-  //std::cout << "refresh_data_from_database_with_primary_key(): primary_key_value.to_string()=" << primary_key_value.to_string() << std::endl;
+  //std::cout << "refresh_data_from_database_with_primary_key(): primary_key_value=" << primary_key_value.to_string() << std::endl;
   m_primary_key_value = primary_key_value;
   return fill_from_database();
 }
@@ -185,7 +185,7 @@ void Box_Data_Details::create_layout()
 
 bool Box_Data_Details::fill_from_database()
 {
-  //std::cout << "Box_Data_Details::fill_from_database(): m_primary_key_value.to_string()=" << m_primary_key_value.to_string() << std::endl;
+  //std::cout << "Box_Data_Details::fill_from_database(): m_primary_key_value=" << m_primary_Key_value.to_string() << std::endl;
 
  //Don't try to open a connection if there is no document,
  //for instance, during application destruction.
Index: glom/mode_find/box_data_list_find.cc
===================================================================
--- glom/mode_find/box_data_list_find.cc	(revision 1082)
+++ glom/mode_find/box_data_list_find.cc	(working copy)
@@ -59,7 +59,7 @@ bool Box_Data_List_Find::fill_from_datab
 
   m_FieldsShown = get_fields_to_show();
 
-  //m_AddDel.add_item(Gnome::Gda::Value("find"));
+  //m_AddDel.add_item(Glib::ValueBase("find"));
 
   return result;
 }
Index: glom/box_db_table.h
===================================================================
--- glom/box_db_table.h	(revision 1082)
+++ glom/box_db_table.h	(working copy)
@@ -42,7 +42,7 @@ public: 
   virtual Glib::ustring get_table_name();
 
   //TODO: Put this somewhere more sensible:
-  typedef std::map<Gnome::Gda::ValueType, Glib::ustring> type_map_valuetypes;
+  typedef std::map<GType, Glib::ustring> type_map_valuetypes;
 
 protected:
 
@@ -57,7 +57,7 @@ protected:
 
 
   //static type_vecFields get_fields_for_datamodel(const Glib::RefPtr<Gnome::Gda::DataModel>& data_model); 
-  static Glib::ustring postgres_get_field_definition_for_sql(const Gnome::Gda::FieldAttributes& field_info);
+  static Glib::ustring postgres_get_field_definition_for_sql(const Glib::RefPtr<const Gnome::Gda::Column>& field_info);
 
   Glib::ustring m_table_name;
 };
Index: glom/glom_postgres.cc
===================================================================
--- glom/glom_postgres.cc	(revision 1082)
+++ glom/glom_postgres.cc	(working copy)
@@ -27,10 +27,10 @@ bool GlomPostgres::postgres_add_column(c
 {
   sharedptr<Field> field_to_add = glom_sharedptr_clone(field);
 
-  Gnome::Gda::FieldAttributes field_info = field_to_add->get_field_info();
-  if((field_info.get_gdatype() == Gnome::Gda::VALUE_TYPE_UNKNOWN) || (field_info.get_gdatype() == Gnome::Gda::VALUE_TYPE_NULL))
+  Glib::RefPtr<Gnome::Gda::Column> field_info = field_to_add->get_field_info();
+  if((field_info->get_g_type() == G_TYPE_NONE) || (field_info->get_g_type() == GDA_TYPE_NULL))
   {
-    field_info.set_gdatype( Field::get_gda_type_for_glom_type(field_to_add->get_glom_type()) );
+    field_info->set_g_type( Field::get_gda_type_for_glom_type(field_to_add->get_glom_type()) );
     field_to_add->set_field_info(field_info);
   }
 
@@ -49,8 +49,8 @@ bool GlomPostgres::postgres_add_column(c
 
 sharedptr<Field> GlomPostgres::postgres_change_column_extras(const Glib::ustring& table_name, const sharedptr<const Field>& field_old, const sharedptr<const Field>& field, bool set_anyway)
 {
-  //Gnome::Gda::FieldAttributes field_info = field->get_field_info();
-  //Gnome::Gda::FieldAttributes field_info_old = field_old->get_field_info();
+  //Glib::RefPtr<Gnome::Gda::Column> field_info = field->get_field_info();
+  //Glib::RefPtr<Gnome::Gda::Column> field_info_old = field_old->get_field_info();
 
   sharedptr<Field> result = glom_sharedptr_clone(field);
 
@@ -166,7 +166,7 @@ sharedptr<Field> GlomPostgres::postgres_
   }
 
   /* This should have been dealt with by postgres_change_column_type(), because postgres uses a different ("serial") field type for auto-incrementing fields.
-  if(field_info.get_auto_increment() != field_info_old.get_auto_increment())
+  if(field_info->get_auto_increment() != field_info_old.get_auto_increment())
   {
 
   }
Index: glom/mode_design/fields/dialog_fielddefinition.cc
===================================================================
--- glom/mode_design/fields/dialog_fielddefinition.cc	(revision 1082)
+++ glom/mode_design/fields/dialog_fielddefinition.cc	(working copy)
@@ -119,7 +119,7 @@ void Dialog_FieldDefinition::set_field(c
   m_table_name = table_name;  //Used for lookup combo boxes.
 
   //Set the Widgets from the field info:
-  //const Gnome::Gda::FieldAttributes& fieldInfo = field->get_field_info();
+  //const Glib::RefPtr<Gnome::Gda::Column>& fieldInfo = field->get_field_info();
 
   m_pEntry_Name->set_text(field->get_name());
   m_pCombo_Type->set_field_type( field->get_glom_type() );
@@ -221,20 +221,20 @@ sharedptr<Field> Dialog_FieldDefinition:
 
   //Get the field info from the widgets:
 
-  Gnome::Gda::FieldAttributes fieldInfo = field->get_field_info(); //Preserve previous information.
+  Glib::RefPtr<Gnome::Gda::Column> fieldInfo = field->get_field_info(); //Preserve previous information.
 
-  fieldInfo.set_name(m_pEntry_Name->get_text());
+  fieldInfo->set_name(m_pEntry_Name->get_text());
 
-  fieldInfo.set_gdatype( Field::get_gda_type_for_glom_type( m_pCombo_Type->get_field_type() ) );
+  fieldInfo->set_g_type( Field::get_gda_type_for_glom_type( m_pCombo_Type->get_field_type() ) );
 
-  fieldInfo.set_unique_key(m_pCheck_Unique->get_active());
-  fieldInfo.set_primary_key(m_pCheck_PrimaryKey->get_active());
-  fieldInfo.set_auto_increment(m_pCheck_AutoIncrement->get_active());
+  fieldInfo->set_unique_key(m_pCheck_Unique->get_active());
+  fieldInfo->set_primary_key(m_pCheck_PrimaryKey->get_active());
+  fieldInfo->set_auto_increment(m_pCheck_AutoIncrement->get_active());
 
-  if(!fieldInfo.get_auto_increment()) //Ignore default_values for auto_increment fields - it's just some obscure postgres code.
+  if(!fieldInfo->get_auto_increment()) //Ignore default_values for auto_increment fields - it's just some obscure postgres code.
   {
     //Simple default value:
-    fieldInfo.set_default_value( m_pDataWidget_DefaultValueSimple->get_value() );
+    fieldInfo->set_default_value( m_pDataWidget_DefaultValueSimple->get_value() );
   }
 
   //Lookup:
@@ -254,7 +254,7 @@ sharedptr<Field> Dialog_FieldDefinition:
   if(m_pRadio_Calculate)
     field->set_calculation(m_pTextView_Calculation->get_buffer()->get_text());
 
-  Gnome::Gda::FieldAttributes field_info_copy = fieldInfo;
+  Glib::RefPtr<Gnome::Gda::Column> field_info_copy = fieldInfo;
 
   field->set_field_info(fieldInfo);
 
Index: glom/mode_design/fields/box_db_table_definition.cc
===================================================================
--- glom/mode_design/fields/box_db_table_definition.cc	(revision 1082)
+++ glom/mode_design/fields/box_db_table_definition.cc	(working copy)
@@ -103,7 +103,7 @@ void Box_DB_Table_Definition::fill_field
   m_AddDel.set_value(iter, m_colTitle, title);
 
   //Type:
-  Field::glom_field_type fieldType = Field::get_glom_type_for_gda_type(field->get_field_info().get_gdatype()); //Could be TYPE_INVALID if the gda type is not one of ours.
+  Field::glom_field_type fieldType = Field::get_glom_type_for_gda_type(field->get_field_info()->get_g_type()); //Could be TYPE_INVALID if the gda type is not one of ours.
 
   const Glib::ustring strType = Field::get_type_name_ui( fieldType );
   m_AddDel.set_value(iter, m_colType, strType);
@@ -176,8 +176,8 @@ void Box_DB_Table_Definition::on_adddel_
       field->set_title( Utils::title_from_string(name) ); //Start with a title that might be useful.
       field->set_glom_type(Field::TYPE_NUMERIC);
 
-      Gnome::Gda::FieldAttributes field_info = field->get_field_info();
-      field_info.set_gdatype( Field::get_gda_type_for_glom_type(Field::TYPE_NUMERIC) );
+      Glib::RefPtr<Gnome::Gda::Column> field_info = field->get_field_info();
+      field_info->set_g_type( Field::get_gda_type_for_glom_type(Field::TYPE_NUMERIC) );
       field->set_field_info(field_info);
 
       fill_field_row(row, field);
@@ -237,7 +237,7 @@ bool Box_DB_Table_Definition::check_fiel
 
   //If we are changing a non-glom type:
   //Refuse to edit field definitions that were not created by glom:
-  if(Field::get_glom_type_for_gda_type( field_old->get_field_info().get_gdatype() )  == Field::TYPE_INVALID)
+  if(Field::get_glom_type_for_gda_type( field_old->get_field_info()->get_g_type() )  == Field::TYPE_INVALID)
   {
     Gtk::MessageDialog dialog(Bakery::App_Gtk::util_bold_message(_("Invalid database structure")), true);
     dialog.set_secondary_text(_("This database field was created or edited outside of Glom. It has a data type that is not supported by Glom. Your system administrator may be able to correct this."));
@@ -365,11 +365,11 @@ sharedptr<Field> Box_DB_Table_Definition
   sharedptr<const Field> field_temp = get_fields_for_table_one_field(m_table_name, strFieldNameBeforeEdit);
   if(field_temp)
   {
-    Gnome::Gda::FieldAttributes fieldInfo = field_temp->get_field_info();
+    Glib::RefPtr<Gnome::Gda::Column> fieldInfo = field_temp->get_field_info();
 
     //Name:
     const Glib::ustring name = m_AddDel.get_value(row, m_colName);
-    fieldInfo.set_name(name);
+    fieldInfo->set_name(name);
 
     //Title:
     const Glib::ustring title = m_AddDel.get_value(row, m_colTitle);
@@ -379,17 +379,17 @@ sharedptr<Field> Box_DB_Table_Definition
     const Glib::ustring& strType = m_AddDel.get_value(row, m_colType);
 
     const Field::glom_field_type glom_type =  Field::get_type_for_ui_name(strType);
-    Gnome::Gda::ValueType fieldType = Field::get_gda_type_for_glom_type(glom_type);
+    GType fieldType = Field::get_gda_type_for_glom_type(glom_type);
 
     //Unique:
     const bool bUnique = m_AddDel.get_value_as_bool(row, m_colUnique);
-    fieldInfo.set_unique_key(bUnique);
+    fieldInfo->set_unique_key(bUnique);
 
     //Primary Key:
     const bool bPrimaryKey = m_AddDel.get_value_as_bool(row, m_colPrimaryKey);
-    fieldInfo.set_primary_key(bPrimaryKey);
+    fieldInfo->set_primary_key(bPrimaryKey);
 
-    fieldInfo.set_gdatype(fieldType);
+    fieldInfo->set_g_type(fieldType);
 
     //Put it together:
     fieldResult->set_field_info(fieldInfo);
@@ -545,11 +545,11 @@ void Box_DB_Table_Definition::fill_field
 
 sharedptr<Field> Box_DB_Table_Definition::postgres_change_column(const sharedptr<const Field>& field_old, const sharedptr<const Field>& field)
 {
-  const Gnome::Gda::FieldAttributes field_info = field->get_field_info();
-  const Gnome::Gda::FieldAttributes field_info_old = field_old->get_field_info();
+  const Glib::RefPtr<Gnome::Gda::Column> field_info = field->get_field_info();
+  const Glib::RefPtr<Gnome::Gda::Column> field_info_old = field_old->get_field_info();
 
   //If the underlying data type has changed:
-  if( field_info.get_gdatype() != field_info_old.get_gdatype() )
+  if(field_info->get_g_type() != field_info_old->get_g_type() )
   {
     postgres_change_column_type(field_old, field); //This will also change everything else at the same time.
     return glom_sharedptr_clone(field);
@@ -576,7 +576,7 @@ void Box_DB_Table_Definition::postgres_c
     bool new_column_created = false;
 
     //If the datatype has changed:
-    if(field->get_field_info().get_gdatype() != field_old->get_field_info().get_gdatype())
+    if(field->get_field_info()->get_g_type() != field_old->get_field_info()->get_g_type())
     {
       //We have to create a new table, and move the data across:
       //See http://www.postgresql.org/docs/faqs/FAQ.html#4.4
@@ -586,10 +586,11 @@ void Box_DB_Table_Definition::postgres_c
       //    ALTER TABLE tab DROP COLUMN old_col;
       //    COMMIT;
 
-      Glib::RefPtr<Gnome::Gda::Transaction> transaction = Gnome::Gda::Transaction::create("glom_transaction_change_field_type");
-      const bool test = gda_connection->begin_transaction(transaction);
+      const Glib::ustring transaction_name = "glom_transaction_change_field_type"; 
+      const bool test = gda_connection->begin_transaction(transaction_name, Gnome::Gda::TRANSACTION_ISOLATION_UNKNOWN); // TODO: I am absolutely not sure what this transaction isolation does
       if(test)
       {
+        //Glib::RefPtr<Gnome::Gda::TransactionStatus> transaction = gda_connection->get_transaction_status();
         //TODO: Warn about a delay, and possible loss of precision, before actually doing this.
         //TODO: Try to use a unique name for the temp column:
 
@@ -692,7 +693,7 @@ void Box_DB_Table_Definition::postgres_c
             datamodel = query_execute( "ALTER TABLE \"" + m_table_name + "\" RENAME COLUMN \"" + fieldTemp->get_name() + "\" TO \"" + field->get_name() + "\"", get_app_window());
             if(datamodel)
             {
-              const bool test = gda_connection->commit_transaction(transaction);
+              const bool test = gda_connection->commit_transaction(transaction_name);
               if(!test)
               {
                 handle_error();
Index: glom/python_embed/glom_python.cc
===================================================================
--- glom/python_embed/glom_python.cc	(revision 1082)
+++ glom/python_embed/glom_python.cc	(working copy)
@@ -20,6 +20,7 @@
 
 //We need to include this before anything else, to avoid redefinitions:
 #include <glom/libglom/python_embed/py_glom_record.h>
+#include <glom/libglom/python_embed/pygdavalue_conversions.h>
 
 #define NO_IMPORT_PYGTK //To avoid a multiple definition in pygtk.
 #include <pygtk/pygtk.h> //For the PyGObject and PyGBoxed struct definitions.
@@ -146,10 +147,13 @@ Gnome::Gda::Value glom_evaluate_python_f
   if(!module_gda)
     g_warning("Could not import python gda module.");
 
+  // Gda.Value does not exist anymore in pygda-3.0
+#if 0
   PyObject* module_gda_dict = PyModule_GetDict(module_gda);
   PyObject* pyTypeGdaValue = PyDict_GetItemString(module_gda_dict, "Value"); //TODO: Unref this?
   if(!pyTypeGdaValue || !PyType_Check(pyTypeGdaValue))
     g_warning("Could not get gda.Value from gda_module.");
+#endif
 
 
   //Create the function definition:
@@ -206,35 +210,16 @@ Gnome::Gda::Value glom_evaluate_python_f
         //Deal with the various possible return types:
         bool object_is_gda_value = false;
 
-        //This is a hack - see below:
-        //if( strcmp(pyResult->ob_type->tp_name, "gda.Value") == 0 )
-        //  object_is_gda_value = true;
+        GValue value = { 0 };
+        const int test = pygda_value_from_pyobject(&value, pyResult);
 
-        //g_warning("debug: pyResult->ob_type->tp_name=%s", pyResult->ob_type->tp_name);
-        //g_warning("debug: pyTypeGdaValue->tp_name=%s", ((PyTypeObject*)pyTypeGdaValue)->tp_name);
+        if(test == 0) //-1 means error.
+	  object_is_gda_value = true;
 
-        const int test = PyType_IsSubtype(pyResult->ob_type, (PyTypeObject*)pyTypeGdaValue);
-        if(test == -1) //-1 means error.
-          HandlePythonError();
-
-        if(test == 1) // 0 means false, -1 means error.
-          object_is_gda_value = true;
-
-        if(object_is_gda_value)
+        if(object_is_gda_value && G_IS_VALUE(&value))
         {
-          //Cast it to the "derived" struct type:
-          //All boxed types are wrapped with PyGBoxed in pygtk, without their own special structs,
-          //and GValue is a boxed-type.
-          PyGBoxed* pygtkobject = (PyGBoxed*)pyResult;
-          if(pygtkobject)
-          {
-            GdaValue* cboxed = (GdaValue*)pygtkobject->boxed;
-            if(cboxed)
-              valueResult = Glib::wrap(cboxed, true /* take_copy */);
-            g_warning("PyGBoxed::boxed is null");
-          }
-          else
-            g_warning("PyGBoxed is null");
+	  valueResult = Gnome::Gda::Value(&value);
+	  g_value_unset(&value);
         }
         else
         {
Index: TODO
===================================================================
--- TODO	(revision 1082)
+++ TODO	(working copy)
@@ -1,2 +1,6 @@
+libgda 3.0:
+  * Probably, escape stuff needs to be fixed in glom/libglom/data_structure/glomconversions.cc, glom/utility_widgets/imageglom.cc and/or glom/libglom/data_structure/field(types).cc because escaping policy changed from libgda 1 to libgda 2.
 
+  * glom/mode_design/fields/box_db_table_definition.cc:590: There is a Gnome::Gda::TransactionIsolation parameter I have absolutely no clue about. We should either find out what it is supposed to do and/or provide some reasonable default in libgdamm.
 
+  * Creating databases (frame_glom.cc, create_database()) sometimes fails due to the source database "template1" already being in use. A two-second-sleep seems to have improved chance that it works, but it is a) still not really reliable and b) a damn hack
