? .cdtproject
? .project
? =
? Doxyfile
? aclocal.m4
? autom4te.cache
? config.guess
? config.h
? config.log
? config.status
? config.sub
? configure
? glom.kdevelop
? glom.kdevelop.pcs
? glom.kdevses
? glom.patch
? glom_gda_port.patch
? intltool-extract
? intltool-extract.in
? intltool-merge
? intltool-merge.in
? intltool-update
? intltool-update.in
? libtool
? ltmain.sh
? mkinstalldirs
? stamp-h1
? docs/Makefile
? docs/Makefile.in
? docs/user-guide/Makefile
? docs/user-guide/Makefile.in
? docs/user-guide/C/Makefile
? docs/user-guide/C/Makefile.in
? docs/user-guide/C/figures/Makefile
? docs/user-guide/C/figures/Makefile.in
? examples/Makefile
? examples/Makefile.in
? glom/data_structure/Makefile
? glom/data_structure/Makefile.in
? glom/data_structure/layout/Makefile
? glom/data_structure/layout/Makefile.in
? glom/data_structure/layout/report_parts/Makefile
? glom/data_structure/layout/report_parts/Makefile.in
? glom/document/Makefile
? glom/document/Makefile.in
? glom/layout_item_dialogs/Makefile
? glom/layout_item_dialogs/Makefile.in
? glom/mode_data/Makefile
? glom/mode_data/Makefile.in
? glom/mode_design/Makefile
? glom/mode_design/Makefile.in
? glom/mode_design/fields/Makefile
? glom/mode_design/fields/Makefile.in
? glom/mode_design/users/Makefile
? glom/mode_design/users/Makefile.in
? glom/mode_find/Makefile
? glom/mode_find/Makefile.in
? glom/navigation/Makefile
? glom/navigation/Makefile.in
? glom/python_embed/Makefile
? glom/python_embed/Makefile.in
? glom/python_embed/python_module/Makefile
? glom/python_embed/python_module/Makefile.in
? glom/relationships_overview/Makefile
? glom/relationships_overview/Makefile.in
? glom/utility_widgets/Makefile
? glom/utility_widgets/Makefile.in
? glom/utility_widgets/test
? glom/utility_widgets/adddel/Makefile
? glom/utility_widgets/adddel/Makefile.in
? glom/utility_widgets/adddel/eggcolumnchooser/Makefile
? glom/utility_widgets/adddel/eggcolumnchooser/Makefile.in
? glom/utility_widgets/db_adddel/Makefile
? glom/utility_widgets/db_adddel/Makefile.in
? macros/Makefile
? macros/Makefile.in
Index: configure.in
===================================================================
RCS file: /cvs/gnome/glom/configure.in,v
retrieving revision 1.88
diff -u -p -r1.88 configure.in
--- configure.in	4 Sep 2005 11:20:28 -0000	1.88
+++ configure.in	29 Oct 2005 20:46:27 -0000
@@ -32,7 +32,7 @@ AC_LANG_CPLUSPLUS
 
 # Checks for libraries
 # We need libgnome only for gnome_help_display().:
-PKG_CHECK_MODULES(GLOM, bakery-2.4 >= 2.3.14 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 )
+PKG_CHECK_MODULES(GLOM, bakery-2.4 >= 2.3.14 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-2.0 pygtk-2.0 >= 2.6.0 libgnome-2.0 >= 2.6.0 libgdamm-2.0 >= 1.5.0 )
 AC_SUBST(GLOM_CFLAGS)
 AC_SUBST(GLOM_LIBS)
 
Index: examples/example_smallbusiness.glom
===================================================================
RCS file: /cvs/gnome/glom/examples/example_smallbusiness.glom,v
retrieving revision 1.97
diff -u -p -r1.97 example_smallbusiness.glom
--- examples/example_smallbusiness.glom	2 Aug 2005 11:40:04 -0000	1.97
+++ examples/example_smallbusiness.glom	29 Oct 2005 20:46:27 -0000
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <glom_document database_title="Small Business Example">
-  <connection server="localhost" user="" database="glom_example_smallbusiness_v10"/>
+  <connection server="localhost" user="" database="glom_example_smallbusiness_v11"/>
   
   
   
Index: glom/base_db.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/base_db.cc,v
retrieving revision 1.54
diff -u -p -r1.54 base_db.cc
--- glom/base_db.cc	2 Aug 2005 11:45:05 -0000	1.54
+++ glom/base_db.cc	29 Oct 2005 20:46:28 -0000
@@ -335,7 +335,7 @@ 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;
 
         //Get the field name:
         Gnome::Gda::Value value_name = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_NAME, row);
@@ -343,10 +343,10 @@ Base_DB::type_vecFields Base_DB::get_fie
         {
           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() );
+
+          field_info->set_name( value_name.get_string() );
         }
-        
+
         //Get the field type:
         //This is a string representation of the type, so we need to discover the Gnome::Gda::ValueType for it:
         Gnome::Gda::Value value_fieldtype = data_model_fields->get_value_at(DATAMODEL_FIELDS_COL_TYPE, row);
@@ -360,7 +360,7 @@ Base_DB::type_vecFields Base_DB::get_fie
              if(pFieldTypes)
              {
                Gnome::Gda::ValueType gdatype = pFieldTypes->get_gdavalue_for_schema_type_string(schema_type_string);
-               field_info.set_gdatype(gdatype);
+               field_info->set_gdatype(gdatype);
              }
            }
         }
@@ -369,30 +369,30 @@ Base_DB::type_vecFields Base_DB::get_fie
         /* 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);
+          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());
+          field_info->set_allow_null(value_notnull.get_bool());
 
 
         //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() );
+          field_info->set_primary_key( value_primarykey.get_bool() );
 
         //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() );
+          field_info->set_unique_key( value_unique.get_bool() );
 
         //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() );
+          field_info->set_auto_increment( value_autoincrement.get_bool() );
         */
 
         Field field; //TODO: Get glom-specific information from the document?
@@ -437,19 +437,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 = iter->get_field_info();
+        Glib::RefPtr<const Gnome::Gda::Column> field_info_document = iter->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()->copy();
 
         //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() );
 
         iter->set_field_info(field_info);
 
@@ -1153,9 +1153,9 @@ bool Base_DB::create_table(const TableIn
 
     //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()) );
-    field.set_field_info(info);
+    //Glib::RefPtr<Gnome::Gda::Column> info = field.get_field_info();
+    //info->set_glom_type(field.get_glom_type()) );
+    //field.set_field_info(info);
 
     Glib::ustring sql_field_description = field.get_name() + " " + field.get_sql_type();
 
Index: glom/box_db_table.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/box_db_table.cc,v
retrieving revision 1.30
diff -u -p -r1.30 box_db_table.cc
--- glom/box_db_table.cc	20 Jul 2005 23:10:27 -0000	1.30
+++ glom/box_db_table.cc	29 Oct 2005 20:46:28 -0000
@@ -137,7 +137,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<const Gnome::Gda::Column> fieldinfo = data_model->describe_column(i);
     Field field;
     field.set_field_info(fieldinfo); //TODO: Get glom-specific information from document?
     result.push_back( field );
@@ -146,7 +146,7 @@ Box_DB_Table::type_vecFields Box_DB_Tabl
   return result;
 }
 
-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;
 
@@ -166,7 +166,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 Gnome::Gda::ValueType fieldType = field_info->get_gdatype();
         strType = pFieldTypes->get_string_name_for_gdavaluetype(fieldType);
       }
     }
@@ -218,7 +218,7 @@ 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
@@ -228,13 +228,13 @@ Glib::ustring Box_DB_Table::postgres_get
   */
 
   //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/box_db_table.h
===================================================================
RCS file: /cvs/gnome/glom/glom/box_db_table.h,v
retrieving revision 1.19
diff -u -p -r1.19 box_db_table.h
--- glom/box_db_table.h	20 Jul 2005 23:10:27 -0000	1.19
+++ glom/box_db_table.h	29 Oct 2005 20:46:28 -0000
@@ -59,7 +59,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_strTableName;
 };
Index: glom/connectionpool.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/connectionpool.cc,v
retrieving revision 1.18
diff -u -p -r1.18 connectionpool.cc
--- glom/connectionpool.cc	2 Aug 2005 11:40:04 -0000	1.18
+++ glom/connectionpool.cc	29 Oct 2005 20:46:29 -0000
@@ -23,6 +23,8 @@
 #include <bakery/bakery.h>
 #include <glibmm/i18n.h>
 
+const std::string PROVIDER_NAME = "PostgreSQL";
+
 ExceptionConnection::ExceptionConnection(failure_type failure)
 : m_failure_type(failure)
 {
@@ -141,6 +143,21 @@ sharedptr<SharedConnection> ConnectionPo
   return result;
 }
 
+bool ConnectionPool::create_database(const Glib::ustring& database_name)
+{
+  if(m_GdaClient)
+  {
+    Gda::ParameterList param_list;
+    param_list.add_parameter(("HOST", get_host());
+    param_list.add_parameter(("DATABASE", database_name);
+    param_list.add_parameter(("ADM_LOGIN", m_user);
+    param_list.add_parameter(("ADM_PASSWORD", m_password);
+    return m_GdaClient->create_database(PROVIDER_NAME, param_list);
+  }
+  else
+    return false;
+}
+
 sharedptr<SharedConnection> ConnectionPool::connect()
 {
   if(get_ready_to_connect())
@@ -218,7 +235,7 @@ sharedptr<SharedConnection> ConnectionPo
 
              std::cout << "connecting: cnc string: " << cnc_string << std::endl;
 
-             Glib::RefPtr<Gnome::Gda::Connection> gda_connection =  m_GdaClient->open_connection_from_string("PostgreSQL", cnc_string);
+             Glib::RefPtr<Gnome::Gda::Connection> gda_connection =  m_GdaClient->open_connection_from_string(PROVIDER_NAME, cnc_string);
              if(gda_connection) //If we could connect without specifying the database.
                bJustDatabaseMissing = true;
              else
Index: glom/connectionpool.h
===================================================================
RCS file: /cvs/gnome/glom/glom/connectionpool.h,v
retrieving revision 1.6
diff -u -p -r1.6 connectionpool.h
--- glom/connectionpool.h	2 Aug 2005 11:40:04 -0000	1.6
+++ glom/connectionpool.h	29 Oct 2005 20:46:29 -0000
@@ -102,6 +102,8 @@ public:
 
   static sharedptr<SharedConnection> get_and_connect();
 
+  bool create_database(const Glib::ustring& database_name);
+
 
   void set_host(const Glib::ustring& value);
   void set_user(const Glib::ustring& value);
Index: glom/frame_glom.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/frame_glom.cc,v
retrieving revision 1.61
diff -u -p -r1.61 frame_glom.cc
--- glom/frame_glom.cc	2 Aug 2005 11:40:04 -0000	1.61
+++ glom/frame_glom.cc	29 Oct 2005 20:46:29 -0000
@@ -613,7 +613,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;
@@ -645,15 +645,15 @@ 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();
-        Field field_document =  *iterFindDoc;
-        if(field_document.field_info_from_database_is_equal( field_info_db )) //ignores auto_increment because libgda does not report it from the database properly.
+        Glib::RefPtr<const Gnome::Gda::Column> field_info_db = field_database.get_field_info();
+        const Field& field_document =  *iterFindDoc;
+        if(!(field_document.field_info_from_database_is_equal( field_info_db ))) //ignores auto_increment because libgda does not report it from the database properly.
         {
           //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.
-          iterFindDoc->set_field_info( field_info_db );
+          iterFindDoc->set_field_info(field_info_db);
+          iterFindDoc->set_auto_increment( field_document.get_auto_increment() ); //libgda does not report it from the database properly.
 
           document_must_to_be_updated = true;
         }
@@ -988,7 +988,7 @@ bool Frame_Glom::create_database(const G
       Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
       if(connection)
       {
-        bool result = connection->create_database(database_name);
+        bool result = ConnectionPool::get_instance()->create_database(database_name);
         if(result)
         {
           g_warning("Frame_Glom::create_database(): Succeeded: database_name=%s", database_name.c_str());
Index: glom/data_structure/field.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/data_structure/field.cc,v
retrieving revision 1.31
diff -u -p -r1.31 field.cc
--- glom/data_structure/field.cc	28 Jul 2005 13:12:11 -0000	1.31
+++ glom/data_structure/field.cc	29 Oct 2005 20:46:29 -0000
@@ -51,7 +51,7 @@ Field::~Field()
 Field& Field::operator=(const Field& src)
 {
   m_glom_type = src.m_glom_type;
-  m_field_info = src.m_field_info;
+  m_field_info = src.m_field_info->copy();
   m_data = src.m_data;
 
   m_strTitle = src.m_strTitle;
@@ -69,7 +69,7 @@ Field& Field::operator=(const Field& src
 
 bool Field::operator==(const Field& src) const
 {
-  bool bResult = (m_field_info == src.m_field_info);
+  bool bResult = (m_field_info->equal(src.m_field_info)); //TODO: Check for null refptr.
   bResult = bResult && (m_glom_type == src.m_glom_type);
   bResult = bResult && (m_data == src.m_data);
 
@@ -98,20 +98,34 @@ Field::glom_field_type Field::get_glom_t
 
 void Field::set_glom_type(glom_field_type fieldtype)
 {
+  m_field_info->set_gdatype( get_gda_type_for_glom_type(fieldtype) );
+
   m_glom_type = fieldtype;
 }
 
-Gnome::Gda::FieldAttributes Field::get_field_info() const
+void Field::set_glom_type_from_gda_type(Gnome::Gda::ValueType fieldtype)
+{
+  m_glom_type = get_glom_type_for_gda_type(fieldtype);
+
+  m_field_info->set_gdatype(fieldtype);
+}
+
+Glib::RefPtr<Gnome::Gda::Column> Field::get_field_info()
 {
   return m_field_info;
 }
 
-void Field::set_field_info(const Gnome::Gda::FieldAttributes& fieldInfo)
+Glib::RefPtr<const Gnome::Gda::Column> Field::get_field_info() const
 {
-  m_field_info = fieldInfo;
+  return m_field_info;
+}
+
+void Field::set_field_info(const Glib::RefPtr<const Gnome::Gda::Column>& fieldInfo)
+{
+  m_field_info = fieldInfo->copy(); //TODO: Avoid this.
 
   //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_gdatype()) );
 }
 
 Gnome::Gda::Value Field::get_data() const
@@ -167,7 +181,7 @@ Glib::ustring Field::get_title_or_name()
   }
   else
   {
-    return m_field_info.get_name();
+    return m_field_info->get_name();
   }
 }
 
@@ -247,10 +261,10 @@ Glib::ustring Field::sql(const Gnome::Gd
       if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
       {
         long buffer_size = 0;
-        const gpointer buffer = value.get_binary(buffer_size);  
-        str = "'" + GlomConversions::get_escaped_binary_data((guint8*)buffer, buffer_size) + "'::bytea";
+        const guchar* data = value.get_binary(buffer_size);
+        str = "'" + GlomConversions::get_escaped_binary_data(data, buffer_size) + "'::bytea";
       }
-      
+
       break;
     }
     default:
@@ -317,57 +331,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)
 {
-  m_field_info.set_default_value(val);
+  m_field_info->set_default_value(val);
 }
 
 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
   {
@@ -382,30 +396,30 @@ 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 Gnome::Gda::ValueType fieldType = m_field_info->get_gdatype();
         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(), m_field_info->get_gdatype());
     }
     
     return strType;
   }
 }
 
-/// Ignores any part of FieldAttributes that libgda does not properly fill.
-bool Field::field_info_from_database_is_equal(const Gnome::Gda::FieldAttributes& field)
+/// Ignores any part of Column that libgda does not properly fill.
+bool Field::field_info_from_database_is_equal(const Glib::RefPtr<const Gnome::Gda::Column>& field) const
 {
-  Gnome::Gda::FieldAttributes temp = m_field_info;
+  Glib::RefPtr<Gnome::Gda::Column> temp = m_field_info->copy(); //TODO_Performance.
   
-  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.
+  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.
     
-  return temp == field; 
+  return temp->equal(field); 
 }
 
 Field::glom_field_type Field::get_glom_type_for_gda_type(Gnome::Gda::ValueType gda_type)
Index: glom/data_structure/field.h
===================================================================
RCS file: /cvs/gnome/glom/glom/data_structure/field.h,v
retrieving revision 1.22
diff -u -p -r1.22 field.h
--- glom/data_structure/field.h	28 Jul 2005 13:12:11 -0000	1.22
+++ glom/data_structure/field.h	29 Oct 2005 20:46:29 -0000
@@ -81,45 +81,47 @@ public:
 
   glom_field_type get_glom_type() const;
   void set_glom_type(glom_field_type fieldtype);
+  void set_glom_type_from_gda_type(Gnome::Gda::ValueType 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 Gnome::Gda::Column::get_name, so that we can use it in the same predicate template.
   Glib::ustring get_name() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_name, for convenience
+  /// This forwards to the Gnome::Gda::Column::set_name, for convenience
   void set_name(const Glib::ustring& value);
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::get_auto_increment.
+  /// This forwards to the 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 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 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 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 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 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 Gnome::Gda::Column::get_default_value.
   Gnome::Gda::Value get_default_value() const;
 
-  /// This forwards to the Gnome::Gda::FieldAttributes::set_default_value.
+  /// This forwards to the Gnome::Gda::Column::set_default_value.
   void set_default_value(const Gnome::Gda::Value& val);
 
 
-  //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);
 
-  /// Ignores any part of FieldAttributes that libgda does not properly fill.
-  bool field_info_from_database_is_equal(const Gnome::Gda::FieldAttributes& field);
+  Glib::RefPtr<Gnome::Gda::Column> get_field_info();
+  Glib::RefPtr<const Gnome::Gda::Column> get_field_info() const;
+  void set_field_info(const Glib::RefPtr<const Gnome::Gda::Column>& fieldInfo);
+
+  /// Ignores any part of Column that libgda does not properly fill.
+  bool field_info_from_database_is_equal(const Glib::RefPtr<const Gnome::Gda::Column>& field) const;
 
   //These are not used much:
   Gnome::Gda::Value get_data() const;
@@ -218,7 +220,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.
   Glib::ustring m_strTitle;
Index: glom/data_structure/fieldtypes.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/data_structure/fieldtypes.cc,v
retrieving revision 1.4
diff -u -p -r1.4 fieldtypes.cc
--- glom/data_structure/fieldtypes.cc	12 Jul 2005 08:59:10 -0000	1.4
+++ glom/data_structure/fieldtypes.cc	29 Oct 2005 20:46:29 -0000
@@ -37,7 +37,7 @@ FieldTypes::FieldTypes(const Glib::RefPt
   if(gda_connection && gda_connection->is_open())
   {
     //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 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))
     {
@@ -60,14 +60,14 @@ FieldTypes::FieldTypes(const Glib::RefPt
           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)
           {
-            Gnome::Gda::ValueType gdatype = value_gdatype.get_vtype();
+            const Gnome::Gda::ValueType gdatype = value_gdatype.get_gdatype();
 
             //Save it for later:
             m_mapSchemaStringsToGdaTypes[schema_type_string] = gdatype;
-            
+
             Glib::ustring gdatypestring = Gnome::Gda::Value::type_to_string(gdatype); 
             //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.
             
             //g_warning("debug: schema type: %s = gdatype %d", schema_type_string.c_str(), gdatype);
Index: glom/data_structure/glomconversions.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/data_structure/glomconversions.cc,v
retrieving revision 1.26
diff -u -p -r1.26 glomconversions.cc
--- glom/data_structure/glomconversions.cc	15 Jul 2005 09:27:06 -0000	1.26
+++ glom/data_structure/glomconversions.cc	29 Oct 2005 20:46:30 -0000
@@ -606,153 +606,7 @@ Gnome::Gda::Value GlomConversions::get_e
   }
 }
 
-
-unsigned char *
-Glom_PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t *bytealen)
-{
-  const unsigned char *vp;
-  unsigned char *rp;
-  unsigned char *result;
-  size_t    i;
-  size_t    len;
-
-  /*
-   * empty string has 1 char ('\0')
-   */
-  len = 1;
-
-  vp = bintext;
-  for (i = binlen; i > 0; i--, vp++)
-  {
-    if (*vp < 0x20 || *vp > 0x7e)
-      len += 5;     /* '5' is for '\\ooo' */
-    else if (*vp == '\'')
-      len += 2;
-    else if (*vp == '\\')
-      len += 4;
-    else
-      len++;
-  }
-
-  rp = result = (unsigned char *) malloc(len);
-  if (rp == NULL)
-    return NULL;
-
-  vp = bintext;
-  *bytealen = len;
-
-  for (i = binlen; i > 0; i--, vp++)
-  {
-    if (*vp < 0x20 || *vp > 0x7e)
-    {
-      (void) sprintf((char*)rp, "\\\\%03o", *vp);
-      rp += 5;
-    }
-    else if (*vp == '\'')
-    {
-      rp[0] = '\\';
-      rp[1] = '\'';
-      rp += 2;
-    }
-    else if (*vp == '\\')
-    {
-      rp[0] = '\\';
-      rp[1] = '\\';
-      rp[2] = '\\';
-      rp[3] = '\\';
-      rp += 4;
-    }
-    else
-      *rp++ = *vp;
-  }
-  *rp = '\0';
-
-  return result;
-}
-
-#define ISFIRSTOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '3')
-#define ISOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '7')
-#define OCTVAL(CH) ((CH) - '0')
-
-unsigned char *
-Glom_PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen)
-{
-  size_t    strtextlen,
-        buflen;
-  unsigned char *buffer,
-         *tmpbuf;
-  size_t    i,
-        j;
-
-  if (strtext == NULL)
-    return NULL;
-
-  strtextlen = strlen((const char*)strtext);
-
-  /*
-   * Length of input is max length of output, but add one to avoid
-   * unportable malloc(0) if input is zero-length.
-   */
-  buffer = (unsigned char *) malloc(strtextlen + 1);
-  if (buffer == NULL)
-    return NULL;
-
-  for (i = j = 0; i < strtextlen;)
-  {
-    switch (strtext[i])
-    {
-      case '\\':
-        i++;
-        if (strtext[i] == '\\')
-          buffer[j++] = strtext[i++];
-        else
-        {
-          if ((ISFIRSTOCTDIGIT(strtext[i])) &&
-            (ISOCTDIGIT(strtext[i + 1])) &&
-            (ISOCTDIGIT(strtext[i + 2])))
-          {
-            int     byte;
-
-            byte = OCTVAL(strtext[i++]);
-            byte = (byte << 3) + OCTVAL(strtext[i++]);
-            byte = (byte << 3) + OCTVAL(strtext[i++]);
-            buffer[j++] = byte;
-          }
-        }
-
-        /*
-         * Note: if we see '\' followed by something that isn't a
-         * recognized escape sequence, we loop around having done
-         * nothing except advance i.  Therefore the something will
-         * be emitted as ordinary data on the next cycle. Corner
-         * case: '\' at end of string will just be discarded.
-         */
-        break;
-
-      default:
-        buffer[j++] = strtext[i++];
-        break;
-    }
-  }
-  buflen = j;         /* buflen is the length of the dequoted
-                 * data */
-
-  /* Shrink the buffer to be no larger than necessary */
-  /* +1 avoids unportable behavior when buflen==0 */
-  tmpbuf = (unsigned char*)realloc(buffer, buflen + 1);
-
-  /* It would only be a very brain-dead realloc that could fail, but... */
-  if (!tmpbuf)
-  {
-    free(buffer);
-    return NULL;
-  }
-
-  *retbuflen = buflen;
-  return tmpbuf;
-}
-
-Glib::ustring GlomConversions::get_escaped_binary_data(guint8* buffer, size_t buffer_size)
+Glib::ustring GlomConversions::get_escaped_binary_data(const guint8* buffer, size_t buffer_size)
 {
   //g_warning("GlomConversions::get_escaped_binary_data: debug: buffer ");
   //for(int i = 0; i < 10; ++i)
@@ -777,10 +631,10 @@ Glib::ustring GlomConversions::get_escap
   
   if(buffer && buffer_size)
   {
-    guint8* buffer_end = buffer + buffer_size;
+    const guint8* buffer_end = buffer + buffer_size;
     char byte_as_octal[4]; //3 digits, and a null terminator
     
-    for(guint8* pos = buffer; pos < buffer_end; ++pos)
+    for(const guint8* pos = buffer; pos < buffer_end; ++pos)
     {
       sprintf(byte_as_octal, "%03o", *pos); //Format as octal with 3 digits.
       byte_as_octal[3] = 0;
@@ -794,6 +648,7 @@ Glib::ustring GlomConversions::get_escap
   return result;
 }
 
+/*
 Gnome::Gda::Value GlomConversions::parse_escaped_binary_data(const Glib::ustring& escaped_data)
 {
   //Hopefully we don't need to use this because Gda does it for us when we read a part of a "SELECT" result into a Gnome::Value.
@@ -802,15 +657,19 @@ Gnome::Gda::Value GlomConversions::parse
   Gnome::Gda::Value result;
   size_t buffer_binary_length = 0;
   guchar* buffer_binary =  Glom_PQunescapeBytea((guchar*)escaped_data.c_str(), &buffer_binary_length);
+  const guchar* buffer_binary =  Glom_PQunescapeBytea((guchar*)escaped_data.c_str(), &buffer_binary_length);
   if(buffer_binary)
   {
-    result.set(buffer_binary, buffer_binary_length);
+    GdaBinary gdaBinary;
+    gdaBinary.data = buffer_binary;
+    gdaBinary.binary_length = buffer_binary_length;
+    result.set(gdaBinary);
     free(buffer_binary);
   }
   
   return result;
 }
-
+*/
 
 
 
Index: glom/data_structure/glomconversions.h
===================================================================
RCS file: /cvs/gnome/glom/glom/data_structure/glomconversions.h,v
retrieving revision 1.15
diff -u -p -r1.15 glomconversions.h
--- glom/data_structure/glomconversions.h	14 Jul 2005 11:08:34 -0000	1.15
+++ glom/data_structure/glomconversions.h	29 Oct 2005 20:46:30 -0000
@@ -54,15 +54,10 @@ namespace GlomConversions
   Gnome::Gda::Value get_empty_value(Field::glom_field_type field_type);
 
   Gnome::Gda::Value get_example_value(Field::glom_field_type field_type);
-  
-  Glib::ustring get_escaped_binary_data(guint8* buffer, size_t buffer_size);
-  Gnome::Gda::Value parse_escaped_binary_data(const Glib::ustring& escaped_data);
-}
 
-//Copied from Postgres's PQunescapeBytea() so I don't have the trouble of finding and linking to the 
-//postgres libraries directly, without the benefit of a pkg-config .pc file. murrayc.
-unsigned char *
-Glom_PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen);
+  Glib::ustring get_escaped_binary_data(const guint8* buffer, size_t buffer_size);
+  //Gnome::Gda::Value parse_escaped_binary_data(const Glib::ustring& escaped_data);
+}
 
 #endif //GLOM_DATASTRUCTURE_GLOMCONVERSIONS_H
 
Index: glom/mode_design/fields/box_db_table_definition.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/mode_design/fields/box_db_table_definition.cc,v
retrieving revision 1.30
diff -u -p -r1.30 box_db_table_definition.cc
--- glom/mode_design/fields/box_db_table_definition.cc	2 Aug 2005 11:40:05 -0000	1.30
+++ glom/mode_design/fields/box_db_table_definition.cc	29 Oct 2005 20:46:30 -0000
@@ -96,7 +96,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_gdatype()); //Could be TYPE_INVALID if the gda type is not one of ours.
 
   Glib::ustring strType = Field::get_type_name_ui( fieldType );
   m_AddDel.set_value(iter, m_colType, strType);
@@ -169,10 +169,6 @@ void Box_DB_Table_Definition::on_adddel_
       field.set_title( util_title_from_string(strName) ); //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) );
-      field.set_field_info(field_info);
-
       fill_field_row(row, field);
 
       //m_AddDel.select_item(row, m_colTitle, true); //Start editing the title
@@ -224,7 +220,7 @@ void Box_DB_Table_Definition::on_adddel_
       {
         //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( m_Field_BeingEdited.get_field_info().get_gdatype() )  == Field::TYPE_INVALID)
+       if(Field::get_glom_type_for_gda_type( m_Field_BeingEdited.get_field_info()->get_gdatype() )  == 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."));
@@ -284,11 +280,11 @@ Field Box_DB_Table_Definition::get_field
   bool test = get_fields_for_table_one_field(m_strTableName, strFieldNameBeforeEdit, field_temp);
   if(test)
   {
-    Gnome::Gda::FieldAttributes fieldInfo = field_temp.get_field_info();
+    Glib::RefPtr<Gnome::Gda::Column> fieldInfo = field_temp.get_field_info();
 
     //Name:
     Glib::ustring strName = m_AddDel.get_value(row, m_colName);
-    fieldInfo.set_name(strName);
+    fieldInfo->set_name(strName);
 
     //Title:
     Glib::ustring title = m_AddDel.get_value(row, m_colTitle);
@@ -302,13 +298,13 @@ Field Box_DB_Table_Definition::get_field
 
     //Unique:
     bool bUnique = m_AddDel.get_value_as_bool(row, m_colUnique);
-    fieldInfo.set_unique_key(bUnique);
+    fieldInfo->set_unique_key(bUnique);
 
     //Primary Key:
     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_gdatype(fieldType);
 
     //Put it together:
     fieldResult.set_field_info(fieldInfo);
@@ -325,7 +321,7 @@ void Box_DB_Table_Definition::on_Propert
   {
     //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(m_Field_BeingEdited.get_field_info().get_gdatype()) == Field::TYPE_INVALID )
+    if( Field::get_glom_type_for_gda_type(m_Field_BeingEdited.get_field_info()->get_gdatype()) == 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."));
@@ -419,11 +415,11 @@ void  Box_DB_Table_Definition::postgres_
 
 void  Box_DB_Table_Definition::postgres_change_column(const Field& field_old, const Field& field)
 {
-  Gnome::Gda::FieldAttributes field_info = field.get_field_info();
-  Gnome::Gda::FieldAttributes field_info_old = field_old.get_field_info();
+  Glib::RefPtr<const Gnome::Gda::Column> field_info = field.get_field_info();
+  Glib::RefPtr<const 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_gdatype() != field_info_old->get_gdatype() )
   {
     postgres_change_column_type(field_old, field); //This will also change everything else at the same time.
   }
@@ -444,7 +440,7 @@ void  Box_DB_Table_Definition::postgres_
     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_gdatype() != field_old.get_field_info()->get_gdatype())
     {
       //We have to create a new table, and move the data across:
       //See http://www.postgresql.org/docs/faqs/FAQ.html#4.4
@@ -541,8 +537,8 @@ void  Box_DB_Table_Definition::postgres_
 
 void Box_DB_Table_Definition::postgres_change_column_extras(const Field& field_old, 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();
+  //Gnome::Gda::Column field_info = field.get_field_info();
+  //Gnome::Gda::Column field_info_old = field_old.get_field_info();
 
   if(field.get_name() != field_old.get_name())
   {
@@ -609,9 +605,9 @@ void Box_DB_Table_Definition::postgres_c
  
    /*
     //If the not-nullness has changed:
-    if( set_anyway ||  (field.get_field_info().get_allow_null() != field_old.get_field_info().get_allow_null()) )
+    if( set_anyway ||  (field.get_field_info()->get_allow_null() != field_old.get_field_info()->get_allow_null()) )
     {
-      Glib::ustring nullness = (field.get_field_info().get_allow_null() ? "NULL" : "NOT NULL");
+      Glib::ustring nullness = (field.get_field_info()->get_allow_null() ? "NULL" : "NOT NULL");
       Query_execute(  "ALTER TABLE " + m_strTableName + " ALTER COLUMN " + field.get_name() + "  SET " + nullness);
     }
   */ 
Index: glom/mode_design/fields/dialog_fielddefinition.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/mode_design/fields/dialog_fielddefinition.cc,v
retrieving revision 1.19
diff -u -p -r1.19 dialog_fielddefinition.cc
--- glom/mode_design/fields/dialog_fielddefinition.cc	25 May 2005 14:13:52 -0000	1.19
+++ glom/mode_design/fields/dialog_fielddefinition.cc	29 Oct 2005 20:46:30 -0000
@@ -111,7 +111,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 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() );
@@ -206,21 +206,19 @@ Field Dialog_FieldDefinition::get_field(
   Field field = m_Field; //Start with the old details, to preserve anything that is not in our UI.
 
   //Get the field info from the widgets:
+  field.set_glom_type( m_pCombo_Type->get_field_type() );
 
-  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_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_gdatype( 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());
-
-  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:
@@ -240,9 +238,7 @@ Field Dialog_FieldDefinition::get_field(
   if(m_pCheck_Calculate)
     field.set_calculation(m_pTextView_Calculation->get_buffer()->get_text());
 
-  Gnome::Gda::FieldAttributes field_info_copy = fieldInfo;
-
-  field.set_field_info(fieldInfo);
+  //Glib::RefPtr<const Gnome::Gda::Column> field_info_copy = fieldInfo;
 
   //Glom-specific details:
 
Index: glom/navigation/box_tables.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/navigation/box_tables.cc,v
retrieving revision 1.36
diff -u -p -r1.36 box_tables.cc
--- glom/navigation/box_tables.cc	17 Jul 2005 12:19:44 -0000	1.36
+++ glom/navigation/box_tables.cc	29 Oct 2005 20:46:31 -0000
@@ -193,9 +193,8 @@ void Box_Tables::on_adddel_Add(const Gtk
     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);
-    field_primary_key.set_field_info(field_info);
+    Glib::RefPtr<Gnome::Gda::Column> field_info = field_primary_key.get_field_info();
+    field_info->set_allow_null(false);
 
     field_primary_key.set_glom_type(Field::TYPE_NUMERIC);
 
Index: glom/python_embed/python_module/pygdavalue_conversions.c
===================================================================
RCS file: /cvs/gnome/glom/glom/python_embed/python_module/pygdavalue_conversions.c,v
retrieving revision 1.3
diff -u -p -r1.3 pygdavalue_conversions.c
--- glom/python_embed/python_module/pygdavalue_conversions.c	17 Apr 2005 19:47:55 -0000	1.3
+++ glom/python_embed/python_module/pygdavalue_conversions.c	29 Oct 2005 20:46:31 -0000
@@ -1,5 +1,11 @@
+#include <Python.h>
+
+#if PY_VERSION_HEX >= 0x02040000
+# include <datetime.h> /* From Python */
+#endif
+
 #include "pygdavalue_conversions.h"
-#include <datetime.h> /* From Python */
+#include <libgda/gda-value.h>
 
 /**
  * pygda_value_from_pyobject:
@@ -30,6 +36,8 @@ pygda_value_from_pyobject(GdaValue *boxe
       gda_value_set_double (boxed, PyFloat_AsDouble (input));
     } else if (PyBool_Check (input)) {
       gda_value_set_boolean (boxed, (input == Py_True));
+
+#if PY_VERSION_HEX >= 0x02040000 //These functions were introduced in python 2.4.
     } else if (PyDateTime_Check (input)) {
          GdaTimestamp gda;
          gda.year = PyDateTime_GET_YEAR(input);
@@ -53,6 +61,8 @@ pygda_value_from_pyobject(GdaValue *boxe
          gda.second = PyDateTime_TIME_GET_SECOND(input);
          gda.timezone = 0;
          gda_value_set_time (boxed, &gda);
+#endif //PY_VERSION_HEX
+
     } else {
       g_warning("Unhandled python type.");
       return -1; //failed.
@@ -79,7 +89,9 @@ pygda_value_as_pyobject(const GdaValue *
 
     value_type = gda_value_get_type ((GdaValue*)boxed);
 
+#if PY_VERSION_HEX >= 0x02040000
     PyDateTime_IMPORT; /* So we can use PyDate*() functions. */
+#endif
 
     if (value_type == GDA_VALUE_TYPE_NULL) {
       Py_INCREF (Py_None);
@@ -89,18 +101,19 @@ pygda_value_as_pyobject(const GdaValue *
     } 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.
+        const GdaBinary* gdaBinary = gda_value_get_binary ((GdaValue*)boxed);
+        ret = PyString_FromString ((const gchar*)(gdaBinary->data)); //TODO: Use the size.
     } else if (value_type == GDA_VALUE_TYPE_BLOB) {
         /* const GdaBlob* val = gda_value_get_blob ((GdaValue*)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));
+#if PY_VERSION_HEX >= 0x02040000
     } else if (value_type == GDA_VALUE_TYPE_DATE) {
         const GdaDate* val = gda_value_get_date ((GdaValue*)boxed);
         if(val)
           ret = PyDate_FromDate(val->year, val->month, val->day);
+#endif
     } 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) {
@@ -115,7 +128,7 @@ pygda_value_as_pyobject(const GdaValue *
         const GdaNumeric* val = gda_value_get_numeric ((GdaValue*)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));
+        ret = PyFloat_FromDouble (g_ascii_strtod (number_as_text, NULL));
     } 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) {
@@ -124,11 +137,13 @@ pygda_value_as_pyobject(const GdaValue *
         const gchar* val = gda_value_get_string ((GdaValue*)boxed);
         ret = PyString_FromString (val);
     } else if (value_type == GDA_VALUE_TYPE_TIME) {
+#if PY_VERSION_HEX >= 0x02040000
         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);
         ret = PyDateTime_FromDateAndTime(val->year, val->month, val->day, val->hour, val->minute, val->second, 0); /* TODO: Should we ignore GdaTimestamp::timezone ? */
+#endif
     } 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) {
Index: glom/utility_widgets/imageglom.cc
===================================================================
RCS file: /cvs/gnome/glom/glom/utility_widgets/imageglom.cc,v
retrieving revision 1.13
diff -u -p -r1.13 imageglom.cc
--- glom/utility_widgets/imageglom.cc	29 Jul 2005 18:51:59 -0000	1.13
+++ glom/utility_widgets/imageglom.cc	29 Oct 2005 20:46:31 -0000
@@ -120,18 +120,19 @@ bool ImageGlom::get_has_original_data() 
 void ImageGlom::set_value(const Gnome::Gda::Value& value)
 { 
   bool pixbuf_set = false;
-  
+
   if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
   {
-    glong size = 0;
-    const gpointer pData = value.get_binary(size);
+    long size = 0;
+    const guchar* pData = value.get_binary(size);
     if(size && pData)
     {
       //libgda does not currently properly unescape binary data,
       //so pData is actually a null terminated string, of escaped binary data.
       //This workaround should be removed when libgda is fixed:
       size_t buffer_binary_length = 0;
-      guchar* buffer_binary =  Glom_PQunescapeBytea((const guchar*)pData /* must be null-terminated */, &buffer_binary_length); //freed by us later.
+      //guchar* buffer_binary =  Glom_PQunescapeBytea((const guchar*)pData /* must be null-terminated */, &buffer_binary_length); //freed by us later.
+      const guchar* buffer_binary = pData;
       if(buffer_binary)
       {
         //typedef std::list<Gdk::PixbufFormat> type_list_formats;
@@ -163,41 +164,41 @@ void ImageGlom::set_value(const Gnome::G
           g_warning("PixbufLoader::create failed: %s",ex.what().c_str());
         }
         */
-        
+
         if(refPixbufLoader)
         {
           try
           {
             guint8* puiData = (guint8*)buffer_binary;
-            
+
             //g_warning("ImageGlom::set_value(): debug: from db: ");
             //for(int i = 0; i < 10; ++i)
             //  g_warning("%02X (%c), ", (guint8)puiData[i], (char)puiData[i]);
-              
+
             refPixbufLoader->write(puiData, (glong)buffer_binary_length);
             m_pixbuf_original = refPixbufLoader->get_pixbuf();
             m_image.set(m_pixbuf_original);
             pixbuf_set = true;
-            
+
             scale();
-            
+
             refPixbufLoader->close(); //This throws if write() threw, so it must be inside the try block.
           }
           catch(const Glib::Exception& ex)
           {
             g_warning("ImageGlom::set_value(): PixbufLoader::write() failed: %s", ex.what().c_str());
           }
-          
-          free(buffer_binary);
+
+          //free(buffer_binary);
         }
       }
-            
+
       //TODO: load the image, using the mime type stored elsewhere.
       //pixbuf = Gdk::Pixbuf::create_from_data(
     }
-    
+
   }
-  
+
   if(!pixbuf_set)
   {
     m_image.set(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_DIALOG);
@@ -220,24 +221,24 @@ Gnome::Gda::Value ImageGlom::get_value()
       std::list<Glib::ustring> list_values;
       //list_keys.push_back("quality"); //For jpeg only.
       //list_values.push_back("95");
-      
+
       m_pixbuf_original->save_to_buffer(buffer, buffer_size, GLOM_IMAGE_FORMAT, list_keys, list_values); //Always store images as the standard format in the database.
-      
+
       //g_warning("ImageGlom::get_value(): debug: to db: ");
       //for(int i = 0; i < 10; ++i)
       //  g_warning("%02X (%c), ", (guint8)buffer[i], buffer[i]);
-          
-      result.set(buffer, buffer_size);
-      
+
+      result.set((const guchar*)buffer, buffer_size);
+
       g_free(buffer);
       buffer = 0;
     }
     catch(const Glib::Exception& /* ex */)
     {
-    
+
     }
   }
-  
+
   return result;
 }
 
Index: po/Makefile.in.in
===================================================================
RCS file: /cvs/gnome/glom/po/Makefile.in.in,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.in.in
--- po/Makefile.in.in	17 Aug 2005 10:15:04 -0000	1.13
+++ po/Makefile.in.in	29 Oct 2005 20:46:31 -0000
@@ -45,7 +45,6 @@ INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
 CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -73,7 +72,6 @@ POTFILES = \
 
 CATALOGS = @CATALOGS@
 CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
 
 .SUFFIXES:
 .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
@@ -94,7 +92,7 @@ INSTOBJEXT = @INSTOBJEXT@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all-@USE_NLS@
@@ -130,22 +128,22 @@ install-data-yes: all
 	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
 	  fi; \
 	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
+	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE).mo; \
 	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
 	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
 	    if test -r $(srcdir)/$$cat.m ; then \
 	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
 	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
@@ -171,10 +169,10 @@ uninstall:
 	for cat in $$catalogs; do \
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
 	if test "$(PACKAGE)" = "glib"; then \
 	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
