wiki:NetDRMSInPostgres9

Version 1 (modified by jennifer, 10 years ago) (diff)

--

Compiling NetDRMS v.7 against Postgres 9.2 on a slony receipient (e.g. a normal NetDRMS client) requires changing one line in the SUMS code, and ensuring config.local has the right paths (file located in the top netdrms source directory). It may also require changes to local environment variables if you have an existing Postgres 8.4.x installed on the machine.

If you already have a prior version of Postgres installed and want to compile NetDRMS against v. 9.x instead, set your $PATH and $LD_LIBRARY_PATH variables properly to reflect the Postgres 9.2 paths. You might want to do this a .profile file and source it every time you log in to avoid confusing errata later. Assign corresponding paths to Postgres-specific variables in config.local.

The change required to the SUMS code is one line in two places.

Change two files in base/sums/libs/pg named SUMLIB_RmDo.pgc and SUMLIB_RmDoX.pgc and make this modification to line 9

// EXEC SQL TYPE uint64_t IS unsigned long long;
EXEC SQL TYPE uint64_t IS unsigned long int;

There you go - that's all that is required. <hr>

Here's a little program from Igor to test this integer change, and my output:

#include <stdio.h>

int main(int argc, char**argv) {
  unsigned long int var1;
  unsigned long long var2;

  printf ("unsigned long long [%d] and unsigned long int [%d]\n",sizeof(var2), sizeof(var1));


  return 0;
}

Save program as: long_int_size.c then do gcc -o long_int_size long_int_size.c and then execute ./long_int_size

My results are as follows:

sdo3>  ./long_int_size
sdo3>  unsigned long long [8] and unsigned long int [8]