hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [7/7] incubator-hawq git commit: HAWQ-672. Add python module pygresql back into hawq workspace
Date Wed, 04 May 2016 02:25:59 GMT
HAWQ-672. Add python module pygresql back into hawq workspace


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/192cff1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/192cff1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/192cff1f

Branch: refs/heads/master
Commit: 192cff1fc4714118b27504bdf84ab04c2e715dbe
Parents: 1363d3e
Author: Paul Guo <paulguo@gmail.com>
Authored: Thu Apr 14 11:02:54 2016 +0800
Committer: rlei <rlei@pivotal.io>
Committed: Wed May 4 10:24:31 2016 +0800

----------------------------------------------------------------------
 tools/bin/.gitignore                            |    1 -
 tools/bin/Makefile                              |   26 +-
 tools/bin/ext/Makefile                          |   27 +
 tools/bin/ext/__init__.py                       |    0
 tools/bin/ext/pygresql/__init__.py              |    0
 tools/bin/generate-greenplum-path.sh            |    7 -
 tools/bin/gpcheck                               |    4 +-
 tools/bin/gpload.py                             |    2 +-
 tools/bin/gppylib/commands/base.py              |    2 +-
 tools/bin/gppylib/commands/gp.py                |    2 +-
 tools/bin/gppylib/db/dbconn.py                  |    2 +-
 tools/bin/gppylib/operations/gpMigratorUtil.py  |    2 +-
 .../bin/gppylib/operations/test_utils_helper.py |    2 +-
 .../test/regress/test_regress_pygresql.py       |    4 +-
 tools/bin/hawq_ctl                              |    2 +-
 tools/bin/hawqconfig                            |    2 +-
 tools/bin/hawqextract                           |    4 +-
 tools/bin/hawqfilespace                         |    2 +-
 tools/bin/hawqstate                             |    2 +-
 tools/bin/lib/gpcheckcat                        |    4 +-
 tools/bin/pythonSrc/.gitignore                  |    1 +
 .../pythonSrc/PyGreSQL-4.0/docs/announce.html   |   28 +
 .../pythonSrc/PyGreSQL-4.0/docs/announce.txt    |   23 +
 .../pythonSrc/PyGreSQL-4.0/docs/changelog.html  |  333 ++
 .../pythonSrc/PyGreSQL-4.0/docs/changelog.txt   |  285 ++
 .../bin/pythonSrc/PyGreSQL-4.0/docs/default.css |  279 ++
 tools/bin/pythonSrc/PyGreSQL-4.0/docs/docs.css  |  109 +
 .../bin/pythonSrc/PyGreSQL-4.0/docs/future.html |   62 +
 .../bin/pythonSrc/PyGreSQL-4.0/docs/future.txt  |   48 +
 .../bin/pythonSrc/PyGreSQL-4.0/docs/index.html  |  182 +
 .../pythonSrc/PyGreSQL-4.0/docs/install.html    |  198 +
 .../bin/pythonSrc/PyGreSQL-4.0/docs/install.txt |  188 +
 tools/bin/pythonSrc/PyGreSQL-4.0/docs/pg.html   | 2429 +++++++++++
 tools/bin/pythonSrc/PyGreSQL-4.0/docs/pg.txt    | 1382 +++++++
 tools/bin/pythonSrc/PyGreSQL-4.0/docs/pgdb.html |   51 +
 tools/bin/pythonSrc/PyGreSQL-4.0/docs/pgdb.txt  |   42 +
 .../bin/pythonSrc/PyGreSQL-4.0/docs/readme.html |  243 ++
 .../bin/pythonSrc/PyGreSQL-4.0/docs/readme.txt  |  206 +
 tools/bin/pythonSrc/PyGreSQL-4.0/pg.py          |  711 ++++
 tools/bin/pythonSrc/PyGreSQL-4.0/pgdb.py        |  582 +++
 tools/bin/pythonSrc/PyGreSQL-4.0/pgmodule.c     | 3756 ++++++++++++++++++
 tools/bin/pythonSrc/PyGreSQL-4.0/setup.py       |  152 +
 .../pythonSrc/PyGreSQL-4.0/tutorial/advanced.py |  198 +
 .../pythonSrc/PyGreSQL-4.0/tutorial/basics.py   |  296 ++
 .../bin/pythonSrc/PyGreSQL-4.0/tutorial/func.py |  205 +
 .../pythonSrc/PyGreSQL-4.0/tutorial/syscat.py   |  149 +
 46 files changed, 12198 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/.gitignore
----------------------------------------------------------------------
diff --git a/tools/bin/.gitignore b/tools/bin/.gitignore
deleted file mode 100644
index bdcc60e..0000000
--- a/tools/bin/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-ext

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/Makefile
----------------------------------------------------------------------
diff --git a/tools/bin/Makefile b/tools/bin/Makefile
index 37d119c..273b599 100644
--- a/tools/bin/Makefile
+++ b/tools/bin/Makefile
@@ -36,7 +36,7 @@ PYLIB_SRC=$(SRC)/pythonSrc
 LIB_DIR=$(SRC)/lib
 PYLIB_DIR=$(SRC)/ext
 
-all: stream 
+all: stream pygresql
 
 #
 # Python Libraries
@@ -52,6 +52,18 @@ stream:
 	cd $(STREAM_DIR) && NO_M64=TRUE $(CC) $(CFLAGS) stream.c -o stream
 	cp $(STREAM_DIR)/stream lib/stream 
 
+#
+# PyGreSQL
+#
+PYGRESQL_VERSION=4.0
+PYGRESQL_DIR=PyGreSQL-$(PYGRESQL_VERSION)
+
+pygresql:
+	@echo "--- PyGreSQL"
+	cd $(PYLIB_SRC)/$(PYGRESQL_DIR) && CC="$(CC)" CFLAGS="${CFLAGS}" LDFLAGS="-L$(top_builddir)/src/interfaces/libpq ${LDFLAGS}" python setup.py build
+	mkdir -p $(PYLIB_DIR)/pygresql
+	cp -r $(PYLIB_SRC)/$(PYGRESQL_DIR)/build/lib.*/* $(PYLIB_DIR)/pygresql
+	touch $(PYLIB_DIR)/__init__.py
 
 PYTHON_FILES=`grep -l --exclude=Makefile --exclude=gplogfilter --exclude=gpcheckos --exclude=gpgenfsmap.py --exclude=throttlingD.py "/bin/env python" *`\
 			 `grep -l "/bin/env python" $(SRC)/../sbin/*`\
@@ -98,16 +110,7 @@ docs: epydoc
 	@PYTHONPATH=$(PYTHONPATH):$(EPYDOC_PYTHONPATH) $(PYLIB_SRC)/$(EPYDOC_DIR)/build/scripts-2.6/epydoc --config=.epydoc.config
 
 clean :
-	rm -rf $(PYLIB_SRC)/$(LOCKFILE_DIR)
-	rm -rf $(PYLIB_SRC)/$(PARAMIKO_DIR)
-	rm -rf $(PYLIB_SRC)/$(PYCRYPTO_DIR)
-	rm -rf $(PYLIB_SRC)/$(PYLINT_DIR)
-	rm -rf $(PYLIB_SRC)/$(LOGILAB_COMMON_DIR)
-	rm -rf $(PYLIB_SRC)/$(LOGILAB_ASTNG_DIR)
-	rm -rf $(PYLIB_SRC)/$(PYGRESQL_DIR)/build
-	rm -rf $(PYLIB_SRC)/$(PSI_DIR)
-	rm -rf $(PYLIB_SRC)/$(PYCHECKER_DIR)
-	rm -rf $(PYLIB_SRC)/$(UNITTEST2_DIR)
+	[ "x$(PYGRESQL_DIR)" != "x" ] && rm -rf $(PYLIB_SRC)/$(PYGRESQL_DIR)/build; true
 	rm -rf $(STREAM_DIR)/stream lib/stream  
 	rm -rf *.pyc lib/*.pyc
 
@@ -119,6 +122,7 @@ install: all
 	for files in `find * -maxdepth 0 -type f | grep -x -v -E "${SKIP_INSTALL}"`; do ${INSTALL_SCRIPT} $${files} ${bindir}; done
 	${MAKE} -C gppylib $@
 	${MAKE} -C hawqpylib $@
+	${MAKE} -C ext $@
 	${INSTALL_SCRIPT} -d ${bindir}/lib
 	for files in `find lib -type f`; do ${INSTALL_SCRIPT} $${files} ${bindir}/lib; done
 	unset LIBPATH; ./generate-greenplum-path.sh $(prefix) > ${prefix}/greenplum_path.sh

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/ext/Makefile
----------------------------------------------------------------------
diff --git a/tools/bin/ext/Makefile b/tools/bin/ext/Makefile
new file mode 100644
index 0000000..ba49f09
--- /dev/null
+++ b/tools/bin/ext/Makefile
@@ -0,0 +1,27 @@
+#-------------------------------------------------------------------------
+#
+# Makefile for the managerment utilities
+#
+#-------------------------------------------------------------------------
+
+subdir = tools/bin/ext
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+SKIP_INSTALL=.gitignore|.p4ignore|.rcfile|Makefile|test/
+
+install:
+	${INSTALL_SCRIPT} -d ${libdir}/python/
+	@for file in `find * -type f | grep -v -E "${SKIP_INSTALL}"`; \
+		do \
+			echo "install $${file} into ${libdir}/python/$${file}" ; \
+			${INSTALL_SCRIPT} $${file} ${libdir}/python/$${file}; \
+		done
+	@for dirs in `find * -type d | grep -v test` ;\
+		do \
+			${INSTALL_SCRIPT} -d ${libdir}/python/$${dirs}; \
+			for file in `find $${dirs} -type f | grep -v -E "${SKIP_INSTALL}"`; do \
+				echo "install $${file} into ${libdir}/python/$${file}" ; \
+				${INSTALL_SCRIPT} $${file} ${libdir}/python/$${file}; \
+			done \
+		done

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/ext/__init__.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/__init__.py b/tools/bin/ext/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/ext/pygresql/__init__.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/pygresql/__init__.py b/tools/bin/ext/pygresql/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/generate-greenplum-path.sh
----------------------------------------------------------------------
diff --git a/tools/bin/generate-greenplum-path.sh b/tools/bin/generate-greenplum-path.sh
index 11ffe5b..7931356 100755
--- a/tools/bin/generate-greenplum-path.sh
+++ b/tools/bin/generate-greenplum-path.sh
@@ -90,16 +90,9 @@ EOF
 fi
 
 #setup PYTHONPATH
-# OSX does NOT need pygresql/ path
-if [ "${PLAT}" = "Darwin" ] ; then
 cat <<EOF
 PYTHONPATH=\$GPHOME/lib/python:\$PYTHONPATH
 EOF
-else
-cat <<EOF
-PYTHONPATH=\$GPHOME/lib/python:\$GPHOME/lib/python/pygresql:\$PYTHONPATH
-EOF
-fi
 
 # openssl configuration file path
 cat <<EOF

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gpcheck
----------------------------------------------------------------------
diff --git a/tools/bin/gpcheck b/tools/bin/gpcheck
index 6099867..1aefeb4 100755
--- a/tools/bin/gpcheck
+++ b/tools/bin/gpcheck
@@ -27,8 +27,8 @@ try:
     from gppylib.commands.base import WorkerPool, Command, REMOTE
     from gppylib.gpcheckutil import HostType, hosttype_str
     from hawqpylib.hawqlib import remote_ssh_output
-    from pgdb import DatabaseError
-    import pg
+    from pygresql.pgdb import DatabaseError
+    from pygresql import pg
     import stat
 
 except ImportError, e:    

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gpload.py
----------------------------------------------------------------------
diff --git a/tools/bin/gpload.py b/tools/bin/gpload.py
index 3d6f87f..1c268e5 100755
--- a/tools/bin/gpload.py
+++ b/tools/bin/gpload.py
@@ -49,7 +49,7 @@ except ImportError:
     sys.exit(2)
 
 try:
-    import pg
+    from pygresql import pg
 except Exception, e:
     errorMsg = "gpload was unable to import The PyGreSQL Python module (pg.py) - %s\n" % str(e)
     sys.stderr.write(str(errorMsg))

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gppylib/commands/base.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/commands/base.py b/tools/bin/gppylib/commands/base.py
index 65d7495..266b9cd 100755
--- a/tools/bin/gppylib/commands/base.py
+++ b/tools/bin/gppylib/commands/base.py
@@ -42,7 +42,7 @@ import time
 
 from gppylib import gplog
 from gppylib import gpsubprocess
-#from pg import DB
+from pygresql.pg import DB
 
 # paramiko prints deprecation warnings which are ugly to the end-user
 import warnings

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gppylib/commands/gp.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/commands/gp.py b/tools/bin/gppylib/commands/gp.py
index 66124cf..4923d18 100644
--- a/tools/bin/gppylib/commands/gp.py
+++ b/tools/bin/gppylib/commands/gp.py
@@ -27,7 +27,7 @@ from gppylib.db import catalog
 from gppylib import gparray
 from base import *
 from unix import *
-import pg
+from pygresql import pg
 from gppylib import pgconf
 from gppylib.utils import writeLinesToFile, createFromSingleHostFile
 from hawqpylib.hawqlib import HawqXMLParser

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gppylib/db/dbconn.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/db/dbconn.py b/tools/bin/gppylib/db/dbconn.py
index 0d2209a..6a474ce 100644
--- a/tools/bin/gppylib/db/dbconn.py
+++ b/tools/bin/gppylib/db/dbconn.py
@@ -24,7 +24,7 @@ import os
 import stat
 
 try: 
-    import pgdb
+    from pygresql import pgdb
     from gppylib.commands.unix import UserId
 
 except ImportError, e:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gppylib/operations/gpMigratorUtil.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/operations/gpMigratorUtil.py b/tools/bin/gppylib/operations/gpMigratorUtil.py
index 73c5637..a6c8c36 100644
--- a/tools/bin/gppylib/operations/gpMigratorUtil.py
+++ b/tools/bin/gppylib/operations/gpMigratorUtil.py
@@ -27,7 +27,7 @@ from threading import Thread
 from Queue     import Queue
 import urllib    # for passing strings across gpssh
 import shutil    # for copying
-import pg              # Database interaction
+from pygresql import pg              # Database interaction
 from gppylib.gplog import *          # Greenplum logging facility
 from gppylib.commands import base    # Greenplum layer for worker pools
 from gppylib.commands import unix    # Greenplum layer for unix interaction

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gppylib/operations/test_utils_helper.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/operations/test_utils_helper.py b/tools/bin/gppylib/operations/test_utils_helper.py
index 3cefe97..51be194 100755
--- a/tools/bin/gppylib/operations/test_utils_helper.py
+++ b/tools/bin/gppylib/operations/test_utils_helper.py
@@ -58,5 +58,5 @@ class ExceptionWithArgsUnsafe(Exception):
 
 class RaiseOperation_Unpicklable(Operation):
     def execute(self):
-        import pg
+        from pygresql import pg
         raise pg.DatabaseError()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/gppylib/test/regress/test_regress_pygresql.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/test/regress/test_regress_pygresql.py b/tools/bin/gppylib/test/regress/test_regress_pygresql.py
index 5b5a8b0..e086265 100755
--- a/tools/bin/gppylib/test/regress/test_regress_pygresql.py
+++ b/tools/bin/gppylib/test/regress/test_regress_pygresql.py
@@ -22,8 +22,8 @@ import logging
 import unittest2 as unittest
 
 
-import pg
-import pgdb
+from pygresql import pg
+from pygresql import pgdb
 
 from gppylib import gplog
 from gppylib.db.dbconn import *

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/hawq_ctl
----------------------------------------------------------------------
diff --git a/tools/bin/hawq_ctl b/tools/bin/hawq_ctl
index d592d25..76ca6b8 100755
--- a/tools/bin/hawq_ctl
+++ b/tools/bin/hawq_ctl
@@ -38,7 +38,7 @@ try:
     from hawqpylib.hawqlib import *
     from hawqpylib.HAWQ_HELP import *
     from gppylib.db import dbconn
-    from pg import DatabaseError
+    from pygresql.pg import DatabaseError
 except ImportError, e:
     sys.exit('ERROR: Cannot import modules.  Please check that you '
              'have sourced greenplum_path.sh.  Detail: ' + str(e))

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/hawqconfig
----------------------------------------------------------------------
diff --git a/tools/bin/hawqconfig b/tools/bin/hawqconfig
index 791176a..04e1e15 100755
--- a/tools/bin/hawqconfig
+++ b/tools/bin/hawqconfig
@@ -21,7 +21,7 @@ try:
     from hawqpylib.hawqlib import HawqXMLParser, parse_hosts_file, remove_property_xml, update_xml_property, local_ssh
     from gppylib.commands.unix import getLocalHostname, getUserName
     from gppylib.db import dbconn
-    from pg import DatabaseError
+    from pygresql.pg import DatabaseError
     from gppylib.gplog import setup_hawq_tool_logging, quiet_stdout_logging, enable_verbose_logging
 except ImportError, e:
     sys.exit('ERROR: Cannot import modules.  Please check that you '

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/hawqextract
----------------------------------------------------------------------
diff --git a/tools/bin/hawqextract b/tools/bin/hawqextract
index 4789539..8dc471c 100755
--- a/tools/bin/hawqextract
+++ b/tools/bin/hawqextract
@@ -93,8 +93,8 @@ try:
     from gppylib.db import dbconn
     from gppylib.gplog import get_default_logger, setup_tool_logging
     from gppylib.gpparseopts import OptParser, OptChecker
-    import pg
-    from pgdb import DatabaseError
+    from pygresql import pg
+    from pygresql.pgdb import DatabaseError
     import yaml
 except ImportError, e:
     print e

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/hawqfilespace
----------------------------------------------------------------------
diff --git a/tools/bin/hawqfilespace b/tools/bin/hawqfilespace
index ed57002..dd85aff 100755
--- a/tools/bin/hawqfilespace
+++ b/tools/bin/hawqfilespace
@@ -67,7 +67,7 @@ try:
     from gppylib.commands import unix
     from gppylib.db import dbconn
     from gppylib.db import catalog
-    import pg            # Database interaction
+    from pygresql import pg            # Database interaction
     from gppylib.gplog import *          # Greenplum logging facility
     from getpass import getpass
     from gppylib.parseutils import line_reader, parse_fspacename, parse_dfs_url, parse_fspacesys, parse_fspacereplica, parse_gpfilespace_line, \

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/hawqstate
----------------------------------------------------------------------
diff --git a/tools/bin/hawqstate b/tools/bin/hawqstate
index 5ff4105..16ec58c 100755
--- a/tools/bin/hawqstate
+++ b/tools/bin/hawqstate
@@ -21,7 +21,7 @@ import sys
 from optparse import Option, OptionParser
 from hawqpylib.hawqlib import HawqXMLParser, parse_hosts_file, check_file_exist_list
 from gppylib.db import dbconn
-from pg import DatabaseError
+from pygresql.pg import DatabaseError
 from gppylib.gplog import get_default_logger, setup_hawq_tool_logging, quiet_stdout_logging, enable_verbose_logging
 from gppylib.commands.unix import getLocalHostname, getUserName
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/lib/gpcheckcat
----------------------------------------------------------------------
diff --git a/tools/bin/lib/gpcheckcat b/tools/bin/lib/gpcheckcat
index 186f9c5..a7c2f16 100755
--- a/tools/bin/lib/gpcheckcat
+++ b/tools/bin/lib/gpcheckcat
@@ -46,8 +46,8 @@ try:
     from gppylib.gplog import *
     from gppylib.gpcatalog import *
     from gppylib.commands.unix import *
-    from pgdb import DatabaseError
-    import pg
+    from pygresql.pgdb import DatabaseError
+    from pygresql import pg
 except ImportError, e:
     sys.exit('Error: unable to import module: ' + str(e))
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/.gitignore
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/.gitignore b/tools/bin/pythonSrc/.gitignore
new file mode 100644
index 0000000..0aedb4a
--- /dev/null
+++ b/tools/bin/pythonSrc/.gitignore
@@ -0,0 +1 @@
+PyGreSQL-4.0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.html
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.html b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.html
new file mode 100644
index 0000000..2683a15
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.html
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
+<title>PyGreSQL Announcements</title>
+<link rel="stylesheet" href="docs.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="pygresql-announcements">
+<h1 class="title">PyGreSQL Announcements</h1>
+<h2 class="subtitle" id="release-of-pygresql-version-4-0">Release of PyGreSQL version 4.0</h2>
+<p>PyGreSQL v4.0 has been released.</p>
+<p>It is available at: <a class="reference" href="ftp://ftp.PyGreSQL.org/pub/distrib/PyGreSQL-4.0.tgz">ftp://ftp.PyGreSQL.org/pub/distrib/PyGreSQL-4.0.tgz</a>.</p>
+<p>If you are running NetBSD, look in the packages directory under databases.
+There is also a package in the FreeBSD ports collection.</p>
+<p>Please refer to <a class="reference" href="changelog.html">changelog.txt</a>
+for things that have changed in this version.</p>
+<p>Please refer to <a class="reference" href="readme.html">readme.txt</a>
+for general information.</p>
+<div class="line-block">
+<div class="line">D'Arcy J.M. Cain</div>
+<div class="line"><a class="reference" href="mailto:darcy&#64;PyGreSQL.org">darcy&#64;PyGreSQL.org</a></div>
+</div>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.txt
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.txt b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.txt
new file mode 100644
index 0000000..fa08458
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/announce.txt
@@ -0,0 +1,23 @@
+======================
+PyGreSQL Announcements
+======================
+
+-------------------------------
+Release of PyGreSQL version 4.0
+-------------------------------
+
+PyGreSQL v4.0 has been released.
+
+It is available at: ftp://ftp.PyGreSQL.org/pub/distrib/PyGreSQL-4.0.tgz.
+
+If you are running NetBSD, look in the packages directory under databases.
+There is also a package in the FreeBSD ports collection.
+
+Please refer to `changelog.txt <changelog.html>`_
+for things that have changed in this version.
+
+Please refer to `readme.txt <readme.html>`_
+for general information.
+
+| D'Arcy J.M. Cain
+| darcy@PyGreSQL.org

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.html
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.html b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.html
new file mode 100644
index 0000000..24c38e9
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.html
@@ -0,0 +1,333 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
+<title>PyGreSQL ChangeLog</title>
+<link rel="stylesheet" href="docs.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="pygresql-changelog">
+<h1 class="title">PyGreSQL ChangeLog</h1>
+<div class="section">
+<h1><a id="version-4-0-2009-01-01" name="version-4-0-2009-01-01">Version 4.0 (2009-01-01)</a></h1>
+<ul class="simple">
+<li>Dropped support for Python below 2.3 and PostgreSQL below 7.4.</li>
+<li>Improved performance of fetchall() for large result sets
+by speeding up the type casts (as suggested by Peter Schuller).</li>
+<li>Exposed exceptions as attributes of the connection object.</li>
+<li>Exposed connection as attribute of the cursor object.</li>
+<li>Cursors now support the iteration protocol.</li>
+<li>Added new method to get parameter settings.</li>
+<li>Added customizable row_factory as suggested by Simon Pamies.</li>
+<li>Separated between mandatory and additional type objects.</li>
+<li>Added keyword args to insert, update and delete methods.</li>
+<li>Added exception handling for direct copy.</li>
+<li>Release the GIL while making a connection
+(as suggested by Peter Schuller).</li>
+<li>If available, use decimal.Decimal for numeric types.</li>
+<li>Allow DB wrapper to be used with DB-API 2 connections
+(as suggested by Chris Hilton).</li>
+<li>Made private attributes of DB wrapper accessible.</li>
+<li>Dropped dependence on mx.DateTime module.</li>
+<li>Support for PQescapeStringConn() and PQescapeByteaConn();
+these are now also used by the internal _quote() functions.</li>
+<li>Added 'int8' to INTEGER types. New SMALLINT type.</li>
+<li>Added a way to find the number of rows affected by a query()
+with the classic pg module by returning it as a string.
+For single inserts, query() still returns the oid as an integer.
+The pgdb module already provides the &quot;rowcount&quot; cursor attribute
+for the same purpose.</li>
+<li>Improved getnotify() by calling PQconsumeInput() instead of
+submitting an empty command.</li>
+<li>Removed compatibility code for old OID munging style.</li>
+<li>The insert() and update() methods now use the &quot;returning&quot; clause
+if possible to get all changed values, and they also check in advance
+whether a subsequent select is possible, so that ongoing transactions
+won't break if there is no select privilege.</li>
+<li>Added &quot;protocol_version&quot; and &quot;server_version&quot; attributes.</li>
+<li>Revived the &quot;user&quot; attribute.</li>
+<li>The pg module now works correctly with composite primary keys;
+these are represented as frozensets.</li>
+<li>Removed the undocumented and actually unnecessary &quot;view&quot; parameter
+from the get() method.</li>
+<li>get() raises a nicer ProgrammingError instead of a KeyError
+if no primary key was found.</li>
+<li>delete() now also works based on the primary key if no oid available
+and returns whether the row existed or not.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-8-1-2006-06-05" name="version-3-8-1-2006-06-05">Version 3.8.1 (2006-06-05)</a></h1>
+<ul class="simple">
+<li>Use string methods instead of deprecated string functions.</li>
+<li>Only use SQL-standard way of escaping quotes.</li>
+<li>Added the functions escape_string() and escape/unescape_bytea()
+(as suggested by Charlie Dyson and Kavous Bojnourdi a long time ago).</li>
+<li>Reverted code in clear() method that set date to current.</li>
+<li>Added code for backwards compatibility in OID munging code.</li>
+<li>Reorder attnames tests so that &quot;interval&quot; is checked for before &quot;int.&quot;</li>
+<li>If caller supplies key dictionary, make sure that all has a namespace.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-8-2006-02-17" name="version-3-8-2006-02-17">Version 3.8 (2006-02-17)</a></h1>
+<ul class="simple">
+<li>Installed new favicon.ico from Matthew Sporleder &lt;<a class="reference" href="mailto:mspo&#64;mspo.com">mspo&#64;mspo.com</a>&gt;</li>
+<li>Replaced snprintf by PyOS_snprintf.</li>
+<li>Removed NO_SNPRINTF switch which is not needed any longer</li>
+<li>Clean up some variable names and namespace</li>
+<li>Add get_relations() method to get any type of relation</li>
+<li>Rewrite get_tables() to use get_relations()</li>
+<li>Use new method in get_attnames method to get attributes of views as well</li>
+<li>Add Binary type</li>
+<li>Number of rows is now -1 after executing no-result statements</li>
+<li>Fix some number handling</li>
+<li>Non-simple types do not raise an error any more</li>
+<li>Improvements to documentation framework</li>
+<li>Take into account that nowadays not every table must have an oid column</li>
+<li>Simplification and improvement of the inserttable() function</li>
+<li>Fix up unit tests</li>
+<li>The usual assortment of minor fixes and enhancements</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-7-2005-09-07" name="version-3-7-2005-09-07">Version 3.7 (2005-09-07)</a></h1>
+<p>Improvement of pgdb module:</p>
+<ul class="simple">
+<li>Use Python standard <cite>datetime</cite> if <cite>mxDateTime</cite> is not available</li>
+</ul>
+<p>Major improvements and clean-up in classic pg module:</p>
+<ul class="simple">
+<li>All members of the underlying connection directly available in <cite>DB</cite></li>
+<li>Fixes to quoting function</li>
+<li>Add checks for valid database connection to methods</li>
+<li>Improved namespace support, handle <cite>search_path</cite> correctly</li>
+<li>Removed old dust and unnessesary imports, added docstrings</li>
+<li>Internal sql statements as one-liners, smoothed out ugly code</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-6-2-2005-02-23" name="version-3-6-2-2005-02-23">Version 3.6.2 (2005-02-23)</a></h1>
+<ul class="simple">
+<li>Further fixes to namespace handling</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-6-1-2005-01-11" name="version-3-6-1-2005-01-11">Version 3.6.1 (2005-01-11)</a></h1>
+<ul class="simple">
+<li>Fixes to namespace handling</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-6-2004-12-17" name="version-3-6-2004-12-17">Version 3.6 (2004-12-17)</a></h1>
+<ul class="simple">
+<li>Better DB-API 2.0 compliance</li>
+<li>Exception hierarchy moved into C module and made available to both APIs</li>
+<li>Fix error in update method that caused false exceptions</li>
+<li>Moved to standard exception hierarchy in classic API</li>
+<li>Added new method to get transaction state</li>
+<li>Use proper Python constants where appropriate</li>
+<li>Use Python versions of strtol, etc. Allows Win32 build.</li>
+<li>Bug fixes and cleanups</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-5-2004-08-29" name="version-3-5-2004-08-29">Version 3.5 (2004-08-29)</a></h1>
+<p>Fixes and enhancements:</p>
+<ul class="simple">
+<li>Add interval to list of data types</li>
+<li>fix up method wrapping especially close()</li>
+<li>retry pkeys once if table missing in case it was just added</li>
+<li>wrap query method separately to handle debug better</li>
+<li>use isinstance instead of type</li>
+<li>fix free/PQfreemem issue - finally</li>
+<li>miscellaneous cleanups and formatting</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-4-2004-06-02" name="version-3-4-2004-06-02">Version 3.4 (2004-06-02)</a></h1>
+<p>Some cleanups and fixes.
+This is the first version where PyGreSQL is moved back out of the
+PostgreSQL tree. A lot of the changes mentioned below were actually
+made while in the PostgreSQL tree since their last release.</p>
+<ul class="simple">
+<li>Allow for larger integer returns</li>
+<li>Return proper strings for true and false</li>
+<li>Cleanup convenience method creation</li>
+<li>Enhance debugging method</li>
+<li>Add reopen method</li>
+<li>Allow programs to preload field names for speedup</li>
+<li>Move OID handling so that it returns long instead of int</li>
+<li>Miscellaneous cleanups and formatting</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-3-2001-12-03" name="version-3-3-2001-12-03">Version 3.3 (2001-12-03)</a></h1>
+<p>A few cleanups.  Mostly there was some confusion about the latest version
+and so I am bumping the number to keep it straight.</p>
+<ul class="simple">
+<li>Added NUMERICOID to list of returned types. This fixes a bug when
+returning aggregates in the latest version of PostgreSQL.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-2-2001-06-20" name="version-3-2-2001-06-20">Version 3.2 (2001-06-20)</a></h1>
+<p>Note that there are very few changes to PyGreSQL between 3.1 and 3.2.
+The main reason for the release is the move into the PostgreSQL
+development tree.  Even the WIN32 changes are pretty minor.</p>
+<ul class="simple">
+<li>Add Win32 support (<a class="reference" href="mailto:gerhard&#64;bigfoot.de">gerhard&#64;bigfoot.de</a>)</li>
+<li>Fix some DB-API quoting problems (<a class="reference" href="mailto:niall.smart&#64;ebeon.com">niall.smart&#64;ebeon.com</a>)</li>
+<li>Moved development into PostgreSQL development tree.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-1-2000-11-06" name="version-3-1-2000-11-06">Version 3.1 (2000-11-06)</a></h1>
+<ul class="simple">
+<li>Fix some quoting functions.  In particular handle NULLs better.</li>
+<li>Use a method to add primary key information rather than direct
+manipulation of the class structures</li>
+<li>Break decimal out in <cite>_quote</cite> (in pg.py) and treat it as float</li>
+<li>Treat timestamp like date for quoting purposes</li>
+<li>Remove a redundant SELECT from the <cite>get</cite> method speeding it,
+and <cite>insert</cite> (since it calls <cite>get</cite>) up a little.</li>
+<li>Add test for BOOL type in typecast method to <cite>pgdbTypeCache</cite> class
+(<a class="reference" href="mailto:tv&#64;beamnet.de">tv&#64;beamnet.de</a>)</li>
+<li>Fix pgdb.py to send port as integer to lower level function
+(<a class="reference" href="mailto:dildog&#64;l0pht.com">dildog&#64;l0pht.com</a>)</li>
+<li>Change pg.py to speed up some operations</li>
+<li>Allow updates on tables with no primary keys</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-3-0-2000-05-30" name="version-3-0-2000-05-30">Version 3.0 (2000-05-30)</a></h1>
+<ul class="simple">
+<li>Remove strlen() call from pglarge_write() and get size from object
+(<a class="reference" href="mailto:Richard&#64;Bouska.cz">Richard&#64;Bouska.cz</a>)</li>
+<li>Add a little more error checking to the quote function in the wrapper</li>
+<li>Add extra checking in <cite>_quote</cite> function</li>
+<li>Wrap query in pg.py for debugging</li>
+<li>Add DB-API 2.0 support to pgmodule.c (<a class="reference" href="mailto:andre&#64;via.ecp.fr">andre&#64;via.ecp.fr</a>)</li>
+<li>Add DB-API 2.0 wrapper pgdb.py (<a class="reference" href="mailto:andre&#64;via.ecp.fr">andre&#64;via.ecp.fr</a>)</li>
+<li>Correct keyword clash (temp) in tutorial</li>
+<li>Clean up layout of tutorial</li>
+<li>Return NULL values as None (<a class="reference" href="mailto:rlawrence&#64;lastfoot.com">rlawrence&#64;lastfoot.com</a>)
+(WARNING: This will cause backwards compatibility issues)</li>
+<li>Change None to NULL in insert and update</li>
+<li>Change hash-bang lines to use /usr/bin/env</li>
+<li>Clearing date should be blank (NULL) not TODAY</li>
+<li>Quote backslashes in strings in <cite>_quote</cite> (<a class="reference" href="mailto:brian&#64;CSUA.Berkeley.EDU">brian&#64;CSUA.Berkeley.EDU</a>)</li>
+<li>Expanded and clarified build instructions (<a class="reference" href="mailto:tbryan&#64;starship.python.net">tbryan&#64;starship.python.net</a>)</li>
+<li>Make code thread safe (<a class="reference" href="mailto:Jerome.Alet&#64;unice.fr">Jerome.Alet&#64;unice.fr</a>)</li>
+<li>Add README.distutils (<a class="reference" href="mailto:mwa&#64;gate.net">mwa&#64;gate.net</a> &amp; <a class="reference" href="mailto:jeremy&#64;cnri.reston.va.us">jeremy&#64;cnri.reston.va.us</a>)</li>
+<li>Many fixes and increased DB-API compliance by <a class="reference" href="mailto:chifungfan&#64;yahoo.com">chifungfan&#64;yahoo.com</a>,
+<a class="reference" href="mailto:tony&#64;printra.net">tony&#64;printra.net</a>, <a class="reference" href="mailto:jeremy&#64;alum.mit.edu">jeremy&#64;alum.mit.edu</a> and others to get the final
+version ready to release.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-2-4-1999-06-15" name="version-2-4-1999-06-15">Version 2.4 (1999-06-15)</a></h1>
+<ul class="simple">
+<li>Insert returns None if the user doesn't have select permissions
+on the table.  It can (and does) happen that one has insert but
+not select permissions on a table.</li>
+<li>Added ntuples() method to query object (<a class="reference" href="mailto:brit&#64;druid.net">brit&#64;druid.net</a>)</li>
+<li>Corrected a bug related to getresult() and the money type</li>
+<li>Corrected a bug related to negative money amounts</li>
+<li>Allow update based on primary key if munged oid not available and
+table has a primary key</li>
+<li>Add many __doc__ strings (<a class="reference" href="mailto:andre&#64;via.ecp.fr">andre&#64;via.ecp.fr</a>)</li>
+<li>Get method works with views if key specified</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-2-3-1999-04-17" name="version-2-3-1999-04-17">Version 2.3 (1999-04-17)</a></h1>
+<ul class="simple">
+<li>connect.host returns &quot;localhost&quot; when connected to Unix socket
+(<a class="reference" href="mailto:torppa&#64;tuhnu.cutery.fi">torppa&#64;tuhnu.cutery.fi</a>)</li>
+<li>Use <cite>PyArg_ParseTupleAndKeywords</cite> in connect() (<a class="reference" href="mailto:torppa&#64;tuhnu.cutery.fi">torppa&#64;tuhnu.cutery.fi</a>)</li>
+<li>fixes and cleanups (<a class="reference" href="mailto:torppa&#64;tuhnu.cutery.fi">torppa&#64;tuhnu.cutery.fi</a>)</li>
+<li>Fixed memory leak in dictresult() (<a class="reference" href="mailto:terekhov&#64;emc.com">terekhov&#64;emc.com</a>)</li>
+<li>Deprecated pgext.py - functionality now in pg.py</li>
+<li>More cleanups to the tutorial</li>
+<li>Added fileno() method - <a class="reference" href="mailto:terekhov&#64;emc.com">terekhov&#64;emc.com</a> (Mikhail Terekhov)</li>
+<li>added money type to quoting function</li>
+<li>Compiles cleanly with more warnings turned on</li>
+<li>Returns PostgreSQL error message on error</li>
+<li>Init accepts keywords (Jarkko Torppa)</li>
+<li>Convenience functions can be overridden (Jarkko Torppa)</li>
+<li>added close() method</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-2-2-1998-12-21" name="version-2-2-1998-12-21">Version 2.2 (1998-12-21)</a></h1>
+<ul class="simple">
+<li>Added user and password support thanks to Ng Pheng Siong (<a class="reference" href="mailto:ngps&#64;post1.com">ngps&#64;post1.com</a>)</li>
+<li>Insert queries return the inserted oid</li>
+<li>Add new <cite>pg</cite> wrapper (C module renamed to _pg)</li>
+<li>Wrapped database connection in a class</li>
+<li>Cleaned up some of the tutorial.  (More work needed.)</li>
+<li>Added <cite>version</cite> and <cite>__version__</cite>.
+Thanks to <a class="reference" href="mailto:thilo&#64;eevolute.com">thilo&#64;eevolute.com</a> for the suggestion.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-2-1-1998-03-07" name="version-2-1-1998-03-07">Version 2.1 (1998-03-07)</a></h1>
+<ul class="simple">
+<li>return fields as proper Python objects for field type</li>
+<li>Cleaned up pgext.py</li>
+<li>Added dictresult method</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-2-0-1997-12-23" name="version-2-0-1997-12-23">Version 2.0  (1997-12-23)</a></h1>
+<ul class="simple">
+<li>Updated code for PostgreSQL 6.2.1 and Python 1.5</li>
+<li>Reformatted code and converted to use full ANSI style prototypes</li>
+<li>Changed name to PyGreSQL (from PyGres95)</li>
+<li>Changed order of arguments to connect function</li>
+<li>Created new type <cite>pgqueryobject</cite> and moved certain methods to it</li>
+<li>Added a print function for pgqueryobject</li>
+<li>Various code changes - mostly stylistic</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-1-0b-1995-11-04" name="version-1-0b-1995-11-04">Version 1.0b (1995-11-04)</a></h1>
+<ul class="simple">
+<li>Keyword support for connect function moved from library file to C code
+and taken away from library</li>
+<li>Rewrote documentation</li>
+<li>Bug fix in connect function</li>
+<li>Enhancements in large objects interface methods</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-1-0a-1995-10-30" name="version-1-0a-1995-10-30">Version 1.0a (1995-10-30)</a></h1>
+<p>A limited release.</p>
+<ul class="simple">
+<li>Module adapted to standard Python syntax</li>
+<li>Keyword support for connect function in library file</li>
+<li>Rewrote default parameters interface (internal use of strings)</li>
+<li>Fixed minor bugs in module interface</li>
+<li>Redefinition of error messages</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-0-9b-1995-10-10" name="version-0-9b-1995-10-10">Version 0.9b (1995-10-10)</a></h1>
+<p>The first public release.</p>
+<ul class="simple">
+<li>Large objects implementation</li>
+<li>Many bug fixes, enhancements, ...</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="version-0-1a-1995-10-07" name="version-0-1a-1995-10-07">Version 0.1a (1995-10-07)</a></h1>
+<ul class="simple">
+<li>Basic libpq functions (SQL access)</li>
+</ul>
+</div>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.txt
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.txt b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.txt
new file mode 100644
index 0000000..ea0d71d
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/changelog.txt
@@ -0,0 +1,285 @@
+==================
+PyGreSQL ChangeLog
+==================
+
+Version 4.0 (2009-01-01)
+------------------------
+- Dropped support for Python below 2.3 and PostgreSQL below 7.4.
+- Improved performance of fetchall() for large result sets
+  by speeding up the type casts (as suggested by Peter Schuller).
+- Exposed exceptions as attributes of the connection object.
+- Exposed connection as attribute of the cursor object.
+- Cursors now support the iteration protocol.
+- Added new method to get parameter settings.
+- Added customizable row_factory as suggested by Simon Pamies.
+- Separated between mandatory and additional type objects.
+- Added keyword args to insert, update and delete methods.
+- Added exception handling for direct copy.
+- Release the GIL while making a connection
+  (as suggested by Peter Schuller).
+- If available, use decimal.Decimal for numeric types.
+- Allow DB wrapper to be used with DB-API 2 connections
+  (as suggested by Chris Hilton).
+- Made private attributes of DB wrapper accessible.
+- Dropped dependence on mx.DateTime module.
+- Support for PQescapeStringConn() and PQescapeByteaConn();
+  these are now also used by the internal _quote() functions.
+- Added 'int8' to INTEGER types. New SMALLINT type.
+- Added a way to find the number of rows affected by a query()
+  with the classic pg module by returning it as a string.
+  For single inserts, query() still returns the oid as an integer.
+  The pgdb module already provides the "rowcount" cursor attribute
+  for the same purpose.
+- Improved getnotify() by calling PQconsumeInput() instead of
+  submitting an empty command.
+- Removed compatibility code for old OID munging style.
+- The insert() and update() methods now use the "returning" clause
+  if possible to get all changed values, and they also check in advance
+  whether a subsequent select is possible, so that ongoing transactions
+  won't break if there is no select privilege.
+- Added "protocol_version" and "server_version" attributes.
+- Revived the "user" attribute.
+- The pg module now works correctly with composite primary keys;
+  these are represented as frozensets.
+- Removed the undocumented and actually unnecessary "view" parameter
+  from the get() method.
+- get() raises a nicer ProgrammingError instead of a KeyError
+  if no primary key was found.
+- delete() now also works based on the primary key if no oid available
+  and returns whether the row existed or not.
+
+
+Version 3.8.1 (2006-06-05)
+--------------------------
+- Use string methods instead of deprecated string functions.
+- Only use SQL-standard way of escaping quotes.
+- Added the functions escape_string() and escape/unescape_bytea()
+  (as suggested by Charlie Dyson and Kavous Bojnourdi a long time ago).
+- Reverted code in clear() method that set date to current.
+- Added code for backwards compatibility in OID munging code.
+- Reorder attnames tests so that "interval" is checked for before "int."
+- If caller supplies key dictionary, make sure that all has a namespace.
+
+Version 3.8 (2006-02-17)
+------------------------
+- Installed new favicon.ico from Matthew Sporleder <mspo@mspo.com>
+- Replaced snprintf by PyOS_snprintf.
+- Removed NO_SNPRINTF switch which is not needed any longer
+- Clean up some variable names and namespace
+- Add get_relations() method to get any type of relation
+- Rewrite get_tables() to use get_relations()
+- Use new method in get_attnames method to get attributes of views as well
+- Add Binary type
+- Number of rows is now -1 after executing no-result statements
+- Fix some number handling
+- Non-simple types do not raise an error any more
+- Improvements to documentation framework
+- Take into account that nowadays not every table must have an oid column
+- Simplification and improvement of the inserttable() function
+- Fix up unit tests
+- The usual assortment of minor fixes and enhancements
+
+Version 3.7 (2005-09-07)
+------------------------
+Improvement of pgdb module:
+
+- Use Python standard `datetime` if `mxDateTime` is not available
+
+Major improvements and clean-up in classic pg module:
+
+- All members of the underlying connection directly available in `DB`
+- Fixes to quoting function
+- Add checks for valid database connection to methods
+- Improved namespace support, handle `search_path` correctly
+- Removed old dust and unnessesary imports, added docstrings
+- Internal sql statements as one-liners, smoothed out ugly code
+
+Version 3.6.2 (2005-02-23)
+--------------------------
+- Further fixes to namespace handling
+
+Version 3.6.1 (2005-01-11)
+--------------------------
+- Fixes to namespace handling
+
+Version 3.6 (2004-12-17)
+------------------------
+- Better DB-API 2.0 compliance
+- Exception hierarchy moved into C module and made available to both APIs
+- Fix error in update method that caused false exceptions
+- Moved to standard exception hierarchy in classic API
+- Added new method to get transaction state
+- Use proper Python constants where appropriate
+- Use Python versions of strtol, etc. Allows Win32 build.
+- Bug fixes and cleanups
+
+Version 3.5 (2004-08-29)
+------------------------
+Fixes and enhancements:
+
+- Add interval to list of data types
+- fix up method wrapping especially close()
+- retry pkeys once if table missing in case it was just added
+- wrap query method separately to handle debug better
+- use isinstance instead of type
+- fix free/PQfreemem issue - finally
+- miscellaneous cleanups and formatting
+
+Version 3.4 (2004-06-02)
+------------------------
+Some cleanups and fixes.
+This is the first version where PyGreSQL is moved back out of the
+PostgreSQL tree. A lot of the changes mentioned below were actually
+made while in the PostgreSQL tree since their last release.
+
+- Allow for larger integer returns
+- Return proper strings for true and false
+- Cleanup convenience method creation
+- Enhance debugging method
+- Add reopen method
+- Allow programs to preload field names for speedup
+- Move OID handling so that it returns long instead of int
+- Miscellaneous cleanups and formatting
+
+Version 3.3 (2001-12-03)
+------------------------
+A few cleanups.  Mostly there was some confusion about the latest version
+and so I am bumping the number to keep it straight.
+
+- Added NUMERICOID to list of returned types. This fixes a bug when
+  returning aggregates in the latest version of PostgreSQL.
+
+Version 3.2 (2001-06-20)
+------------------------
+Note that there are very few changes to PyGreSQL between 3.1 and 3.2.
+The main reason for the release is the move into the PostgreSQL
+development tree.  Even the WIN32 changes are pretty minor.
+
+- Add Win32 support (gerhard@bigfoot.de)
+- Fix some DB-API quoting problems (niall.smart@ebeon.com)
+- Moved development into PostgreSQL development tree.
+
+Version 3.1 (2000-11-06)
+------------------------
+- Fix some quoting functions.  In particular handle NULLs better.
+- Use a method to add primary key information rather than direct
+  manipulation of the class structures
+- Break decimal out in `_quote` (in pg.py) and treat it as float
+- Treat timestamp like date for quoting purposes
+- Remove a redundant SELECT from the `get` method speeding it,
+  and `insert` (since it calls `get`) up a little.
+- Add test for BOOL type in typecast method to `pgdbTypeCache` class
+  (tv@beamnet.de)
+- Fix pgdb.py to send port as integer to lower level function
+  (dildog@l0pht.com)
+- Change pg.py to speed up some operations
+- Allow updates on tables with no primary keys
+
+Version 3.0 (2000-05-30)
+------------------------
+- Remove strlen() call from pglarge_write() and get size from object
+  (Richard@Bouska.cz)
+- Add a little more error checking to the quote function in the wrapper
+- Add extra checking in `_quote` function
+- Wrap query in pg.py for debugging
+- Add DB-API 2.0 support to pgmodule.c (andre@via.ecp.fr)
+- Add DB-API 2.0 wrapper pgdb.py (andre@via.ecp.fr)
+- Correct keyword clash (temp) in tutorial
+- Clean up layout of tutorial
+- Return NULL values as None (rlawrence@lastfoot.com)
+  (WARNING: This will cause backwards compatibility issues)
+- Change None to NULL in insert and update
+- Change hash-bang lines to use /usr/bin/env
+- Clearing date should be blank (NULL) not TODAY
+- Quote backslashes in strings in `_quote` (brian@CSUA.Berkeley.EDU)
+- Expanded and clarified build instructions (tbryan@starship.python.net)
+- Make code thread safe (Jerome.Alet@unice.fr)
+- Add README.distutils (mwa@gate.net & jeremy@cnri.reston.va.us)
+- Many fixes and increased DB-API compliance by chifungfan@yahoo.com,
+  tony@printra.net, jeremy@alum.mit.edu and others to get the final
+  version ready to release.
+
+Version 2.4 (1999-06-15)
+------------------------
+- Insert returns None if the user doesn't have select permissions
+  on the table.  It can (and does) happen that one has insert but
+  not select permissions on a table.
+- Added ntuples() method to query object (brit@druid.net)
+- Corrected a bug related to getresult() and the money type
+- Corrected a bug related to negative money amounts
+- Allow update based on primary key if munged oid not available and
+  table has a primary key
+- Add many __doc__ strings (andre@via.ecp.fr)
+- Get method works with views if key specified
+
+Version 2.3 (1999-04-17)
+------------------------
+- connect.host returns "localhost" when connected to Unix socket
+  (torppa@tuhnu.cutery.fi)
+- Use `PyArg_ParseTupleAndKeywords` in connect() (torppa@tuhnu.cutery.fi)
+- fixes and cleanups (torppa@tuhnu.cutery.fi)
+- Fixed memory leak in dictresult() (terekhov@emc.com)
+- Deprecated pgext.py - functionality now in pg.py
+- More cleanups to the tutorial
+- Added fileno() method - terekhov@emc.com (Mikhail Terekhov)
+- added money type to quoting function
+- Compiles cleanly with more warnings turned on
+- Returns PostgreSQL error message on error
+- Init accepts keywords (Jarkko Torppa)
+- Convenience functions can be overridden (Jarkko Torppa)
+- added close() method
+
+Version 2.2 (1998-12-21)
+------------------------
+- Added user and password support thanks to Ng Pheng Siong (ngps@post1.com)
+- Insert queries return the inserted oid
+- Add new `pg` wrapper (C module renamed to _pg)
+- Wrapped database connection in a class
+- Cleaned up some of the tutorial.  (More work needed.)
+- Added `version` and `__version__`.
+  Thanks to thilo@eevolute.com for the suggestion.
+
+Version 2.1 (1998-03-07)
+------------------------
+- return fields as proper Python objects for field type
+- Cleaned up pgext.py
+- Added dictresult method
+
+Version 2.0  (1997-12-23)
+-------------------------
+- Updated code for PostgreSQL 6.2.1 and Python 1.5
+- Reformatted code and converted to use full ANSI style prototypes
+- Changed name to PyGreSQL (from PyGres95)
+- Changed order of arguments to connect function
+- Created new type `pgqueryobject` and moved certain methods to it
+- Added a print function for pgqueryobject
+- Various code changes - mostly stylistic
+
+Version 1.0b (1995-11-04)
+-------------------------
+- Keyword support for connect function moved from library file to C code
+  and taken away from library
+- Rewrote documentation
+- Bug fix in connect function
+- Enhancements in large objects interface methods
+
+Version 1.0a (1995-10-30)
+-------------------------
+A limited release.
+
+- Module adapted to standard Python syntax
+- Keyword support for connect function in library file
+- Rewrote default parameters interface (internal use of strings)
+- Fixed minor bugs in module interface
+- Redefinition of error messages
+
+Version 0.9b (1995-10-10)
+-------------------------
+The first public release.
+
+- Large objects implementation
+- Many bug fixes, enhancements, ...
+
+Version 0.1a (1995-10-07)
+-------------------------
+- Basic libpq functions (SQL access)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/default.css
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/default.css b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/default.css
new file mode 100644
index 0000000..15d0778
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/default.css
@@ -0,0 +1,279 @@
+/*
+:Author: David Goodger
+:Contact: goodger@users.sourceforge.net
+:Date: $Date: 2006/01/22 16:15:33 $
+:Revision: $Revision: 1.2 $
+:Copyright: This stylesheet has been placed in the public domain.
+
+Default cascading style sheet for the HTML output of Docutils.
+
+See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
+customize this style sheet.
+*/
+
+/* used to remove borders from tables and images */
+.borderless, table.borderless td, table.borderless th {
+  border: 0 }
+
+table.borderless td, table.borderless th {
+  /* Override padding for "table.docutils td" with "! important".
+     The right padding separates the table cells. */
+  padding: 0 0.5em 0 0 ! important }
+
+.first {
+  /* Override more specific margin styles with "! important". */
+  margin-top: 0 ! important }
+
+.last, .with-subtitle {
+  margin-bottom: 0 ! important }
+
+.hidden {
+  display: none }
+
+a.toc-backref {
+  text-decoration: none ;
+  color: black }
+
+blockquote.epigraph {
+  margin: 2em 5em ; }
+
+dl.docutils dd {
+  margin-bottom: 0.5em }
+
+/* Uncomment (and remove this text!) to get bold-faced definition list terms
+dl.docutils dt {
+  font-weight: bold }
+*/
+
+div.abstract {
+  margin: 2em 5em }
+
+div.abstract p.topic-title {
+  font-weight: bold ;
+  text-align: center }
+
+div.admonition, div.attention, div.caution, div.danger, div.error,
+div.hint, div.important, div.note, div.tip, div.warning {
+  margin: 2em ;
+  border: medium outset ;
+  padding: 1em }
+
+div.admonition p.admonition-title, div.hint p.admonition-title,
+div.important p.admonition-title, div.note p.admonition-title,
+div.tip p.admonition-title {
+  font-weight: bold ;
+  font-family: sans-serif }
+
+div.attention p.admonition-title, div.caution p.admonition-title,
+div.danger p.admonition-title, div.error p.admonition-title,
+div.warning p.admonition-title {
+  color: red ;
+  font-weight: bold ;
+  font-family: sans-serif }
+
+/* Uncomment (and remove this text!) to get reduced vertical space in
+   compound paragraphs.
+div.compound .compound-first, div.compound .compound-middle {
+  margin-bottom: 0.5em }
+
+div.compound .compound-last, div.compound .compound-middle {
+  margin-top: 0.5em }
+*/
+
+div.dedication {
+  margin: 2em 5em ;
+  text-align: center ;
+  font-style: italic }
+
+div.dedication p.topic-title {
+  font-weight: bold ;
+  font-style: normal }
+
+div.figure {
+  margin-left: 2em ;
+  margin-right: 2em }
+
+div.footer, div.header {
+  clear: both;
+  font-size: smaller }
+
+div.line-block {
+  display: block ;
+  margin-top: 1em ;
+  margin-bottom: 1em }
+
+div.line-block div.line-block {
+  margin-top: 0 ;
+  margin-bottom: 0 ;
+  margin-left: 1.5em }
+
+div.sidebar {
+  margin-left: 1em ;
+  border: medium outset ;
+  padding: 1em ;
+  background-color: #ffffee ;
+  width: 40% ;
+  float: right ;
+  clear: right }
+
+div.sidebar p.rubric {
+  font-family: sans-serif ;
+  font-size: medium }
+
+div.system-messages {
+  margin: 5em }
+
+div.system-messages h1 {
+  color: red }
+
+div.system-message {
+  border: medium outset ;
+  padding: 1em }
+
+div.system-message p.system-message-title {
+  color: red ;
+  font-weight: bold }
+
+div.topic {
+  margin: 2em }
+
+h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
+h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
+  margin-top: 0.4em }
+
+h1.title {
+  text-align: center }
+
+h2.subtitle {
+  text-align: center }
+
+hr.docutils {
+  width: 75% }
+
+img.align-left {
+  clear: left }
+
+img.align-right {
+  clear: right }
+
+ol.simple, ul.simple {
+  margin-bottom: 1em }
+
+ol.arabic {
+  list-style: decimal }
+
+ol.loweralpha {
+  list-style: lower-alpha }
+
+ol.upperalpha {
+  list-style: upper-alpha }
+
+ol.lowerroman {
+  list-style: lower-roman }
+
+ol.upperroman {
+  list-style: upper-roman }
+
+p.attribution {
+  text-align: right ;
+  margin-left: 50% }
+
+p.caption {
+  font-style: italic }
+
+p.credits {
+  font-style: italic ;
+  font-size: smaller }
+
+p.label {
+  white-space: nowrap }
+
+p.rubric {
+  font-weight: bold ;
+  font-size: larger ;
+  color: maroon ;
+  text-align: center }
+
+p.sidebar-title {
+  font-family: sans-serif ;
+  font-weight: bold ;
+  font-size: larger }
+
+p.sidebar-subtitle {
+  font-family: sans-serif ;
+  font-weight: bold }
+
+p.topic-title {
+  font-weight: bold }
+
+pre.address {
+  margin-bottom: 0 ;
+  margin-top: 0 ;
+  font-family: serif ;
+  font-size: 100% }
+
+pre.literal-block, pre.doctest-block {
+  margin-left: 2em ;
+  margin-right: 2em ;
+  background-color: #eeeeee }
+
+span.classifier {
+  font-family: sans-serif ;
+  font-style: oblique }
+
+span.classifier-delimiter {
+  font-family: sans-serif ;
+  font-weight: bold }
+
+span.interpreted {
+  font-family: sans-serif }
+
+span.option {
+  white-space: nowrap }
+
+span.pre {
+  white-space: pre }
+
+span.problematic {
+  color: red }
+
+span.section-subtitle {
+  /* font-size relative to parent (h1..h6 element) */
+  font-size: 80% }
+
+table.citation {
+  border-left: solid 1px gray;
+  margin-left: 1px }
+
+table.docinfo {
+  margin: 2em 4em }
+
+table.docutils {
+  margin-top: 0.5em ;
+  margin-bottom: 0.5em }
+
+table.footnote {
+  border-left: solid 1px black;
+  margin-left: 1px }
+
+table.docutils td, table.docutils th,
+table.docinfo td, table.docinfo th {
+  padding-left: 0.5em ;
+  padding-right: 0.5em ;
+  vertical-align: top }
+
+table.docutils th.field-name, table.docinfo th.docinfo-name {
+  font-weight: bold ;
+  text-align: left ;
+  white-space: nowrap ;
+  padding-left: 0 }
+
+h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
+h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
+  font-size: 100% }
+
+tt.docutils {
+  background-color: #eeeeee }
+
+ul.auto-toc {
+  list-style-type: none }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/docs.css
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/docs.css b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/docs.css
new file mode 100644
index 0000000..3d99c95
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/docs.css
@@ -0,0 +1,109 @@
+/*
+Stylesheet for use with Docutils.
+
+Customized for PyGreSQL docs.
+*/
+
+@import url(default.css);
+
+body {
+	margin: 8pt;
+	padding: 8pt;
+	background-color: #f8f8ff;
+	color: #000008;
+	text-align: justify;
+	font-family: Arial, Verdana, Helvetica, sans-serif;
+	font-size: 11pt; }
+
+a {
+	text-decoration: none; }
+
+a:hover {
+	text-decoration: underline; }
+
+.title, .subtitle {
+	color: #003; }
+
+.topic-title {
+	color: #006;
+	font-size: 14pt; }
+
+h1, h2, h3, h4 {
+	color: #006; }
+
+h1 {
+	padding-top: 20pt;
+	font-size: 17pt; }
+
+div#pygresql-changelog div.section h1 {
+	font-size: 12pt;
+}
+
+h1.title {
+	font-size: 20pt;
+}
+
+h2 {
+	font-size: 14pt; }
+
+h2.subtitle {
+	font-size: 16pt;
+}
+
+h3 {
+	font-size: 13pt; }
+
+h4 {
+	font-size: 12pt; }
+
+a.toc-backref {
+	color: #006; }
+
+ul.simple li {
+	margin-top: 4pt; }
+
+ul.simple ul li {
+	margin-top: 2pt; }
+
+div.contents ul {
+	list-style-type: none; }
+
+div.contents ul li {
+	margin-top: 4pt;
+	font-size: 12pt; }
+
+div.contents ul ul li {
+	margin-top: 2pt;
+	font-size: 11pt; }
+
+cite {
+	font-style: normal;
+	font-family: monospace;
+	font-weight: bold; }
+
+table.field-list th.field-name {
+	font-style: normal;
+	font-family: monospace;
+	font-weight: bold; }
+
+tt.literal, pre.literal-block {
+	font-style: normal;
+	font-family: monospace;
+	font-weight: bold;
+	background-color: #fff; }
+
+tt.literal {
+	padding-left: 2pt;
+	padding-right: 2pt; }
+
+pre.literal-block {
+	padding: 4pt;
+	border: 1px dotted #ccc; }
+
+table.docutils {
+	border-spacing: 0px;
+	border-collapse: collapse; }
+
+table.docutils td {
+	margin: 0px;
+	padding: 2pt; }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.html
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.html b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.html
new file mode 100644
index 0000000..358de81
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.html
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
+<title>PyGreSQL future directions</title>
+<link rel="stylesheet" href="docs.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="pygresql-future-directions">
+<h1 class="title">PyGreSQL future directions</h1>
+<div class="section">
+<h1><a id="to-do" name="to-do">To Do</a></h1>
+<ul class="simple">
+<li>Documentation for the pgdb module (everything specific to PyGreSQL).</li>
+<li>The large object and direct access functions need much more attention.</li>
+<li>The C module needs to be cleaned up and redundant code merged,
+and should get its own unit test module.</li>
+<li>The fetch method should use real cursors.</li>
+<li>What shall we do with the &quot;tutorial&quot; directory
+(it's rather a tutorial for Postgres/SQL than for PyGreSQL,
+it's using only the query method from the classic pg module and
+no other PyGreSQL functionality, it's rather a demo than a tutorial)?</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="proposed-patches" name="proposed-patches">Proposed Patches</a></h1>
+<ul class="simple">
+<li>Notice handling with PQsetNoticeReceiver and PQsetNoticeProcessor
+(one possible implementation was already suggested by Dmitry Dvoinikov
+<a class="reference" href="http://mailman.vex.net/pipermail/pygresql/2005-November/001530.html">http://mailman.vex.net/pipermail/pygresql/2005-November/001530.html</a>).
+Maybe also make notifications accessible via the optional cursor and
+connection attribute &quot;messages&quot; proposed in the DB-API specs.</li>
+</ul>
+</div>
+<div class="section">
+<h1><a id="wish-list" name="wish-list">Wish List</a></h1>
+<ul class="simple">
+<li>Make SQLSTATE error codes available.</li>
+<li>Make use of PQexecParams() and PQprepare(). This could speed up
+executemany() and allow retrieving binary data directly by setting
+the resultFormat parameter to one.</li>
+<li>Support optional &quot;errorhandler&quot; extension.</li>
+<li>Support optional cursor and connection attribute &quot;messages&quot;.</li>
+<li>Connection as context manager (see <a class="reference" href="http://tinyurl.com/6j9cef">http://tinyurl.com/6j9cef</a>).</li>
+<li>Users should be able to register their own types with _pg.</li>
+<li>Let pg and pgdb support namedtuples (as available in Py 2.6).
+pg could get a new method namedresult(), and pgdb could provide
+a row factory for namedtuples (similar to sqlite3).</li>
+<li>New methods in the classic module, similar to getresult() and
+dictresult(), but returning dictionaries of rows instead of lists
+of rows (with primary key or oids as keys).</li>
+<li>Make PyGreSQL thread-safe on the connection level.</li>
+<li>The API documentation could be created with Epydoc.</li>
+<li>Write a tutorial for beginners and advanced use.</li>
+<li>More and better documented examples.</li>
+</ul>
+</div>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.txt
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.txt b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.txt
new file mode 100644
index 0000000..8dec0fb
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/future.txt
@@ -0,0 +1,48 @@
+==========================
+PyGreSQL future directions
+==========================
+
+
+To Do
+-----
+
+- Documentation for the pgdb module (everything specific to PyGreSQL).
+- The large object and direct access functions need much more attention.
+- The C module needs to be cleaned up and redundant code merged,
+  and should get its own unit test module.
+- The fetch method should use real cursors.
+- What shall we do with the "tutorial" directory
+  (it's rather a tutorial for Postgres/SQL than for PyGreSQL,
+  it's using only the query method from the classic pg module and
+  no other PyGreSQL functionality, it's rather a demo than a tutorial)?
+
+Proposed Patches
+----------------
+
+- Notice handling with PQsetNoticeReceiver and PQsetNoticeProcessor
+  (one possible implementation was already suggested by Dmitry Dvoinikov
+  http://mailman.vex.net/pipermail/pygresql/2005-November/001530.html).
+  Maybe also make notifications accessible via the optional cursor and
+  connection attribute "messages" proposed in the DB-API specs.
+
+Wish List
+---------
+
+- Make SQLSTATE error codes available.
+- Make use of PQexecParams() and PQprepare(). This could speed up
+  executemany() and allow retrieving binary data directly by setting
+  the resultFormat parameter to one.
+- Support optional "errorhandler" extension.
+- Support optional cursor and connection attribute "messages".
+- Connection as context manager (see http://tinyurl.com/6j9cef).
+- Users should be able to register their own types with _pg.
+- Let pg and pgdb support namedtuples (as available in Py 2.6).
+  pg could get a new method namedresult(), and pgdb could provide
+  a row factory for namedtuples (similar to sqlite3).
+- New methods in the classic module, similar to getresult() and
+  dictresult(), but returning dictionaries of rows instead of lists
+  of rows (with primary key or oids as keys).
+- Make PyGreSQL thread-safe on the connection level.
+- The API documentation could be created with Epydoc.
+- Write a tutorial for beginners and advanced use.
+- More and better documented examples.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/index.html
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/index.html b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/index.html
new file mode 100644
index 0000000..be2b37c
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/index.html
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>PyGreSQL - PostgreSQL module for Python</title>
+  <meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
+  <meta name="description" content="PyGreSQL homepage">
+  <meta name="keywords" content="PyGreSQL, Python, PostgreSQL, database, driver, DB-API, pg, pgdb">
+  <style type="text/css">
+  <!--
+  body {
+    margin: 8pt;
+    padding: 8pt;
+    background-color: #f8f8ff;
+    color: #000008;
+    text-align: justify;
+    font-family: Arial, Verdana, Helvetica, sans-serif;
+    font-size: 12pt; }
+  a {
+    text-decoration: none; }
+  a:hover {
+    text-decoration: underline; }
+  h1, h2 {
+    color: #006; }
+  h1 {
+    padding-top: 16pt;
+    font-size: 18pt; }
+  h2 {
+    padding-top: 8pt;
+    font-size: 16pt; }
+  ul {
+    list-style-type: none; }
+  ul li {
+    margin-top: 4pt;
+    font-size: 13pt; }
+  ul ul li {
+    margin-top: 2pt;
+    font-size: 12pt; }
+  #title {
+    position: absolute;
+    top: 0px;
+    left: 16px;
+    font-size: 36px;
+    font-style: italic;
+    letter-spacing: 5px;
+    color: #666;
+    z-index: 600; }
+  #version {
+    position: absolute;
+    top: 42px;
+    left: 64px;
+    font-size: 11px;
+    font-style: italic;
+    letter-spacing: 5px;
+    color: #000;
+    z-index: 610; }
+  #banner {
+    position: absolute;
+    padding-top: 0px;
+    padding-bottom: 0px;
+    text-align: center;
+    top: 27px;
+    left: 0px;
+    width: 100%;
+    height: 30px;
+    background: #ccd4e2;
+    z-index: 550;
+    border-top: 1px #999 solid;
+    border-bottom: 1px #999 solid; }
+  #bannertext {
+    position: absolute;
+    text-align: center;
+    font-size: 14px;
+    font-weight: bold;
+    letter-spacing: 4px;
+    color: #000066;
+    top: 39px;
+    right: 5%;
+    z-index: 560; }
+  #content {
+    margin: 36px 20px 2px 20px;
+    padding: 4pt 8pt 4pt 16pt;
+    border-left: 1px dashed #555;
+    border-bottom: 1px dashed #555; }
+  #copyright {
+    padding-top: 6pt;
+    font-size: 10pt;
+    color: #333;
+    text-align: center; }
+  -->
+  </style>
+</head>
+
+<body>
+
+  <div id="title">PyGreSQL</div>
+  <div id="version">Version 4.0</div>
+  <div id="banner"></div>
+  <div id="bannertext">:: PostgreSQL module for Python ::</div>
+
+  <div id="content">
+
+    <h1>PyGreSQL &ndash; PostgreSQL module for Python</h1>
+
+    <p><b>PyGreSQL</b> is an <em>open-source</em>
+    <a href="http://www.python.org">Python</a> module
+    that interfaces to a <a href="http://www.postgresql.org">PostgreSQL</a> database.
+    It embeds the PostgreSQL query library to allow easy use of the powerful PostgreSQL
+    features from a Python script.</p>
+
+    <p>This software is copyright &copy; 1995, Pascal Andre.<br />
+    Further modifications are copyright &copy; 1997-2006 by D'Arcy J.M. Cain.</p>
+
+    <p>See the
+    <a href="readme.html#copyright-notice">copyright notice</a>
+    for detailed information.</p>
+
+    <a name="documentation"></a>
+    <h2>Documentation</h2>
+
+    <p>The following information is also available in the <b>docs</b> folder of the distribution:</p>
+
+    <ul>
+      <li><a href="readme.html"><b>readme</b> &ndash; General Information</a>
+        <ul>
+          <li><a href="readme.html#copyright-notice">Copyright notice</a></li>
+          <li><a href="readme.html#introduction">Introduction</a></li>
+          <li><a href="readme.html#where-to-get">Where to get ... ?</a></li>
+          <li><a href="readme.html#distribution-files">Distribution files</a></li>
+        </ul></li>
+      <li><a href="announce.html"><b>announce</b> &ndash; Last announcement</a></li>
+      <li><a href="install.html"><b>install</b> &ndash; Installation</a></li>
+      <li><a href="pg.html"><b>pg</b> &ndash; The &ldquo;classic&rdquo; PyGreSQL interface</a></li>
+      <li><a href="pgdb.html"><b>pgdb</b> &ndash; The DB-API compliant PyGreSQL interface</a></li>
+      <li><a href="changelog.html"><b>changelog</b> &ndash; Historical changes</a></li>
+      <li><a href="future.html"><b>future</b> &ndash; Future directions</a></li>
+    </ul>
+
+    <a name="cvs"></a>
+    <h2>CVS Access</h2>
+
+    <p>The
+    <a href="http://www.pygresql.org/cvsweb.cgi/pygresql">CVS repository</a>
+    is available through
+    <a href="http://www.freebsd.org/projects/cvsweb.html">CVSWeb</a>.</p>
+
+    <a name="mailinglist"></a>
+    <h2>Mailing list</h2>
+
+    <p>You can join
+    <a href="http://mailman.vex.net/mailman/listinfo/pygresql">the mailing
+    list</a> to discuss future development of the PyGreSQL interface.
+    This is usually a low volume list except when there are new features
+    being added.</p>
+
+    <a name="examples"></a>
+    <h2>Examples</h2>
+
+    <p>I am starting to collect examples of applications that use PyGreSQL.
+    So far I only have a few but if you have an example for me, you can
+    either send me the files or the URL for me to point to.</p>
+
+    <p>Here is a <a href="http://ontario.bikerides.ca">List of motorcycle
+    rides in Ontario</a> that uses a PostgreSQL database to store the
+    rides. There is a link at the bottom of the page to view the source code.</p>
+
+    <p>
+    Oleg Broytmann has written a simple example
+    <a href="http://phd.pp.ru/Software/Python/#rgb_example">RGB
+    database demo</a>.
+    </p>
+
+  </div>
+
+  <div id="copyright">
+  Created and maintained by D'Arcy J.M. Cain &ndash;
+  last update: 17 February 2006.<br />
+  If you have any comments, <a href="mailto:darcy@pygresql.org">send mail</a> to me.
+  </div>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/192cff1f/tools/bin/pythonSrc/PyGreSQL-4.0/docs/install.html
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/PyGreSQL-4.0/docs/install.html b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/install.html
new file mode 100644
index 0000000..f1e48c0
--- /dev/null
+++ b/tools/bin/pythonSrc/PyGreSQL-4.0/docs/install.html
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
+<title>PyGreSQL Installation</title>
+<link rel="stylesheet" href="docs.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="pygresql-installation">
+<h1 class="title">PyGreSQL Installation</h1>
+<div class="contents topic">
+<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
+<ul class="auto-toc simple">
+<li><a class="reference" href="#general" id="id1" name="id1">1&nbsp;&nbsp;&nbsp;General</a></li>
+<li><a class="reference" href="#installing-from-a-binary-distribution" id="id2" name="id2">2&nbsp;&nbsp;&nbsp;Installing from a Binary Distribution</a></li>
+<li><a class="reference" href="#installing-from-source" id="id3" name="id3">3&nbsp;&nbsp;&nbsp;Installing from Source</a><ul class="auto-toc">
+<li><a class="reference" href="#building-and-installing-with-distutils" id="id4" name="id4">3.1&nbsp;&nbsp;&nbsp;Building and installing with Distutils</a></li>
+<li><a class="reference" href="#compiling-manually" id="id5" name="id5">3.2&nbsp;&nbsp;&nbsp;Compiling Manually</a></li>
+<li><a class="reference" href="#stand-alone" id="id6" name="id6">3.3&nbsp;&nbsp;&nbsp;Stand-Alone</a></li>
+<li><a class="reference" href="#built-in-to-python-interpreter" id="id7" name="id7">3.4&nbsp;&nbsp;&nbsp;Built-in to Python interpreter</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id1" id="general" name="general">1&nbsp;&nbsp;&nbsp;General</a></h1>
+<p>You must first have installed Python and PostgreSQL on your system.
+If you want to access remote database only, you don't need to install
+the full PostgreSQL server, but only the C interface (libpq). If you
+are on Windows, make sure that the directory with libpq.dll is in your
+<tt class="docutils literal"><span class="pre">PATH</span></tt> environment variable.</p>
+<p>The current version of PyGreSQL has been tested with Python 2.5 and
+PostGreSQL 8.3. Older version should work as well, but you will need
+at least Python 2.3 and PostgreSQL 7.4.</p>
+<p>PyGreSQL will be installed as three modules, a dynamic module called
+_pg.pyd, and two pure Python wrapper modules called pg.py and pgdb.py.
+All three files will be installed directly into the Python site-packages
+directory. To uninstall PyGreSQL, simply remove these three files again.</p>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id2" id="installing-from-a-binary-distribution" name="installing-from-a-binary-distribution">2&nbsp;&nbsp;&nbsp;Installing from a Binary Distribution</a></h1>
+<p>This is the easiest way to install PyGreSQL.</p>
+<p>You can currently download PyGreSQL as Linux RPM, NetBSD package and Windows
+installer. Make sure the required Python version of the binary package matches
+the Python version you have installed.</p>
+<p>Install the package as usual on your system.</p>
+<p>Note that the documentation is currently only included in the source package.</p>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id3" id="installing-from-source" name="installing-from-source">3&nbsp;&nbsp;&nbsp;Installing from Source</a></h1>
+<p>If you want to install PyGreSQL from Source, or there is no binary
+package available for your platform, follow these instructions.</p>
+<p>Make sure the Python header files and PostgreSQL client and server header
+files are installed. These come usually with the &quot;devel&quot; packages on Unix
+systems and the installer executables on Windows systems.</p>
+<p>If you are using a precompiled PostgreSQL, you will also need the pg_config
+tool. This is usually also part of the &quot;devel&quot; package on Unix, and will be
+installed as part of the database server feature on Windows systems.</p>
+<div class="section">
+<h2><a class="toc-backref" href="#id4" id="building-and-installing-with-distutils" name="building-and-installing-with-distutils">3.1&nbsp;&nbsp;&nbsp;Building and installing with Distutils</a></h2>
+<p>You can build and install PyGreSQL using
+<a class="reference" href="http://docs.python.org/install/">Distutils</a>.</p>
+<p>Download and unpack the PyGreSQL source tarball if you haven't already done so.</p>
+<p>Type the following commands to build and install PyGreSQL:</p>
+<pre class="literal-block">
+python setup.py build
+python setup.py install
+</pre>
+<p>If you are using <a class="reference" href="http://www.mingw.org">MinGW</a> to build PyGreSQL under
+Microsoft Windows, please note that Python newer version 2.3 is using msvcr71
+instead of msvcrt as its common runtime library. You can allow for that by
+editing the file <tt class="docutils literal"><span class="pre">%MinGWpath%/lib/gcc/%MinGWversion%/specs</span></tt> and changing
+the entry that reads <tt class="docutils literal"><span class="pre">-lmsvcrt</span></tt> to <tt class="docutils literal"><span class="pre">-lmsvcr71</span></tt>. You may also need to copy
+<tt class="docutils literal"><span class="pre">libpq.lib</span></tt> to <tt class="docutils literal"><span class="pre">libpq.a</span></tt> in the PostgreSQL <tt class="docutils literal"><span class="pre">lib</span></tt> directory. Then use
+the following command to build and install PyGreSQL:</p>
+<pre class="literal-block">
+python setup.py build -c mingw32 install
+</pre>
+<p>Now you should be ready to use PyGreSQL.</p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id5" id="compiling-manually" name="compiling-manually">3.2&nbsp;&nbsp;&nbsp;Compiling Manually</a></h2>
+<p>The source file for compiling the dynamic module is called pgmodule.c.
+You have two options. You can compile PyGreSQL as a stand-alone module
+or you can build it into the Python interpreter.</p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id6" id="stand-alone" name="stand-alone">3.3&nbsp;&nbsp;&nbsp;Stand-Alone</a></h2>
+<ul>
+<li><p class="first">In the directory containing <tt class="docutils literal"><span class="pre">pgmodule.c</span></tt>, run the following command:</p>
+<pre class="literal-block">
+cc -fpic -shared -o _pg.so -I$PYINC -I$PGINC -I$PSINC -L$PGLIB -lpq pgmodule.c
+</pre>
+<p>where you have to set:</p>
+<pre class="literal-block">
+PYINC = path to the Python include files
+        (usually something like /usr/include/python)
+PGINC = path to the PostgreSQL client include files
+        (something like /usr/include/pgsql or /usr/include/postgresql)
+PSINC = path to the PostgreSQL server include files
+        (like /usr/include/pgsql/server or /usr/include/postgresql/server)
+PGLIB = path to the PostgreSQL object code libraries (usually /usr/lib)
+</pre>
+<p>If you are not sure about the above paths, try something like:</p>
+<pre class="literal-block">
+PYINC=`find /usr -name Python.h`
+PGINC=`find /usr -name libpq-fe.h`
+PSINC=`find /usr -name postgres.h`
+PGLIB=`find /usr -name libpq.so`
+</pre>
+<p>If you have the <tt class="docutils literal"><span class="pre">pg_config</span></tt> tool installed, you can set:</p>
+<pre class="literal-block">
+PGINC=`pg_config --includedir`
+PSINC=`pg_config --includedir-server`
+PGLIB=`pg_config --libdir`
+</pre>
+<p>Some options may be added to this line:</p>
+<pre class="literal-block">
+-DNO_DEF_VAR   no default variables support
+-DNO_DIRECT    no direct access methods
+-DNO_LARGE     no large object support
+-DNO_PQSOCKET  if running an older PostgreSQL
+</pre>
+<p>Define <tt class="docutils literal"><span class="pre">NO_PQSOCKET</span></tt> if you are using a version of PostgreSQL before 6.4
+that does not have the PQsocket function. The other options will be
+described in the next sections.</p>
+<p>On some systems you may need to include <tt class="docutils literal"><span class="pre">-lcrypt</span></tt> in the list of libraries
+to make it compile.</p>
+</li>
+<li><p class="first">Test the new module. Something like the following should work:</p>
+<pre class="literal-block">
+$ python
+
+&gt;&gt;&gt; import _pg
+&gt;&gt;&gt; db = _pg.connect('thilo','localhost')
+&gt;&gt;&gt; db.query(&quot;INSERT INTO test VALUES ('ping','pong')&quot;)
+18304
+&gt;&gt;&gt; db.query(&quot;SELECT * FROM test&quot;)
+eins|zwei
+----+----
+ping|pong
+(1 row)
+</pre>
+</li>
+<li><p class="first">Finally, move the <tt class="docutils literal"><span class="pre">_pg.so</span></tt>, <tt class="docutils literal"><span class="pre">pg.py</span></tt>, and <tt class="docutils literal"><span class="pre">pgdb.py</span></tt> to a directory in
+your <tt class="docutils literal"><span class="pre">PYTHONPATH</span></tt>. A good place would be <tt class="docutils literal"><span class="pre">/usr/lib/python/site-packages</span></tt>
+if your Python modules are in <tt class="docutils literal"><span class="pre">/usr/lib/python</span></tt>.</p>
+</li>
+</ul>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id7" id="built-in-to-python-interpreter" name="built-in-to-python-interpreter">3.4&nbsp;&nbsp;&nbsp;Built-in to Python interpreter</a></h2>
+<ul>
+<li><p class="first">Find the directory where your <tt class="docutils literal"><span class="pre">Setup</span></tt> file lives (usually in the <tt class="docutils literal"><span class="pre">Modules</span></tt>
+subdirectory) in the Python source hierarchy and copy or symlink the
+<tt class="docutils literal"><span class="pre">pgmodule.c</span></tt> file there.</p>
+</li>
+<li><p class="first">Add the following line to your 'Setup' file:</p>
+<pre class="literal-block">
+_pg  pgmodule.c -I$PGINC -I$PSINC -L$PGLIB -lpq
+</pre>
+<p>where:</p>
+<pre class="literal-block">
+PGINC = path to the PostgreSQL client include files (see above)
+PSINC = path to the PostgreSQL server include files (see above)
+PGLIB = path to the PostgreSQL object code libraries (see above)
+</pre>
+<p>Some options may be added to this line:</p>
+<pre class="literal-block">
+-DNO_DEF_VAR   no default variables support
+-DNO_DIRECT    no direct access methods
+-DNO_LARGE     no large object support
+-DNO_PQSOCKET  if running an older PostgreSQL (see above)
+</pre>
+<p>On some systems you may need to include <tt class="docutils literal"><span class="pre">-lcrypt</span></tt> in the list of libraries
+to make it compile.</p>
+</li>
+<li><p class="first">If you want a shared module, make sure that the <tt class="docutils literal"><span class="pre">shared</span></tt> keyword is
+uncommented and add the above line below it. You used to need to install
+your shared modules with <tt class="docutils literal"><span class="pre">make</span> <span class="pre">sharedinstall</span></tt> but this no longer seems
+to be true.</p>
+</li>
+<li><p class="first">Copy <tt class="docutils literal"><span class="pre">pg.py</span></tt> to the lib directory where the rest of your modules are.
+For example, that's <tt class="docutils literal"><span class="pre">/usr/local/lib/Python</span></tt> on my system.</p>
+</li>
+<li><p class="first">Rebuild Python from the root directory of the Python source hierarchy by
+running <tt class="docutils literal"><span class="pre">make</span> <span class="pre">-f</span> <span class="pre">Makefile.pre.in</span> <span class="pre">boot</span></tt> and <tt class="docutils literal"><span class="pre">make</span> <span class="pre">&amp;&amp;</span> <span class="pre">make</span> <span class="pre">install</span></tt>.</p>
+</li>
+<li><p class="first">For more details read the documentation at the top of <tt class="docutils literal"><span class="pre">Makefile.pre.in</span></tt>.</p>
+</li>
+</ul>
+</div>
+</div>
+</div>
+</body>
+</html>


Mime
View raw message