Skip to content

Commit

Permalink
Import modified postgresql 8.2 source
Browse files Browse the repository at this point in the history
  • Loading branch information
drkp committed Mar 31, 2017
1 parent f81bb8f commit 1bbdc2b
Show file tree
Hide file tree
Showing 4,271 changed files with 2,043,382 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
23 changes: 23 additions & 0 deletions pgsql/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 1,23 @@
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)

Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group

Portions Copyright (c) 1994, The Regents of the University of California

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
138 changes: 138 additions & 0 deletions pgsql/GNUmakefile.in
Original file line number Diff line number Diff line change
@@ -0,0 1,138 @@
#
# PostgreSQL top level makefile
#
# $PostgreSQL: pgsql/GNUmakefile.in,v 1.45 2006/08/18 19:58:05 adunstan Exp $
#

subdir =
top_builddir = .
include $(top_builddir)/src/Makefile.global

all:
$(MAKE) -C doc all
$(MAKE) -C src all
$(MAKE) -C config all
@echo "All of PostgreSQL successfully made. Ready to install."

install:
$(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
@echo "PostgreSQL installation complete."

installdirs uninstall:
$(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@

distprep:
$(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib $@

# clean, distclean, etc should apply to contrib too, even though
# it's not built by default
clean:
$(MAKE) -C doc $@
$(MAKE) -C contrib $@
$(MAKE) -C src $@
$(MAKE) -C config $@
# Garbage from autoconf:
@rm -rf autom4te.cache/

# Important: distclean `src' last, otherwise Makefile.global
# will be gone too soon.
distclean maintainer-clean:
-$(MAKE) -C doc $@
-$(MAKE) -C contrib $@
-$(MAKE) -C config $@
-$(MAKE) -C src $@
-rm -f config.cache config.log config.status GNUmakefile
# Garbage from autoconf:
@rm -rf autom4te.cache/

check: all

check installcheck installcheck-parallel:
$(MAKE) -C src/test $@

GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
./config.status $@


##########################################################################

distdir := postgresql-$(VERSION)
dummy := =install=
garbage := =* "#"* ."#"* *~* *.orig *.rej core postgresql-*

dist: $(distdir).tar.gz
ifeq ($(split-dist), yes)
dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz
endif
dist:
-rm -rf $(distdir)

$(distdir).tar: distdir
$(TAR) chf $@ $(distdir)

opt_files := \
src/tools src/tutorial \
$(addprefix src/pl/, plperl plpython tcl)

docs_files := doc/postgres.tar.gz doc/src doc/TODO.detail

postgresql-base-$(VERSION).tar: distdir
$(TAR) -c $(addprefix --exclude $(distdir)/, $(docs_files) $(opt_files) src/test) \
-f $@ $(distdir)

postgresql-docs-$(VERSION).tar: distdir
$(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))

postgresql-opt-$(VERSION).tar: distdir
$(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))

postgresql-test-$(VERSION).tar: distdir
$(TAR) cf $@ $(distdir)/src/test

distdir:
-rm -rf $(distdir)* $(dummy)
for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
file=`expr X$$x : 'X\./\(.*\)'`; \
if test -d "$(top_srcdir)/$$file" ; then \
mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file"; \
else \
ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
|| cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
fi || exit; \
done
$(MAKE) -C $(distdir) distprep
$(MAKE) -C $(distdir)/doc/src/sgml/ HISTORY INSTALL regress_README
cp $(distdir)/doc/src/sgml/HISTORY $(distdir)/
cp $(distdir)/doc/src/sgml/INSTALL $(distdir)/
cp $(distdir)/doc/src/sgml/regress_README $(distdir)/src/test/regress/README
$(MAKE) -C $(distdir) distclean
rm -f $(distdir)/README.CVS

distcheck: $(distdir).tar.gz
-rm -rf $(dummy)
mkdir $(dummy)
$(GZIP) -d -c $< | $(TAR) xf -
install_prefix=`cd $(dummy) && pwd`; \
cd $(distdir) \
&& ./configure --prefix="$$install_prefix"
$(MAKE) -C $(distdir) -q distprep
$(MAKE) -C $(distdir)
$(MAKE) -C $(distdir) install
$(MAKE) -C $(distdir) uninstall
@echo "checking whether \`$(MAKE) uninstall' works"
test `find $(dummy) ! -type d | wc -l` -eq 0
$(MAKE) -C $(distdir) dist
# Room for improvement: Check here whether this distribution tarball
# is sufficiently similar to the original one.
-rm -rf $(distdir) $(dummy)
@echo "Distribution integrity checks out."

.PHONY: dist distdir distcheck
unexport split-dist
36 changes: 36 additions & 0 deletions pgsql/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 1,36 @@
# The PostgreSQL make files exploit features of GNU make that other
# makes do not have. Because it is a common mistake for users to try
# to build Postgres with a different make, we have this make file
# that, as a service, will look for a GNU make and invoke it, or show
# an error message if none could be found.

# If the user were using GNU make now, this file would not get used
# because GNU make uses a make file named "GNUmakefile" in preference
# to "Makefile" if it exists. PostgreSQL is shipped with a
# "GNUmakefile". If the user hasn't run the configure script yet, the
# GNUmakefile won't exist yet, so we catch that case as well.


all check install installdirs installcheck installcheck-parallel uninstall dep depend clean distclean maintainer-clean:
@if [ ! -f GNUmakefile ] ; then \
echo "You need to run the 'configure' program first. See the file"; \
echo "'INSTALL' for installation instructions." ; \
false ; \
fi
@IFS=':' ; \
for dir in $$PATH; do \
for prog in gmake gnumake make; do \
if [ -f $$dir/$$prog ] && ( $$dir/$$prog -f /dev/null --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then \
GMAKE=$$dir/$$prog; \
break 2; \
fi; \
done; \
done; \
\
if [ x"$${GMAKE set}" = xset ]; then \
echo "Using GNU make found at $${GMAKE}"; \
$${GMAKE} $@ ; \
else \
echo "You must use GNU make to build PostgreSQL." ; \
false; \
fi
49 changes: 49 additions & 0 deletions pgsql/README
Original file line number Diff line number Diff line change
@@ -0,0 1,49 @@
PostgreSQL Database Management System
=====================================

This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions. This distribution also contains C language bindings.

PostgreSQL has many language interfaces including some of the more
common listed below:

C - http://thaiopensource.org/development/libpqxx/
JDBC - http://jdbc.postgresql.org
ODBC - http://odbc.postgresql.org
Perl - http://search.cpan.org/~dbdpg/
PHP - http://www.php.net
Python - http://www.initd.org/
Ruby - http://ruby.scripting.ca/postgres/

Other language binding are available from a variety of contributing
parties.

PostgreSQL also has a great number of procedural languages available,
a short but not complete list is below:

PL/pgSQL - included in PostgreSQL source distribution
PL/Perl - included in PostgreSQL source distribution
PL/PHP - http://projects.commandprompt.com/projects/public/plphp
PL/Python - included in PostgreSQL source distribution
PL/Java - http://gborg.postgresql.org/project/pljava/projdisplay.php
PL/Tcl - included in PostgreSQL source distribution

See the file INSTALL for instructions on how to build and install
PostgreSQL. That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system. Changes between all PostgreSQL releases are recorded in the
file HISTORY. Copyright and license information can be found in the
file COPYRIGHT. A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software may be obtained at
http://www.postgresql.org/download/. For more information look at our
web site located at http://www.postgresql.org/.

14 changes: 14 additions & 0 deletions pgsql/README.CVS
Original file line number Diff line number Diff line change
@@ -0,0 1,14 @@
(This file does not appear in release tarballs.)

In a release or snapshot tarball of PostgreSQL, documentation files named
INSTALL and HISTORY will appear in this directory. However, these files are
not stored in CVS and so will not be present if you are using a CVS checkout.
If you are using CVS, you can view the most recent install instructions at:
http://developer.postgresql.org/docs/postgres/installation.html
and the current release notes at:
http://developer.postgresql.org/docs/postgres/release.html

Users compiling from CVS will also need compatible versions of Bison and
Flex, as discussed in the install documentation. Bison and Flex are not
needed when using a tarball, since the files they are needed to build are
already present in the tarball.
110 changes: 110 additions & 0 deletions pgsql/README.TXCACHE
Original file line number Diff line number Diff line change
@@ -0,0 1,110 @@
TxCache modified PostgreSQL
==============================

This is a modified version of PostgreSQL 8.2.11 with support for the
TxCache transactional caching system:
http://drkp.net/drkp/papers/txcache-osdi10.pdf
This documentation assumes familiarity with that paper, especially
section 5 which describes the database modifications.

Contact:
Dan Ports <[email protected]>

These modifications are
Copyright (c) 2009-2012, Dan R. K. Ports
Copyright (c) 2009-2012, Massachusetts Institute of Technology
and available under the terms of the PostgreSQL License.


PINNED SNAPSHOTS
----------------

The PIN command saves the current snapshot and allows it to be reused
by future read-only transactions. PIN must be run either outside a
transaction block or as the first statement in a read-only transaction.
PIN returns a string indicating the ID of the saved snapshot. For example:
PIN 5 1334352503 457427
The first number (5) is the identifier for the saved snapshot -- the
logical timestamp of the most recently committed transaction. The
other two numbers are a representation of the current wall-clock time
on the server (seconds microseconds since epoch) and can be used to
enforce real-time freshness requirements.

The snapshot id can be used to start a new transaction with the syntax
BEGIN READ ONLY SNAPSHOTID 5;
which works only for read-only transactions.

Pinned snapshots can be released using the UNPIN command, e.g.
UNPIN 5;
Note that pinned snapshots are not reference-counted. That is,
executing two PIN commands in succession with no read/write
transactions in between will return the same snapshot ID, but it takes
only one UNPIN to release it.

BUG: due to a regrettable internal representation, error messages
involving pinned snapshot may report the wrong (off-by-one) ID.


VALIDITY INTERVALS
------------------

This database is modified to return a validity interval SELECT
queries. To be precise, it only does so for queries in a read-only
transaction running on a pinned snapshot (i.e. one that ran PIN, or
one started with BEGIN SNAPSHOTID). These have the format
SELECT VALIDITY 2 5
indicating that the result is known to be valid for all snapshots
after the commit of transaction 2 but before transaction 5.

This information is available in the command tag, and can be obtained
through libpq. psql normally does not print the command tag for SELECT
queries. Our psql is modified to do so, so be sure to use the one
included here rather than one installed by your regular Postgres
distribution if that matters.

BUG: validity interval tracking does not work for bitmapscans or
tidscans. (No fundamental reason, just laziness on my part.) We've set
enable_bitmapscan and enable_tidscan to 'off' by default; you probably
shouldn't re-enable them in postgresql.conf.


INVALIDATIONS
-------------

If a SELECT query returns results that are still valid at the present
time, the command tag contains a list of invalidation tags, e.g.:
SELECT VALIDITY 5 6 TAGS 1 4001:
As usual, the validity interval returned contains both a lower bound
and an upper bound. The TAGS keyword indicates that the result is
still valid; if it is present, the upper bound is a concrete upper bound
indicating that the query is valid until *at least* the timestamp
specified.

The TAGS keyword is followed by an integer indicating the number of
invalidation tags, and then the tags themselves as a space-delimited
list. The content of the invalidation tags is intended to be opaque to
the caching layer, with the exception that if tag A is a prefix of tag
B, then tag B is a finer-granularity subtag of tag A. (In practice:
tags containing a single colon represent a read dependency on a
particular table; tags containing two colons represent read
dependencies on a particular index-key entry in a table.)

The database produces invalidations indicating which invalidation tags
are affected by the changes made by a read/write transaction. These
can be obtained by reading the virtual table 'pg_invalidations'. It
contains two columns: the transaction's timestamp and tag
affected. There may be multiple rows with the same timestamp (for
transactions that affected multiple tags) or rows with no tags (for
periodic keep-alive invalidations indicating no changes have been
made).

Note that, unusually, reading pg_invalidations causes the table to be
cleared!

Clients can receive notifications when pg_invalidations is updated
using Postgres's LISTEN/NOTIFY asynchronous notification mechanism by
using
LISTEN invalidation;
Typically this would be used by a daemon that listens for
invalidations, reads pg_invalidations, and broadcasts them to all
cache nodes.
12 changes: 12 additions & 0 deletions pgsql/aclocal.m4
Original file line number Diff line number Diff line change
@@ -0,0 1,12 @@
dnl $PostgreSQL: pgsql/aclocal.m4,v 1.18 2004/04/23 18:15:47 momjian Exp $
m4_include([config/ac_func_accept_argtypes.m4])
m4_include([config/acx_pthread.m4])
m4_include([config/c-compiler.m4])
m4_include([config/c-library.m4])
m4_include([config/docbook.m4])
m4_include([config/general.m4])
m4_include([config/libtool.m4])
m4_include([config/perl.m4])
m4_include([config/programs.m4])
m4_include([config/python.m4])
m4_include([config/tcl.m4])
Loading

0 comments on commit 1bbdc2b

Please sign in to comment.