/**
 - $Id: INSTALL,v 1.6 2003/10/10 15:52:03 myui Exp $
 */


Before setup you have to install postgresql headers.

   $cd PG_SRC_DIR
   $make install-all-headers


1. Make xpsql binary and deploy it.

	1.1 configure Makefile for your environment
		$emacs Makefile 
			-I/usr/local/pgsql/include/server

	1.2 make binary
	    $make clean;make
	    $make install

2. Create database
	$su - postgres -c "createdb --echo yourdb";

3. Create function intarray

	3.1 move to intarray directory
		$cd intaray
   
	3.2 edit move.sh and confirm your postgres src path
		$emacs make.sh
    		PGSRC=/usr/local/src/postgresql-7.3.3
   		$./make.sh
   		
   	[altenative way of 3.2]
   		just put _int.c to PGSRC/contrib/intarray and make install,
   		next run _int.sql and _int_add.sql.
   		
4. initialize database, create scheme and functions.
	$cd ./sql
	$./init.sh
	
5. Set up ordering function
	$cd ../ordering
	$make clean;make
	$make up
	$./create.sh

5. build library for xpath and marshall
	$cd ../lib/stack
	$make clean;make
	
6. Set up xpath function
	$cd ../../xpath
	$make clean;make
	$make up
	$./create.sh

7. build and run bulkload

	[recommendings]
	 before bulkloading, you should restart postgres with "-F" option.
	Off "fsync" to speed up loading.

	$cd ../pgxload
	$make clean;make
	$./pgxload -u postgres -p pgpass -d xpsql ../test/xmark003.xml
	
8. create index
	$cd ../sql
	$./afterload.sh dbname


[yet experimental stage]

* adding experimental dom level 2 support
	$cd ../sql
	$su - postgres -c "psql xpsql < `pwd`/dom_l2.sql"
