/**
 - $Id: INSTALL,v 1.8 2004/09/25 13:09:15 myui Exp $
 */

[Preparations]

 * Before setup you have to install postgresql headers.

   # cd ${PG_SRC_DIR}
   # make install-all-headers
   
 * Check shell scripts as excutable.

   # find . -name "*.sh" -print | xargs chmod +x

1. Make xpsql binary and deploy it.

	1.1 configure Makefile for your environment
		# Edit following line,
		-I/usr/local/pgsql/include/server

	1.2 create 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 ${XPSQL_TOPDIR}/intarray/${PG_VERSION}
   
	3.2 install intarray module.
   		# ./make.sh
   		
   	[altenative way of 3.2]
   		Copy _int.c to ${PG_SRC_DIR}/contrib/intarray and 
   	  	run a command, "make install".   	  	
   	  	Next, run SQL scripts, _int.sql and _int_add.sql.
   		
4. Initialize database, create scheme and functions, triggers.
	
	# cd ${XPSQL_TOPDIR}/sql
	# ./init.sh
		
5. Set up xpath function
	# cd ${XPSQL_TOPDIR}/xpath
	# make clean;make
	# make up
	# ./create.sh

6. Build and run bulkload

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

	# cd ${XPSQL_TOPDIR}/pgxload
	# make clean;make

	# ./xloader.sh
        
        or
                
	# ./pgxload -u ${DB_USER} -p ${DB_PASSWORD} -d ${DB_NAME} ../test/xmark003.xml


[yet experimental stage]

 * adding experimental dom level 2 support
 
	# cd ${XPSQL_TOPDIR}/sql
	# su - postgres -c "psql ${DB_NAME} < `pwd`/dom_l2.sql"
