Frequently Asked Questions:



Q:

If we had a mailing list, it would be a permanent record of why each problem occurs, and how to fix it. I think it would mean less work for you guys at bp.lnf.it, and we would all become more informed.

A:

A PgReplicator users Forum has been opened here

Q:

Which hardware platform and operative systems are supported by “PostgreSQL Replicator”?

A:

PostgreSQL Replicator has been developed in TCL: a multi-platform scripting language (compiled “on the fly”).
So you can use PostgreSQL replicator wherever PostgreSQL can run. For more info about PostgreSQL chick
here.

Q:

I have some trouble compiling TCL-DP, I can't resolve TclHasSockets function call

A:

> How to compile the Tcl-DP 4.0 source

> (from README file of tcl-dp distribution)

> ------------------------------------

> On SunOS 4.1, Solaris 2.5, Linux 2.0, HP/UX 9.0:

> 1) Download the Tcl source and unarchive it into a directory

> (on our server Ut we unarchived it in /usr/src)

> 2) Download the Tcl-DP 4.0 source and unarchive it into the same

> directory

> At this point, Tcl and Tcl-DP should be sibling directories.

> 3) Make Tcl. See the Tcl documentation on how to do this.

> 4) Change directory to tcl-dp/unix and type './configure'

> (we used: ./configure --with-tcl=/usr/src/tcl8.3.2/unix )


****

tcl-dp FIX:

****


If compiling Tcl-dp you can't resolve TclHasSockets function call, simply put off some line from the source code

in file

tcl-dp/generic/dpInit.c

from line 68 to line 70

getting something like this:


/* if (TclHasSockets(interp) != TCL_OK) {

return TCL_ERROR;

} */


> 5) Type 'make'

> 6) To install the Tcl-DP binaries, simply run teki.tcl

> After installing tcl-dp you can test it:


$ pgtclsh

% package require dp

4.0 -> if 4.0 comes up you have correctly installed tcl-dp.


> Also be sure that files in tcl-dp library directory

> (/usr/lib/tcl8.3/dp4.0/library)

> be readable by replicator (eventually chmod 755 them).


Q:

I am getting these errors now, when I try to start pgrd daemon


> version conflict for package "Tcl": have 8.0, need 8.3 while executing

> "load /usr/lib/tcl8.3.2/dp4.0/unix/libdp40.so"

> ("uplevel" body line 1)

> invoked from within

> "uplevel #0 load [list $dir/unix/libdp40.so]"

> (procedure "LoadLib" line 5)

> invoked from within

> "LoadLib /usr/lib/tcl8.3.2/dp4.0"

> ("package ifneeded" script)

> invoked from within


and I know that downloded the source for tcl8.3.2 and configured and

compiled. and I have env Variable TCLLIBPATH=/usr/lib/tcl8.3.2.


I think we have tcl8.0 automatically installed as part of OS (Redhat 6.2.14)

Am I missing some thing here.

Any help is greatly appreciated.

A:

It seems that libdp40.so has been compiled using tcl8.0 libraries, instead of tcl8.3.
However you can check the right version you sould use to compile tcl-dp typing:

$ pgtclsh
% puts $tcl_library
/usr/lib/tcl8.3

So, please could you check if you have correctly compiled libdp40.so
following these steps:
1) Download tcl8.3.2 source code, build and install it.
2) go to tcl-dp source code directory and “make clean”
3) type again ./configure specifying tcl source code location using the --with-tcl clause.
4) “make” again libdp40.so
5) copy it to /usr/lib/tcl8.3.2/dp4.0/unix/libdp40.so or install it with teki (teki also tells you if more version of tcl has been installed on your system. Is tcl8.3.2 the only one?)
6) test it typing

pgtclsh
% package require dp

if 4.0 comes up without errors then tcl-dp is correctly installed.

Q:

How can I update pgReplicator to 1.0.2 version?

A:

Simply download 1.0.2 tarball and untar it into the parent directory of pgreplica and update pgrd startup utility.
Assuming you have pgreplica in /var/lib/pgsql, download pgReplicator-1.0.2.tgz in that directory and:
tar xvzf pgReplicator-1.0.2.tgz
then as root
cp pgreplica/utilities/pgrd /etc/rc.d/init.d

To update replica triggers in previous replicated databases use update_triggers.tcl utility in pgreplica/utilities directory:
cd pgreplica/utilities
./update_triggers.tcl <dbname>

Q:

Can have a replicator user with its own home directory /home/replicator?

A:

Yes you can, but remember that:
1) replicator group must be postgres
2) change pemissions to 770 to /home/replicator permitting postgres user write accesses

Remember also to set proper values in pgrd.conf file, such as:
PGRBIN=/home/replicator/pgreplica/bin
PGRDATA=/home/replicator/data
PGRBOX=/tmp/pgrBOX