Greetings,

Many thanks for your module. I'm using it together with other to achive profile nodes but I've found that installation doesn't support PostgreSQL. Here is the my patched installation file which is tested and works correctly with PostgreSQL:

// $Id: nodefamily.install,v 1.1 2006/08/09 09:34:49 fago Exp $
function nodefamily_install()
{
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':     
      db_query("CREATE TABLE if not exists {nodefamily} (
        parent_nid int(10) unsigned NOT NULL,
        child_nid int(10) unsigned NOT NULL,
        PRIMARY KEY(parent_nid,child_nid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {nodefamily} (
        parent_nid integer NOT NULL CHECK(parent_nid > 0),
        child_nid integer NOT NULL CHECK(child_nid > 0),
        PRIMARY KEY(parent_nid, child_nid)
      )");
    default:
      break;
  }
}

Please, consider to apply these changes for CVS version and 4.7 branch.
I didn't test all SQL querries from this modules but if I find any problems I'll report you immediate...

Thanks a lot !

Comments

fago’s picture

Status: Active » Fixed

thanks, for your report again.

I fixed all nodeprofile's module already for postgresql, but I used the int_unsigned datatype introduced by drupal 5.0. so now I just set the types to integer for the 4.7 branches.

ardas’s picture

Okay, thanks.
As I understood int_unsigned is an alias type because there is no such type in PostgreSQL...
I used CHECK(field_name > 0) as it was recomended on several sites .....

ardas’s picture

Oh! here they are:

   db_query("CREATE DOMAIN int_unsigned integer CHECK (VALUE >= 0)");
   db_query("CREATE DOMAIN smallint_unsigned smallint CHECK (VALUE >= 0)");
   db_query("CREATE DOMAIN bigint_unsigned bigint CHECK (VALUE >= 0)");

Nice that Drupal authors did so for Drupal 5.0 :)

Anonymous’s picture

Status: Fixed » Closed (fixed)