Postgres95 1.01 Distribution - Virgin Sources PG95-1_01
authorMarc G. Fournier <scrappy@hub.org>
Tue, 9 Jul 1996 06:22:35 +0000 (06:22 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Tue, 9 Jul 1996 06:22:35 +0000 (06:22 +0000)
868 files changed:
src/Makefile [new file with mode: 0644]
src/Makefile.global [new file with mode: 0644]
src/backend/Makefile [new file with mode: 0644]
src/backend/access/Makefile.inc [new file with mode: 0644]
src/backend/access/attnum.h [new file with mode: 0644]
src/backend/access/common/Makefile.inc [new file with mode: 0644]
src/backend/access/common/heaptuple.c [new file with mode: 0644]
src/backend/access/common/heapvalid.c [new file with mode: 0644]
src/backend/access/common/indextuple.c [new file with mode: 0644]
src/backend/access/common/indexvalid.c [new file with mode: 0644]
src/backend/access/common/printtup.c [new file with mode: 0644]
src/backend/access/common/scankey.c [new file with mode: 0644]
src/backend/access/common/tupdesc.c [new file with mode: 0644]
src/backend/access/funcindex.h [new file with mode: 0644]
src/backend/access/genam.h [new file with mode: 0644]
src/backend/access/hash.h [new file with mode: 0644]
src/backend/access/hash/Makefile.inc [new file with mode: 0644]
src/backend/access/hash/hash.c [new file with mode: 0644]
src/backend/access/hash/hashfunc.c [new file with mode: 0644]
src/backend/access/hash/hashinsert.c [new file with mode: 0644]
src/backend/access/hash/hashovfl.c [new file with mode: 0644]
src/backend/access/hash/hashpage.c [new file with mode: 0644]
src/backend/access/hash/hashscan.c [new file with mode: 0644]
src/backend/access/hash/hashsearch.c [new file with mode: 0644]
src/backend/access/hash/hashstrat.c [new file with mode: 0644]
src/backend/access/hash/hashutil.c [new file with mode: 0644]
src/backend/access/heap/Makefile.inc [new file with mode: 0644]
src/backend/access/heap/heapam.c [new file with mode: 0644]
src/backend/access/heap/hio.c [new file with mode: 0644]
src/backend/access/heap/stats.c [new file with mode: 0644]
src/backend/access/heapam.h [new file with mode: 0644]
src/backend/access/hio.h [new file with mode: 0644]
src/backend/access/htup.h [new file with mode: 0644]
src/backend/access/ibit.h [new file with mode: 0644]
src/backend/access/index/Makefile.inc [new file with mode: 0644]
src/backend/access/index/genam.c [new file with mode: 0644]
src/backend/access/index/indexam.c [new file with mode: 0644]
src/backend/access/index/istrat.c [new file with mode: 0644]
src/backend/access/iqual.h [new file with mode: 0644]
src/backend/access/istrat.h [new file with mode: 0644]
src/backend/access/itup.h [new file with mode: 0644]
src/backend/access/nbtree.h [new file with mode: 0644]
src/backend/access/nbtree/Makefile.inc [new file with mode: 0644]
src/backend/access/nbtree/README [new file with mode: 0644]
src/backend/access/nbtree/nbtcompare.c [new file with mode: 0644]
src/backend/access/nbtree/nbtinsert.c [new file with mode: 0644]
src/backend/access/nbtree/nbtpage.c [new file with mode: 0644]
src/backend/access/nbtree/nbtree.c [new file with mode: 0644]
src/backend/access/nbtree/nbtscan.c [new file with mode: 0644]
src/backend/access/nbtree/nbtsearch.c [new file with mode: 0644]
src/backend/access/nbtree/nbtsort.c [new file with mode: 0644]
src/backend/access/nbtree/nbtstrat.c [new file with mode: 0644]
src/backend/access/nbtree/nbtutils.c [new file with mode: 0644]
src/backend/access/printtup.h [new file with mode: 0644]
src/backend/access/relscan.h [new file with mode: 0644]
src/backend/access/rtree.h [new file with mode: 0644]
src/backend/access/rtree/Makefile.inc [new file with mode: 0644]
src/backend/access/rtree/rtget.c [new file with mode: 0644]
src/backend/access/rtree/rtproc.c [new file with mode: 0644]
src/backend/access/rtree/rtree.c [new file with mode: 0644]
src/backend/access/rtree/rtscan.c [new file with mode: 0644]
src/backend/access/rtree/rtstrat.c [new file with mode: 0644]
src/backend/access/rtscan.h [new file with mode: 0644]
src/backend/access/rtstrat.h [new file with mode: 0644]
src/backend/access/sdir.h [new file with mode: 0644]
src/backend/access/skey.h [new file with mode: 0644]
src/backend/access/strat.h [new file with mode: 0644]
src/backend/access/transam.h [new file with mode: 0644]
src/backend/access/transam/Makefile.inc [new file with mode: 0644]
src/backend/access/transam/transam.c [new file with mode: 0644]
src/backend/access/transam/transsup.c [new file with mode: 0644]
src/backend/access/transam/varsup.c [new file with mode: 0644]
src/backend/access/transam/xact.c [new file with mode: 0644]
src/backend/access/transam/xid.c [new file with mode: 0644]
src/backend/access/tupdesc.h [new file with mode: 0644]
src/backend/access/tupmacs.h [new file with mode: 0644]
src/backend/access/valid.h [new file with mode: 0644]
src/backend/access/xact.h [new file with mode: 0644]
src/backend/bootstrap/Makefile.inc [new file with mode: 0644]
src/backend/bootstrap/boot.sed [new file with mode: 0644]
src/backend/bootstrap/bootparse.y [new file with mode: 0644]
src/backend/bootstrap/bootscanner.l [new file with mode: 0644]
src/backend/bootstrap/bootstrap.c [new file with mode: 0644]
src/backend/bootstrap/bootstrap.h [new file with mode: 0644]
src/backend/catalog/Makefile.inc [new file with mode: 0644]
src/backend/catalog/README [new file with mode: 0644]
src/backend/catalog/catalog.c [new file with mode: 0644]
src/backend/catalog/catalog.h [new file with mode: 0644]
src/backend/catalog/catname.h [new file with mode: 0644]
src/backend/catalog/genbki.sh [new file with mode: 0644]
src/backend/catalog/heap.c [new file with mode: 0644]
src/backend/catalog/heap.h [new file with mode: 0644]
src/backend/catalog/index.c [new file with mode: 0644]
src/backend/catalog/index.h [new file with mode: 0644]
src/backend/catalog/indexing.c [new file with mode: 0644]
src/backend/catalog/indexing.h [new file with mode: 0644]
src/backend/catalog/pg_aggregate.c [new file with mode: 0644]
src/backend/catalog/pg_aggregate.h [new file with mode: 0644]
src/backend/catalog/pg_am.h [new file with mode: 0644]
src/backend/catalog/pg_amop.h [new file with mode: 0644]
src/backend/catalog/pg_amproc.h [new file with mode: 0644]
src/backend/catalog/pg_attribute.h [new file with mode: 0644]
src/backend/catalog/pg_class.h [new file with mode: 0644]
src/backend/catalog/pg_database.h [new file with mode: 0644]
src/backend/catalog/pg_defaults.h [new file with mode: 0644]
src/backend/catalog/pg_demon.h [new file with mode: 0644]
src/backend/catalog/pg_group.h [new file with mode: 0644]
src/backend/catalog/pg_hosts.h [new file with mode: 0644]
src/backend/catalog/pg_index.h [new file with mode: 0644]
src/backend/catalog/pg_inheritproc.h [new file with mode: 0644]
src/backend/catalog/pg_inherits.h [new file with mode: 0644]
src/backend/catalog/pg_ipl.h [new file with mode: 0644]
src/backend/catalog/pg_language.h [new file with mode: 0644]
src/backend/catalog/pg_listener.h [new file with mode: 0644]
src/backend/catalog/pg_log.h [new file with mode: 0644]
src/backend/catalog/pg_magic.h [new file with mode: 0644]
src/backend/catalog/pg_opclass.h [new file with mode: 0644]
src/backend/catalog/pg_operator.c [new file with mode: 0644]
src/backend/catalog/pg_operator.h [new file with mode: 0644]
src/backend/catalog/pg_parg.h [new file with mode: 0644]
src/backend/catalog/pg_proc.c [new file with mode: 0644]
src/backend/catalog/pg_proc.h [new file with mode: 0644]
src/backend/catalog/pg_rewrite.h [new file with mode: 0644]
src/backend/catalog/pg_server.h [new file with mode: 0644]
src/backend/catalog/pg_statistic.h [new file with mode: 0644]
src/backend/catalog/pg_time.h [new file with mode: 0644]
src/backend/catalog/pg_type.c [new file with mode: 0644]
src/backend/catalog/pg_type.h [new file with mode: 0644]
src/backend/catalog/pg_user.h [new file with mode: 0644]
src/backend/catalog/pg_variable.h [new file with mode: 0644]
src/backend/catalog/pg_version.h [new file with mode: 0644]
src/backend/catalog/unused_oids [new file with mode: 0644]
src/backend/commands/Makefile.inc [new file with mode: 0644]
src/backend/commands/_deadcode/version.c [new file with mode: 0644]
src/backend/commands/async.c [new file with mode: 0644]
src/backend/commands/async.h [new file with mode: 0644]
src/backend/commands/cluster.c [new file with mode: 0644]
src/backend/commands/cluster.h [new file with mode: 0644]
src/backend/commands/command.c [new file with mode: 0644]
src/backend/commands/command.h [new file with mode: 0644]
src/backend/commands/copy.c [new file with mode: 0644]
src/backend/commands/copy.h [new file with mode: 0644]
src/backend/commands/creatinh.c [new file with mode: 0644]
src/backend/commands/creatinh.h [new file with mode: 0644]
src/backend/commands/defind.c [new file with mode: 0644]
src/backend/commands/define.c [new file with mode: 0644]
src/backend/commands/defrem.h [new file with mode: 0644]
src/backend/commands/explain.c [new file with mode: 0644]
src/backend/commands/explain.h [new file with mode: 0644]
src/backend/commands/purge.c [new file with mode: 0644]
src/backend/commands/purge.h [new file with mode: 0644]
src/backend/commands/recipe.c [new file with mode: 0644]
src/backend/commands/recipe.h [new file with mode: 0644]
src/backend/commands/remove.c [new file with mode: 0644]
src/backend/commands/rename.c [new file with mode: 0644]
src/backend/commands/rename.h [new file with mode: 0644]
src/backend/commands/vacuum.c [new file with mode: 0644]
src/backend/commands/vacuum.h [new file with mode: 0644]
src/backend/commands/version.h [new file with mode: 0644]
src/backend/commands/view.c [new file with mode: 0644]
src/backend/commands/view.h [new file with mode: 0644]
src/backend/executor/Makefile.inc [new file with mode: 0644]
src/backend/executor/execAmi.c [new file with mode: 0644]
src/backend/executor/execFlatten.c [new file with mode: 0644]
src/backend/executor/execFlatten.h [new file with mode: 0644]
src/backend/executor/execJunk.c [new file with mode: 0644]
src/backend/executor/execMain.c [new file with mode: 0644]
src/backend/executor/execProcnode.c [new file with mode: 0644]
src/backend/executor/execQual.c [new file with mode: 0644]
src/backend/executor/execScan.c [new file with mode: 0644]
src/backend/executor/execTuples.c [new file with mode: 0644]
src/backend/executor/execUtils.c [new file with mode: 0644]
src/backend/executor/execdebug.h [new file with mode: 0644]
src/backend/executor/execdefs.h [new file with mode: 0644]
src/backend/executor/execdesc.h [new file with mode: 0644]
src/backend/executor/executor.h [new file with mode: 0644]
src/backend/executor/functions.c [new file with mode: 0644]
src/backend/executor/functions.h [new file with mode: 0644]
src/backend/executor/hashjoin.h [new file with mode: 0644]
src/backend/executor/nodeAgg.c [new file with mode: 0644]
src/backend/executor/nodeAgg.h [new file with mode: 0644]
src/backend/executor/nodeAppend.c [new file with mode: 0644]
src/backend/executor/nodeAppend.h [new file with mode: 0644]
src/backend/executor/nodeGroup.c [new file with mode: 0644]
src/backend/executor/nodeGroup.h [new file with mode: 0644]
src/backend/executor/nodeHash.c [new file with mode: 0644]
src/backend/executor/nodeHash.h [new file with mode: 0644]
src/backend/executor/nodeHashjoin.c [new file with mode: 0644]
src/backend/executor/nodeHashjoin.h [new file with mode: 0644]
src/backend/executor/nodeIndexscan.c [new file with mode: 0644]
src/backend/executor/nodeIndexscan.h [new file with mode: 0644]
src/backend/executor/nodeMaterial.c [new file with mode: 0644]
src/backend/executor/nodeMaterial.h [new file with mode: 0644]
src/backend/executor/nodeMergejoin.c [new file with mode: 0644]
src/backend/executor/nodeMergejoin.h [new file with mode: 0644]
src/backend/executor/nodeNestloop.c [new file with mode: 0644]
src/backend/executor/nodeNestloop.h [new file with mode: 0644]
src/backend/executor/nodeResult.c [new file with mode: 0644]
src/backend/executor/nodeResult.h [new file with mode: 0644]
src/backend/executor/nodeSeqscan.c [new file with mode: 0644]
src/backend/executor/nodeSeqscan.h [new file with mode: 0644]
src/backend/executor/nodeSort.c [new file with mode: 0644]
src/backend/executor/nodeSort.h [new file with mode: 0644]
src/backend/executor/nodeTee.c [new file with mode: 0644]
src/backend/executor/nodeTee.h [new file with mode: 0644]
src/backend/executor/nodeUnique.c [new file with mode: 0644]
src/backend/executor/nodeUnique.h [new file with mode: 0644]
src/backend/executor/tuptable.h [new file with mode: 0644]
src/backend/include/Makefile.inc [new file with mode: 0644]
src/backend/include/c.h [new file with mode: 0644]
src/backend/include/miscadmin.h [new file with mode: 0644]
src/backend/include/postgres.h [new file with mode: 0644]
src/backend/lib/Makefile.inc [new file with mode: 0644]
src/backend/lib/bit.c [new file with mode: 0644]
src/backend/lib/dllist.c [new file with mode: 0644]
src/backend/lib/dllist.h [new file with mode: 0644]
src/backend/lib/fstack.c [new file with mode: 0644]
src/backend/lib/fstack.h [new file with mode: 0644]
src/backend/lib/hasht.c [new file with mode: 0644]
src/backend/lib/hasht.h [new file with mode: 0644]
src/backend/lib/lispsort.c [new file with mode: 0644]
src/backend/lib/lispsort.h [new file with mode: 0644]
src/backend/lib/qsort.c [new file with mode: 0644]
src/backend/lib/qsort.h [new file with mode: 0644]
src/backend/lib/stringinfo.c [new file with mode: 0644]
src/backend/lib/stringinfo.h [new file with mode: 0644]
src/backend/libpq/Makefile.inc [new file with mode: 0644]
src/backend/libpq/auth.c [new file with mode: 0644]
src/backend/libpq/auth.h [new file with mode: 0644]
src/backend/libpq/be-dumpdata.c [new file with mode: 0644]
src/backend/libpq/be-fsstubs.c [new file with mode: 0644]
src/backend/libpq/be-fsstubs.h [new file with mode: 0644]
src/backend/libpq/be-pqexec.c [new file with mode: 0644]
src/backend/libpq/libpq-be.h [new file with mode: 0644]
src/backend/libpq/libpq-fs.h [new file with mode: 0644]
src/backend/libpq/libpq.h [new file with mode: 0644]
src/backend/libpq/portal.c [new file with mode: 0644]
src/backend/libpq/portalbuf.c [new file with mode: 0644]
src/backend/libpq/pqcomm.c [new file with mode: 0644]
src/backend/libpq/pqcomm.h [new file with mode: 0644]
src/backend/libpq/pqpacket.c [new file with mode: 0644]
src/backend/libpq/pqsignal.c [new file with mode: 0644]
src/backend/libpq/pqsignal.h [new file with mode: 0644]
src/backend/main/Makefile.inc [new file with mode: 0644]
src/backend/main/main.c [new file with mode: 0644]
src/backend/makeID [new file with mode: 0644]
src/backend/nodes/Makefile.inc [new file with mode: 0644]
src/backend/nodes/README [new file with mode: 0644]
src/backend/nodes/copyfuncs.c [new file with mode: 0644]
src/backend/nodes/equalfuncs.c [new file with mode: 0644]
src/backend/nodes/execnodes.h [new file with mode: 0644]
src/backend/nodes/list.c [new file with mode: 0644]
src/backend/nodes/makefuncs.c [new file with mode: 0644]
src/backend/nodes/makefuncs.h [new file with mode: 0644]
src/backend/nodes/memnodes.h [new file with mode: 0644]
src/backend/nodes/nodeFuncs.c [new file with mode: 0644]
src/backend/nodes/nodeFuncs.h [new file with mode: 0644]
src/backend/nodes/nodes.c [new file with mode: 0644]
src/backend/nodes/nodes.h [new file with mode: 0644]
src/backend/nodes/outfuncs.c [new file with mode: 0644]
src/backend/nodes/params.h [new file with mode: 0644]
src/backend/nodes/parsenodes.h [new file with mode: 0644]
src/backend/nodes/pg_list.h [new file with mode: 0644]
src/backend/nodes/plannodes.h [new file with mode: 0644]
src/backend/nodes/primnodes.h [new file with mode: 0644]
src/backend/nodes/print.c [new file with mode: 0644]
src/backend/nodes/read.c [new file with mode: 0644]
src/backend/nodes/readfuncs.c [new file with mode: 0644]
src/backend/nodes/readfuncs.h [new file with mode: 0644]
src/backend/nodes/relation.h [new file with mode: 0644]
src/backend/optimizer/Makefile.inc [new file with mode: 0644]
src/backend/optimizer/clauseinfo.h [new file with mode: 0644]
src/backend/optimizer/clauses.h [new file with mode: 0644]
src/backend/optimizer/cost.h [new file with mode: 0644]
src/backend/optimizer/internal.h [new file with mode: 0644]
src/backend/optimizer/joininfo.h [new file with mode: 0644]
src/backend/optimizer/keys.h [new file with mode: 0644]
src/backend/optimizer/ordering.h [new file with mode: 0644]
src/backend/optimizer/path/Makefile.inc [new file with mode: 0644]
src/backend/optimizer/path/allpaths.c [new file with mode: 0644]
src/backend/optimizer/path/clausesel.c [new file with mode: 0644]
src/backend/optimizer/path/costsize.c [new file with mode: 0644]
src/backend/optimizer/path/hashutils.c [new file with mode: 0644]
src/backend/optimizer/path/indxpath.c [new file with mode: 0644]
src/backend/optimizer/path/joinpath.c [new file with mode: 0644]
src/backend/optimizer/path/joinrels.c [new file with mode: 0644]
src/backend/optimizer/path/joinutils.c [new file with mode: 0644]
src/backend/optimizer/path/mergeutils.c [new file with mode: 0644]
src/backend/optimizer/path/orindxpath.c [new file with mode: 0644]
src/backend/optimizer/path/predmig.c [new file with mode: 0644]
src/backend/optimizer/path/prune.c [new file with mode: 0644]
src/backend/optimizer/path/xfunc.c [new file with mode: 0644]
src/backend/optimizer/pathnode.h [new file with mode: 0644]
src/backend/optimizer/paths.h [new file with mode: 0644]
src/backend/optimizer/plan/Makefile.inc [new file with mode: 0644]
src/backend/optimizer/plan/createplan.c [new file with mode: 0644]
src/backend/optimizer/plan/initsplan.c [new file with mode: 0644]
src/backend/optimizer/plan/planmain.c [new file with mode: 0644]
src/backend/optimizer/plan/planner.c [new file with mode: 0644]
src/backend/optimizer/plan/setrefs.c [new file with mode: 0644]
src/backend/optimizer/plancat.h [new file with mode: 0644]
src/backend/optimizer/planmain.h [new file with mode: 0644]
src/backend/optimizer/planner.h [new file with mode: 0644]
src/backend/optimizer/prep.h [new file with mode: 0644]
src/backend/optimizer/prep/Makefile.inc [new file with mode: 0644]
src/backend/optimizer/prep/archive.c [new file with mode: 0644]
src/backend/optimizer/prep/prepqual.c [new file with mode: 0644]
src/backend/optimizer/prep/preptlist.c [new file with mode: 0644]
src/backend/optimizer/prep/prepunion.c [new file with mode: 0644]
src/backend/optimizer/tlist.h [new file with mode: 0644]
src/backend/optimizer/util/Makefile.inc [new file with mode: 0644]
src/backend/optimizer/util/clauseinfo.c [new file with mode: 0644]
src/backend/optimizer/util/clauses.c [new file with mode: 0644]
src/backend/optimizer/util/indexnode.c [new file with mode: 0644]
src/backend/optimizer/util/internal.c [new file with mode: 0644]
src/backend/optimizer/util/joininfo.c [new file with mode: 0644]
src/backend/optimizer/util/keys.c [new file with mode: 0644]
src/backend/optimizer/util/ordering.c [new file with mode: 0644]
src/backend/optimizer/util/pathnode.c [new file with mode: 0644]
src/backend/optimizer/util/plancat.c [new file with mode: 0644]
src/backend/optimizer/util/relnode.c [new file with mode: 0644]
src/backend/optimizer/util/tlist.c [new file with mode: 0644]
src/backend/optimizer/util/var.c [new file with mode: 0644]
src/backend/optimizer/var.h [new file with mode: 0644]
src/backend/optimizer/xfunc.h [new file with mode: 0644]
src/backend/parser/Makefile.inc [new file with mode: 0644]
src/backend/parser/analyze.c [new file with mode: 0644]
src/backend/parser/catalog_utils.c [new file with mode: 0644]
src/backend/parser/catalog_utils.h [new file with mode: 0644]
src/backend/parser/dbcommands.c [new file with mode: 0644]
src/backend/parser/dbcommands.h [new file with mode: 0644]
src/backend/parser/gram.y [new file with mode: 0644]
src/backend/parser/keywords.c [new file with mode: 0644]
src/backend/parser/keywords.h [new file with mode: 0644]
src/backend/parser/parse_query.c [new file with mode: 0644]
src/backend/parser/parse_query.h [new file with mode: 0644]
src/backend/parser/parse_state.h [new file with mode: 0644]
src/backend/parser/parser.c [new file with mode: 0644]
src/backend/parser/parsetree.h [new file with mode: 0644]
src/backend/parser/scan.l [new file with mode: 0644]
src/backend/parser/scansup.c [new file with mode: 0644]
src/backend/parser/scansup.h [new file with mode: 0644]
src/backend/port/BSD44_derived/Makefile.inc [new file with mode: 0644]
src/backend/port/BSD44_derived/README [new file with mode: 0644]
src/backend/port/BSD44_derived/dl.c [new file with mode: 0644]
src/backend/port/BSD44_derived/float.h [new file with mode: 0644]
src/backend/port/BSD44_derived/machine.h [new file with mode: 0644]
src/backend/port/BSD44_derived/port-protos.h [new file with mode: 0644]
src/backend/port/Makefile.inc [new file with mode: 0644]
src/backend/port/aix/Makefile.inc [new file with mode: 0644]
src/backend/port/aix/README.dlfcn [new file with mode: 0644]
src/backend/port/aix/dlfcn.c [new file with mode: 0644]
src/backend/port/aix/dlfcn.h [new file with mode: 0644]
src/backend/port/aix/machine.h [new file with mode: 0644]
src/backend/port/aix/mkldexport.sh [new file with mode: 0755]
src/backend/port/aix/port-protos.h [new file with mode: 0644]
src/backend/port/alpha/Makefile.inc [new file with mode: 0644]
src/backend/port/alpha/machine.h [new file with mode: 0644]
src/backend/port/alpha/port-protos.h [new file with mode: 0644]
src/backend/port/alpha/port.c [new file with mode: 0644]
src/backend/port/bsdi/Makefile.inc [new file with mode: 0644]
src/backend/port/bsdi/dynloader.c [new file with mode: 0644]
src/backend/port/bsdi/machine.h [new file with mode: 0644]
src/backend/port/bsdi/port-protos.h [new file with mode: 0644]
src/backend/port/bsdi/port.c [new file with mode: 0644]
src/backend/port/hpux/Makefile.inc [new file with mode: 0644]
src/backend/port/hpux/dynloader.c [new file with mode: 0644]
src/backend/port/hpux/fixade.h [new file with mode: 0644]
src/backend/port/hpux/machine.h [new file with mode: 0644]
src/backend/port/hpux/port-protos.h [new file with mode: 0644]
src/backend/port/hpux/port.c [new file with mode: 0644]
src/backend/port/hpux/tas.c.template [new file with mode: 0644]
src/backend/port/hpux/tas.s [new file with mode: 0644]
src/backend/port/irix5/Makefile.inc [new file with mode: 0644]
src/backend/port/irix5/README [new file with mode: 0644]
src/backend/port/irix5/machine.h [new file with mode: 0644]
src/backend/port/irix5/port-protos.h [new file with mode: 0644]
src/backend/port/irix5/port.c [new file with mode: 0644]
src/backend/port/linux/Makefile.inc [new file with mode: 0644]
src/backend/port/linux/dynloader.c [new file with mode: 0644]
src/backend/port/linux/machine.h [new file with mode: 0644]
src/backend/port/linux/port-protos.h [new file with mode: 0644]
src/backend/port/linux/port.c [new file with mode: 0644]
src/backend/port/sparc/Makefile.inc [new file with mode: 0644]
src/backend/port/sparc/float.h [new file with mode: 0644]
src/backend/port/sparc/machine.h [new file with mode: 0644]
src/backend/port/sparc/port-protos.h [new file with mode: 0644]
src/backend/port/sparc/strtol.c [new file with mode: 0644]
src/backend/port/sparc_solaris/Makefile.inc [new file with mode: 0644]
src/backend/port/sparc_solaris/machine.h [new file with mode: 0644]
src/backend/port/sparc_solaris/port-protos.h [new file with mode: 0644]
src/backend/port/sparc_solaris/port.c [new file with mode: 0644]
src/backend/port/sparc_solaris/rusagestub.h [new file with mode: 0644]
src/backend/port/sparc_solaris/tas.s [new file with mode: 0644]
src/backend/port/ultrix4/Makefile.inc [new file with mode: 0644]
src/backend/port/ultrix4/dl.h [new file with mode: 0644]
src/backend/port/ultrix4/dynloader.c [new file with mode: 0644]
src/backend/port/ultrix4/machine.h [new file with mode: 0644]
src/backend/port/ultrix4/port-protos.h [new file with mode: 0644]
src/backend/port/ultrix4/port.c [new file with mode: 0644]
src/backend/port/ultrix4/strdup.c [new file with mode: 0644]
src/backend/port/win32/machine.h [new file with mode: 0644]
src/backend/port/win32/nt.c [new file with mode: 0644]
src/backend/port/win32/nt.h [new file with mode: 0644]
src/backend/port/win32/pglite.mak [new file with mode: 0644]
src/backend/port/win32/port-protos.h [new file with mode: 0644]
src/backend/port/win32/pwd.h [new file with mode: 0644]
src/backend/port/win32/regex/COPYRIGHT [new file with mode: 0644]
src/backend/port/win32/regex/Makefile.inc [new file with mode: 0644]
src/backend/port/win32/regex/WHATSNEW [new file with mode: 0644]
src/backend/port/win32/regex/cclass.h [new file with mode: 0644]
src/backend/port/win32/regex/cname.h [new file with mode: 0644]
src/backend/port/win32/regex/engine.c [new file with mode: 0644]
src/backend/port/win32/regex/re_format.7 [new file with mode: 0644]
src/backend/port/win32/regex/regcomp.c [new file with mode: 0644]
src/backend/port/win32/regex/regerror.c [new file with mode: 0644]
src/backend/port/win32/regex/regex.3 [new file with mode: 0644]
src/backend/port/win32/regex/regex.h [new file with mode: 0644]
src/backend/port/win32/regex/regex2.h [new file with mode: 0644]
src/backend/port/win32/regex/regexec.c [new file with mode: 0644]
src/backend/port/win32/regex/regexp.h [new file with mode: 0644]
src/backend/port/win32/regex/regfree.c [new file with mode: 0644]
src/backend/port/win32/regex/utils.h [new file with mode: 0644]
src/backend/port/win32/rusagestub.h [new file with mode: 0644]
src/backend/port/win32/sys/cdefs.h [new file with mode: 0644]
src/backend/port/win32/sys/file.h [new file with mode: 0644]
src/backend/port/win32/sys/ipc.h [new file with mode: 0644]
src/backend/port/win32/sys/param.h [new file with mode: 0644]
src/backend/port/win32/sys/sem.h [new file with mode: 0644]
src/backend/port/win32/sys/shm.h [new file with mode: 0644]
src/backend/port/win32/sys/time.h [new file with mode: 0644]
src/backend/postmaster/Makefile.inc [new file with mode: 0644]
src/backend/postmaster/postmaster.c [new file with mode: 0644]
src/backend/regex/COPYRIGHT [new file with mode: 0644]
src/backend/regex/Makefile.inc [new file with mode: 0644]
src/backend/regex/WHATSNEW [new file with mode: 0644]
src/backend/regex/cclass.h [new file with mode: 0644]
src/backend/regex/cdefs.h [new file with mode: 0644]
src/backend/regex/cname.h [new file with mode: 0644]
src/backend/regex/engine.c [new file with mode: 0644]
src/backend/regex/re_format.7 [new file with mode: 0644]
src/backend/regex/regcomp.c [new file with mode: 0644]
src/backend/regex/regerror.c [new file with mode: 0644]
src/backend/regex/regex.3 [new file with mode: 0644]
src/backend/regex/regex.h [new file with mode: 0644]
src/backend/regex/regex2.h [new file with mode: 0644]
src/backend/regex/regexec.c [new file with mode: 0644]
src/backend/regex/regexp.h [new file with mode: 0644]
src/backend/regex/regfree.c [new file with mode: 0644]
src/backend/regex/utils.h [new file with mode: 0644]
src/backend/rewrite/Makefile.inc [new file with mode: 0644]
src/backend/rewrite/locks.c [new file with mode: 0644]
src/backend/rewrite/locks.h [new file with mode: 0644]
src/backend/rewrite/prs2lock.h [new file with mode: 0644]
src/backend/rewrite/rewriteDefine.c [new file with mode: 0644]
src/backend/rewrite/rewriteDefine.h [new file with mode: 0644]
src/backend/rewrite/rewriteHandler.c [new file with mode: 0644]
src/backend/rewrite/rewriteHandler.h [new file with mode: 0644]
src/backend/rewrite/rewriteManip.c [new file with mode: 0644]
src/backend/rewrite/rewriteManip.h [new file with mode: 0644]
src/backend/rewrite/rewriteRemove.c [new file with mode: 0644]
src/backend/rewrite/rewriteRemove.h [new file with mode: 0644]
src/backend/rewrite/rewriteSupport.c [new file with mode: 0644]
src/backend/rewrite/rewriteSupport.h [new file with mode: 0644]
src/backend/storage/Makefile.inc [new file with mode: 0644]
src/backend/storage/backendid.h [new file with mode: 0644]
src/backend/storage/block.h [new file with mode: 0644]
src/backend/storage/buf.h [new file with mode: 0644]
src/backend/storage/buf_internals.h [new file with mode: 0644]
src/backend/storage/buffer/Makefile.inc [new file with mode: 0644]
src/backend/storage/buffer/buf_init.c [new file with mode: 0644]
src/backend/storage/buffer/buf_table.c [new file with mode: 0644]
src/backend/storage/buffer/bufmgr.c [new file with mode: 0644]
src/backend/storage/buffer/freelist.c [new file with mode: 0644]
src/backend/storage/buffer/localbuf.c [new file with mode: 0644]
src/backend/storage/bufmgr.h [new file with mode: 0644]
src/backend/storage/bufpage.h [new file with mode: 0644]
src/backend/storage/fd.h [new file with mode: 0644]
src/backend/storage/file/Makefile.inc [new file with mode: 0644]
src/backend/storage/file/fd.c [new file with mode: 0644]
src/backend/storage/ipc.h [new file with mode: 0644]
src/backend/storage/ipc/Makefile.inc [new file with mode: 0644]
src/backend/storage/ipc/README [new file with mode: 0644]
src/backend/storage/ipc/ipc.c [new file with mode: 0644]
src/backend/storage/ipc/ipci.c [new file with mode: 0644]
src/backend/storage/ipc/s_lock.c [new file with mode: 0644]
src/backend/storage/ipc/shmem.c [new file with mode: 0644]
src/backend/storage/ipc/shmqueue.c [new file with mode: 0644]
src/backend/storage/ipc/sinval.c [new file with mode: 0644]
src/backend/storage/ipc/sinvaladt.c [new file with mode: 0644]
src/backend/storage/ipc/spin.c [new file with mode: 0644]
src/backend/storage/item.h [new file with mode: 0644]
src/backend/storage/itemid.h [new file with mode: 0644]
src/backend/storage/itempos.h [new file with mode: 0644]
src/backend/storage/itemptr.h [new file with mode: 0644]
src/backend/storage/large_object.h [new file with mode: 0644]
src/backend/storage/large_object/Makefile.inc [new file with mode: 0644]
src/backend/storage/large_object/inv_api.c [new file with mode: 0644]
src/backend/storage/lmgr.h [new file with mode: 0644]
src/backend/storage/lmgr/Makefile.inc [new file with mode: 0644]
src/backend/storage/lmgr/README [new file with mode: 0644]
src/backend/storage/lmgr/lmgr.c [new file with mode: 0644]
src/backend/storage/lmgr/lock.c [new file with mode: 0644]
src/backend/storage/lmgr/multi.c [new file with mode: 0644]
src/backend/storage/lmgr/proc.c [new file with mode: 0644]
src/backend/storage/lmgr/single.c [new file with mode: 0644]
src/backend/storage/lock.h [new file with mode: 0644]
src/backend/storage/multilev.h [new file with mode: 0644]
src/backend/storage/off.h [new file with mode: 0644]
src/backend/storage/page.h [new file with mode: 0644]
src/backend/storage/page/Makefile.inc [new file with mode: 0644]
src/backend/storage/page/bufpage.c [new file with mode: 0644]
src/backend/storage/page/itemptr.c [new file with mode: 0644]
src/backend/storage/pagenum.h [new file with mode: 0644]
src/backend/storage/pos.h [new file with mode: 0644]
src/backend/storage/proc.h [new file with mode: 0644]
src/backend/storage/shmem.h [new file with mode: 0644]
src/backend/storage/sinval.h [new file with mode: 0644]
src/backend/storage/sinvaladt.h [new file with mode: 0644]
src/backend/storage/smgr.h [new file with mode: 0644]
src/backend/storage/smgr/Makefile.inc [new file with mode: 0644]
src/backend/storage/smgr/README [new file with mode: 0644]
src/backend/storage/smgr/md.c [new file with mode: 0644]
src/backend/storage/smgr/mm.c [new file with mode: 0644]
src/backend/storage/smgr/smgr.c [new file with mode: 0644]
src/backend/storage/smgr/smgrtype.c [new file with mode: 0644]
src/backend/storage/spin.h [new file with mode: 0644]
src/backend/tcop/Makefile.inc [new file with mode: 0644]
src/backend/tcop/aclchk.c [new file with mode: 0644]
src/backend/tcop/dest.c [new file with mode: 0644]
src/backend/tcop/dest.h [new file with mode: 0644]
src/backend/tcop/fastpath.c [new file with mode: 0644]
src/backend/tcop/fastpath.h [new file with mode: 0644]
src/backend/tcop/postgres.c [new file with mode: 0644]
src/backend/tcop/pquery.c [new file with mode: 0644]
src/backend/tcop/pquery.h [new file with mode: 0644]
src/backend/tcop/tcopdebug.h [new file with mode: 0644]
src/backend/tcop/tcopprot.h [new file with mode: 0644]
src/backend/tcop/utility.c [new file with mode: 0644]
src/backend/tcop/utility.h [new file with mode: 0644]
src/backend/tioga/Arr_TgRecipe.h [new file with mode: 0644]
src/backend/tioga/Makefile.inc [new file with mode: 0644]
src/backend/tioga/Varray.c [new file with mode: 0644]
src/backend/tioga/Varray.h [new file with mode: 0644]
src/backend/tioga/tgRecipe.c [new file with mode: 0644]
src/backend/tioga/tgRecipe.h [new file with mode: 0644]
src/backend/utils/Gen_fmgrtab.sh [new file with mode: 0644]
src/backend/utils/Makefile.inc [new file with mode: 0644]
src/backend/utils/acl.h [new file with mode: 0644]
src/backend/utils/adt/Makefile.inc [new file with mode: 0644]
src/backend/utils/adt/acl.c [new file with mode: 0644]
src/backend/utils/adt/arrayfuncs.c [new file with mode: 0644]
src/backend/utils/adt/arrayutils.c [new file with mode: 0644]
src/backend/utils/adt/bool.c [new file with mode: 0644]
src/backend/utils/adt/char.c [new file with mode: 0644]
src/backend/utils/adt/chunk.c [new file with mode: 0644]
src/backend/utils/adt/date.c [new file with mode: 0644]
src/backend/utils/adt/datetimes.c [new file with mode: 0644]
src/backend/utils/adt/datum.c [new file with mode: 0644]
src/backend/utils/adt/dt.c [new file with mode: 0644]
src/backend/utils/adt/filename.c [new file with mode: 0644]
src/backend/utils/adt/float.c [new file with mode: 0644]
src/backend/utils/adt/geo-ops.c [new file with mode: 0644]
src/backend/utils/adt/geo-selfuncs.c [new file with mode: 0644]
src/backend/utils/adt/int.c [new file with mode: 0644]
src/backend/utils/adt/like.c [new file with mode: 0644]
src/backend/utils/adt/misc.c [new file with mode: 0644]
src/backend/utils/adt/nabstime.c [new file with mode: 0644]
src/backend/utils/adt/name.c [new file with mode: 0644]
src/backend/utils/adt/not_in.c [new file with mode: 0644]
src/backend/utils/adt/numutils.c [new file with mode: 0644]
src/backend/utils/adt/oid.c [new file with mode: 0644]
src/backend/utils/adt/oidint2.c [new file with mode: 0644]
src/backend/utils/adt/oidint4.c [new file with mode: 0644]
src/backend/utils/adt/oidname.c [new file with mode: 0644]
src/backend/utils/adt/regexp.c [new file with mode: 0644]
src/backend/utils/adt/regproc.c [new file with mode: 0644]
src/backend/utils/adt/selfuncs.c [new file with mode: 0644]
src/backend/utils/adt/sets.c [new file with mode: 0644]
src/backend/utils/adt/tid.c [new file with mode: 0644]
src/backend/utils/adt/varchar.c [new file with mode: 0644]
src/backend/utils/adt/varlena.c [new file with mode: 0644]
src/backend/utils/array.h [new file with mode: 0644]
src/backend/utils/bit.h [new file with mode: 0644]
src/backend/utils/builtins.h [new file with mode: 0644]
src/backend/utils/cache/Makefile.inc [new file with mode: 0644]
src/backend/utils/cache/catcache.c [new file with mode: 0644]
src/backend/utils/cache/fcache.c [new file with mode: 0644]
src/backend/utils/cache/inval.c [new file with mode: 0644]
src/backend/utils/cache/lsyscache.c [new file with mode: 0644]
src/backend/utils/cache/rel.c [new file with mode: 0644]
src/backend/utils/cache/relcache.c [new file with mode: 0644]
src/backend/utils/cache/syscache.c [new file with mode: 0644]
src/backend/utils/catcache.h [new file with mode: 0644]
src/backend/utils/datum.h [new file with mode: 0644]
src/backend/utils/dynamic_loader.h [new file with mode: 0644]
src/backend/utils/elog.h [new file with mode: 0644]
src/backend/utils/error/Makefile.inc [new file with mode: 0644]
src/backend/utils/error/assert.c [new file with mode: 0644]
src/backend/utils/error/elog.c [new file with mode: 0644]
src/backend/utils/error/exc.c [new file with mode: 0644]
src/backend/utils/error/excabort.c [new file with mode: 0644]
src/backend/utils/error/excid.c [new file with mode: 0644]
src/backend/utils/error/format.c [new file with mode: 0644]
src/backend/utils/exc.h [new file with mode: 0644]
src/backend/utils/excid.h [new file with mode: 0644]
src/backend/utils/fcache.h [new file with mode: 0644]
src/backend/utils/fcache2.h [new file with mode: 0644]
src/backend/utils/fmgr/Makefile.inc [new file with mode: 0644]
src/backend/utils/fmgr/dfmgr.c [new file with mode: 0644]
src/backend/utils/fmgr/fmgr.c [new file with mode: 0644]
src/backend/utils/fmgrtab.h [new file with mode: 0644]
src/backend/utils/geo-decls.h [new file with mode: 0644]
src/backend/utils/hash/Makefile.inc [new file with mode: 0644]
src/backend/utils/hash/dynahash.c [new file with mode: 0644]
src/backend/utils/hash/hashfn.c [new file with mode: 0644]
src/backend/utils/hsearch.h [new file with mode: 0644]
src/backend/utils/init/Makefile.inc [new file with mode: 0644]
src/backend/utils/init/enbl.c [new file with mode: 0644]
src/backend/utils/init/findbe.c [new file with mode: 0644]
src/backend/utils/init/globals.c [new file with mode: 0644]
src/backend/utils/init/magic.c [new file with mode: 0644]
src/backend/utils/init/miscinit.c [new file with mode: 0644]
src/backend/utils/init/postinit.c [new file with mode: 0644]
src/backend/utils/inval.h [new file with mode: 0644]
src/backend/utils/lselect.h [new file with mode: 0644]
src/backend/utils/lsyscache.h [new file with mode: 0644]
src/backend/utils/mcxt.h [new file with mode: 0644]
src/backend/utils/memutils.h [new file with mode: 0644]
src/backend/utils/mmgr/Makefile.inc [new file with mode: 0644]
src/backend/utils/mmgr/aset.c [new file with mode: 0644]
src/backend/utils/mmgr/mcxt.c [new file with mode: 0644]
src/backend/utils/mmgr/oset.c [new file with mode: 0644]
src/backend/utils/mmgr/palloc.c [new file with mode: 0644]
src/backend/utils/mmgr/portalmem.c [new file with mode: 0644]
src/backend/utils/module.h [new file with mode: 0644]
src/backend/utils/nabstime.h [new file with mode: 0644]
src/backend/utils/oidcompos.h [new file with mode: 0644]
src/backend/utils/palloc.h [new file with mode: 0644]
src/backend/utils/portal.h [new file with mode: 0644]
src/backend/utils/psort.h [new file with mode: 0644]
src/backend/utils/rel.h [new file with mode: 0644]
src/backend/utils/rel2.h [new file with mode: 0644]
src/backend/utils/relcache.h [new file with mode: 0644]
src/backend/utils/sets.h [new file with mode: 0644]
src/backend/utils/sort/Makefile.inc [new file with mode: 0644]
src/backend/utils/sort/lselect.c [new file with mode: 0644]
src/backend/utils/sort/psort.c [new file with mode: 0644]
src/backend/utils/syscache.h [new file with mode: 0644]
src/backend/utils/time/Makefile.inc [new file with mode: 0644]
src/backend/utils/time/tqual.c [new file with mode: 0644]
src/backend/utils/tqual.h [new file with mode: 0644]
src/bin/Makefile [new file with mode: 0644]
src/bin/Makefile.global [new file with mode: 0644]
src/bin/cleardbdir/Makefile [new file with mode: 0644]
src/bin/cleardbdir/cleardbdir.sh [new file with mode: 0644]
src/bin/createdb/Makefile [new file with mode: 0644]
src/bin/createdb/createdb.sh [new file with mode: 0644]
src/bin/createuser/Makefile [new file with mode: 0644]
src/bin/createuser/createuser.sh [new file with mode: 0644]
src/bin/destroydb/Makefile [new file with mode: 0644]
src/bin/destroydb/destroydb.sh [new file with mode: 0644]
src/bin/destroyuser/Makefile [new file with mode: 0644]
src/bin/destroyuser/destroyuser.sh [new file with mode: 0644]
src/bin/initdb/Makefile [new file with mode: 0644]
src/bin/initdb/initdb.sh [new file with mode: 0644]
src/bin/ipcclean/Makefile [new file with mode: 0644]
src/bin/ipcclean/ipcclean.sh [new file with mode: 0644]
src/bin/monitor/Makefile [new file with mode: 0644]
src/bin/monitor/monitor.c [new file with mode: 0644]
src/bin/pg4_dump/Makefile [new file with mode: 0644]
src/bin/pg4_dump/README [new file with mode: 0644]
src/bin/pg4_dump/common.c [new file with mode: 0644]
src/bin/pg4_dump/pg4_dump.c [new file with mode: 0644]
src/bin/pg4_dump/pg_dump.h [new file with mode: 0644]
src/bin/pg_dump/Makefile [new file with mode: 0644]
src/bin/pg_dump/README [new file with mode: 0644]
src/bin/pg_dump/common.c [new file with mode: 0644]
src/bin/pg_dump/pg_dump.c [new file with mode: 0644]
src/bin/pg_dump/pg_dump.h [new file with mode: 0644]
src/bin/pg_id/Makefile [new file with mode: 0644]
src/bin/pg_id/pg_id.c [new file with mode: 0644]
src/bin/pg_version/Makefile [new file with mode: 0644]
src/bin/pg_version/pg_version.c [new file with mode: 0644]
src/bin/pgtclsh/Makefile [new file with mode: 0644]
src/bin/pgtclsh/README [new file with mode: 0644]
src/bin/pgtclsh/pgtclAppInit.c [new file with mode: 0644]
src/bin/pgtclsh/pgtclUtils.tcl [new file with mode: 0644]
src/bin/pgtclsh/pgtkAppInit.c [new file with mode: 0644]
src/bin/pgtclsh/updateStats.tcl [new file with mode: 0644]
src/bin/psql/Makefile [new file with mode: 0644]
src/bin/psql/psql.c [new file with mode: 0644]
src/bin/psql/psqlHelp.h [new file with mode: 0644]
src/bin/psql/rlstubs.c [new file with mode: 0644]
src/bin/psql/stringutils.c [new file with mode: 0644]
src/bin/psql/stringutils.h [new file with mode: 0644]
src/interfaces/libpgtcl/Makefile [new file with mode: 0644]
src/interfaces/libpgtcl/README [new file with mode: 0644]
src/interfaces/libpgtcl/libpgtcl.h [new file with mode: 0644]
src/interfaces/libpgtcl/pgtcl.c [new file with mode: 0644]
src/interfaces/libpgtcl/pgtclCmds.c [new file with mode: 0644]
src/interfaces/libpgtcl/pgtclCmds.h [new file with mode: 0644]
src/interfaces/libpgtcl/pgtclId.c [new file with mode: 0644]
src/interfaces/libpgtcl/pgtclId.h [new file with mode: 0644]
src/interfaces/libpq++/Makefile [new file with mode: 0644]
src/interfaces/libpq++/README [new file with mode: 0644]
src/interfaces/libpq++/examples/Makefile [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq0.cc [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq1.cc [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq2.cc [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq2.sql [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq3.cc [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq3.sql [new file with mode: 0644]
src/interfaces/libpq++/examples/testlibpq4.cc [new file with mode: 0644]
src/interfaces/libpq++/examples/testlo.cc [new file with mode: 0644]
src/interfaces/libpq++/libpq++.H [new file with mode: 0644]
src/interfaces/libpq++/man/libpq++.3 [new file with mode: 0644]
src/interfaces/libpq++/pgconnection.cc [new file with mode: 0644]
src/interfaces/libpq++/pgenv.cc [new file with mode: 0644]
src/interfaces/libpq++/pglobject.cc [new file with mode: 0644]
src/interfaces/libpq/Makefile [new file with mode: 0644]
src/interfaces/libpq/README [new file with mode: 0644]
src/interfaces/libpq/fe-auth.c [new file with mode: 0644]
src/interfaces/libpq/fe-auth.h [new file with mode: 0644]
src/interfaces/libpq/fe-connect.c [new file with mode: 0644]
src/interfaces/libpq/fe-exec.c [new file with mode: 0644]
src/interfaces/libpq/fe-lobj.c [new file with mode: 0644]
src/interfaces/libpq/fe-misc.c [new file with mode: 0644]
src/interfaces/libpq/libpq-fe.h [new file with mode: 0644]
src/interfaces/libpq/pg_hba [new file with mode: 0644]
src/interfaces/libpq/pqsignal.c [new file with mode: 0644]
src/interfaces/libpq/pqsignal.h [new file with mode: 0644]
src/mk/port/postgres.mk.BSD44_derived [new file with mode: 0644]
src/mk/port/postgres.mk.aix [new file with mode: 0644]
src/mk/port/postgres.mk.alpha [new file with mode: 0644]
src/mk/port/postgres.mk.bsdi [new file with mode: 0644]
src/mk/port/postgres.mk.hpux [new file with mode: 0644]
src/mk/port/postgres.mk.irix5 [new file with mode: 0644]
src/mk/port/postgres.mk.linux [new file with mode: 0644]
src/mk/port/postgres.mk.sparc [new file with mode: 0644]
src/mk/port/postgres.mk.sparc_solaris [new file with mode: 0644]
src/mk/port/postgres.mk.svr4 [new file with mode: 0644]
src/mk/port/postgres.mk.ultrix4 [new file with mode: 0644]
src/mk/postgres.lib.mk [new file with mode: 0644]
src/mk/postgres.mk [new file with mode: 0644]
src/mk/postgres.prog.mk [new file with mode: 0644]
src/mk/postgres.shell.mk [new file with mode: 0644]
src/mk/postgres.subdir.mk [new file with mode: 0644]
src/mk/postgres.user.mk [new file with mode: 0644]
src/test/Makefile [new file with mode: 0644]
src/test/bench/Makefile [new file with mode: 0644]
src/test/bench/WISC-README [new file with mode: 0644]
src/test/bench/create.sh [new file with mode: 0755]
src/test/bench/create.source [new file with mode: 0644]
src/test/bench/perquery [new file with mode: 0644]
src/test/bench/query01 [new file with mode: 0644]
src/test/bench/query02 [new file with mode: 0644]
src/test/bench/query03 [new file with mode: 0644]
src/test/bench/query04 [new file with mode: 0644]
src/test/bench/query05 [new file with mode: 0644]
src/test/bench/query06 [new file with mode: 0644]
src/test/bench/query07 [new file with mode: 0644]
src/test/bench/query08 [new file with mode: 0644]
src/test/bench/query09 [new file with mode: 0644]
src/test/bench/query10 [new file with mode: 0644]
src/test/bench/query11 [new file with mode: 0644]
src/test/bench/query12 [new file with mode: 0644]
src/test/bench/query13 [new file with mode: 0644]
src/test/bench/query14 [new file with mode: 0644]
src/test/bench/query15 [new file with mode: 0644]
src/test/bench/query16 [new file with mode: 0644]
src/test/bench/query17 [new file with mode: 0644]
src/test/bench/query18 [new file with mode: 0644]
src/test/bench/query19 [new file with mode: 0644]
src/test/bench/query20 [new file with mode: 0644]
src/test/bench/query21 [new file with mode: 0644]
src/test/bench/query22 [new file with mode: 0644]
src/test/bench/query23 [new file with mode: 0644]
src/test/bench/query24 [new file with mode: 0644]
src/test/bench/query25 [new file with mode: 0644]
src/test/bench/query26 [new file with mode: 0644]
src/test/bench/query27 [new file with mode: 0644]
src/test/bench/query28 [new file with mode: 0644]
src/test/bench/query29 [new file with mode: 0644]
src/test/bench/query30 [new file with mode: 0644]
src/test/bench/query31 [new file with mode: 0644]
src/test/bench/query32 [new file with mode: 0644]
src/test/bench/runwisc.sh [new file with mode: 0755]
src/test/bench/wholebench.sh [new file with mode: 0755]
src/test/examples/Makefile [new file with mode: 0644]
src/test/examples/testlibpq.c [new file with mode: 0644]
src/test/examples/testlibpq2.c [new file with mode: 0644]
src/test/examples/testlibpq2.sql [new file with mode: 0644]
src/test/examples/testlibpq3.c [new file with mode: 0644]
src/test/examples/testlibpq3.sql [new file with mode: 0644]
src/test/examples/testlibpq4.c [new file with mode: 0644]
src/test/examples/testlo.c [new file with mode: 0644]
src/test/examples/testlo2.c [new file with mode: 0644]
src/test/regress/Makefile [new file with mode: 0644]
src/test/regress/create.source [new file with mode: 0644]
src/test/regress/data/dept.data [new file with mode: 0644]
src/test/regress/data/desc.data [new file with mode: 0644]
src/test/regress/data/emp.data [new file with mode: 0644]
src/test/regress/data/hash.data [new file with mode: 0644]
src/test/regress/data/onek.data [new file with mode: 0644]
src/test/regress/data/person.data [new file with mode: 0644]
src/test/regress/data/real_city.data [new file with mode: 0644]
src/test/regress/data/rect.data [new file with mode: 0644]
src/test/regress/data/streets.data [new file with mode: 0644]
src/test/regress/data/stud_emp.data [new file with mode: 0644]
src/test/regress/data/student.data [new file with mode: 0644]
src/test/regress/data/tenk.data [new file with mode: 0644]
src/test/regress/destroy.source [new file with mode: 0644]
src/test/regress/errors.source [new file with mode: 0644]
src/test/regress/queries.source [new file with mode: 0644]
src/test/regress/regress.c [new file with mode: 0644]
src/test/regress/regress.sh [new file with mode: 0755]
src/test/regress/sample.regress.out [new file with mode: 0644]
src/test/regress/security.source [new file with mode: 0644]
src/test/suite/README [new file with mode: 0644]
src/test/suite/agg.sql [new file with mode: 0644]
src/test/suite/date.sql [new file with mode: 0644]
src/test/suite/float.sql [new file with mode: 0644]
src/test/suite/group.sql [new file with mode: 0644]
src/test/suite/group_err.sql [new file with mode: 0644]
src/test/suite/inh.sql [new file with mode: 0644]
src/test/suite/join.sql [new file with mode: 0644]
src/test/suite/oper.sql [new file with mode: 0644]
src/test/suite/parse.sql [new file with mode: 0644]
src/test/suite/quote.sql [new file with mode: 0644]
src/test/suite/results/agg.sql.out [new file with mode: 0644]
src/test/suite/results/date.sql.out [new file with mode: 0644]
src/test/suite/results/float.sql.out [new file with mode: 0644]
src/test/suite/results/group.sql.out [new file with mode: 0644]
src/test/suite/results/group_err.sql.out [new file with mode: 0644]
src/test/suite/results/inh.sql.out [new file with mode: 0644]
src/test/suite/results/join.sql.out [new file with mode: 0644]
src/test/suite/results/oper.sql.out [new file with mode: 0644]
src/test/suite/results/parse.sql.out [new file with mode: 0644]
src/test/suite/results/quote.sql.out [new file with mode: 0644]
src/test/suite/results/rules.sql.out [new file with mode: 0644]
src/test/suite/results/select.sql.out [new file with mode: 0644]
src/test/suite/results/sort.sql.out [new file with mode: 0644]
src/test/suite/results/sqlcompat.sql.out [new file with mode: 0644]
src/test/suite/results/time.sql.out [new file with mode: 0644]
src/test/suite/results/varchar.sql.out [new file with mode: 0644]
src/test/suite/results/views.sql.out [new file with mode: 0644]
src/test/suite/rules.sql [new file with mode: 0644]
src/test/suite/runall [new file with mode: 0755]
src/test/suite/select.sql [new file with mode: 0644]
src/test/suite/sort.sql [new file with mode: 0644]
src/test/suite/sqlcompat.sql [new file with mode: 0644]
src/test/suite/time.sql [new file with mode: 0644]
src/test/suite/varchar.sql [new file with mode: 0644]
src/test/suite/views.sql [new file with mode: 0644]
src/tools/mkldexport/Makefile [new file with mode: 0644]
src/tools/mkldexport/README [new file with mode: 0644]
src/tools/mkldexport/mkldexport.sh [new file with mode: 0644]
src/tutorial/C-code/beard.c [new file with mode: 0644]
src/tutorial/C-code/complex.c [new file with mode: 0644]
src/tutorial/C-code/funcs.c [new file with mode: 0644]
src/tutorial/Makefile [new file with mode: 0644]
src/tutorial/README [new file with mode: 0644]
src/tutorial/advanced.source [new file with mode: 0644]
src/tutorial/basics.source [new file with mode: 0644]
src/tutorial/complex.source [new file with mode: 0644]
src/tutorial/funcs.source [new file with mode: 0644]
src/tutorial/syscat.source [new file with mode: 0644]

diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..7e047c0
--- /dev/null
@@ -0,0 +1,48 @@
+#-------------------------------------------------------------------------
+#
+# Makefile.inc--
+#    Build and install postgres.
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+#
+# IDENTIFICATION
+#    $Header: /cvsroot/pgsql/src/Makefile,v 1.1.1.1 1996/07/09 06:21:07 scrappy Exp $
+#
+# NOTES
+#  objdir  - location of the objects and generated files (eg. obj)
+#
+#-------------------------------------------------------------------------
+
+SUBDIR= backend libpq bin
+
+FIND = find
+# assuming gnu tar and split here
+TAR  = tar
+SPLIT = split
+
+ETAGS = etags
+XARGS = xargs
+
+ifeq ($(USE_TCL), true)
+SUBDIR += libpgtcl
+endif
+
+include mk/postgres.subdir.mk
+
+TAGS:
+   rm -f TAGS; \
+   for i in backend libpq bin; do \
+     $(FIND) $$i -name '*.[chyl]' -print | $(XARGS) $(ETAGS) -a ; \
+   done
+
+# target to generate a backup tar file and split files that can be 
+# saved to 1.44M floppy
+BACKUP:
+   rm -f BACKUP.filelist BACKUP.tgz; \
+   $(FIND) . -not -path '*obj/*' -not -path '*data/*' -type f -print > BACKUP.filelist; \
+   $(TAR) --files-from BACKUP.filelist -c -z -v -f BACKUP.tgz
+   $(SPLIT) --bytes=1400k BACKUP.tgz pgBACKUP. 
+
+.PHONY: TAGS
+.PHONY: BACKUP
diff --git a/src/Makefile.global b/src/Makefile.global
new file mode 100644 (file)
index 0000000..1ecd62a
--- /dev/null
@@ -0,0 +1,306 @@
+#-------------------------------------------------------------------------
+#
+# Makefile.global--
+#    global configuration for the Makefiles
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+#
+# IDENTIFICATION
+#    $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.1.1.1 1996/07/09 06:21:07 scrappy Exp $
+#
+# NOTES
+#    This is seen by any Makefiles that include mk/postgres.mk. To
+#    override the default setting, create a Makefile.custom in this
+#    directory and put your defines there. (Makefile.custom is included
+#    at the end of this file.)
+#
+#    If you change any of these defines you probably have to 
+#  gmake clean; gmake
+#    since no dependecies are created for these. (of course you can 
+#    be crafty and check what files really depend on them and just remake
+#    those).
+#
+#-------------------------------------------------------------------------
+
+
+##############################################################################
+#
+# CONFIGURATION SECTION
+#
+# Following are settings pertaining to the postgres build and 
+# installation.  The most important one is obviously the name 
+# of the port.
+
+#  The name of the port.  Valid choices are:
+#  alpha       -   DEC Alpha AXP on OSF/1 2.0
+#  hpux        -   HP PA-RISC on HP-UX 9.0
+#  sparc_solaris   -   SUN SPARC on Solaris 2.4
+#  sparc       -   SUN SPARC on SunOS 4.1.3
+#  ultrix4     -   DEC MIPS on Ultrix 4.4
+#  linux       -   Intel x86 on Linux 1.2 and Linux ELF
+#              (For non-ELF Linux, you need to comment out 
+#              "LINUX_ELF=1" in src/mk/port/postgres.mk.linux)
+#  BSD44_derived   -   OSs derived from 4.4-lite BSD (NetBSD, FreeBSD)
+#       bsdi            -       BSD/OS 2.0 and 2.01
+#  aix     -   IBM on AIX 3.2.5
+#  irix5       -   SGI MIPS on IRIX 5.3
+#  Some hooks are provided for
+#  svr4        -   Intel x86 on Intel SVR4
+#  next        -   Motorola MC68K or Intel x86 on NeXTSTEP 3.2
+#  but these are guaranteed not to work as of yet.
+#
+#  XXX Note that you MUST set PORTNAME here (or on the command line) so 
+#  that port-dependent variables are correctly set within this file.
+#  Makefile.custom does not take effect (for ifeq purposes) 
+#  until after this file is processed!
+#  make sure that you have no whitespaces after the PORTNAME setting
+#  or the makefiles can get confused
+PORTNAME=  alpha
+
+# POSTGRESLOGIN is the login name of the user who gets special
+# privileges within the database.  By default it is "postgres", but
+# you can change it to any existing login name (such as your own 
+# login if you are compiling a private version or don't have root
+# access).
+POSTGRESLOGIN= postgres
+
+# For convenience, POSTGRESDIR is where DATADIR, BINDIR, and LIBDIR 
+# and other target destinations are rooted.  Of course, each of these is 
+# changable separately.
+POSTGRESDIR=   /private/postgres95
+
+# SRCDIR specifies where the source files are.
+SRCDIR=        $(POSTGRESDIR)/src
+
+# DATADIR specifies where the postmaster expects to find its database.
+# This may be overridden by command line options or the PGDATA environment
+# variable.
+DATADIR=   $(POSTGRESDIR)/data
+
+# Where the postgres executables live (changeable by just putting them
+# somewhere else and putting that directory in your shell PATH)
+BINDIR=        $(POSTGRESDIR)/bin
+
+# Where libpq.a gets installed.  You must put it where your loader will
+# look for it if you wish to use the -lpq convention.  Otherwise you
+# can just put the absolute pathname to the library at the end of your
+# command line.
+LIBDIR=        $(POSTGRESDIR)/lib
+
+# This is the directory where IPC utilities ipcs and ipcrm are located
+#
+IPCSDIR=   /usr/bin
+
+# Where the man pages (suitable for use with "man") get installed.
+POSTMANDIR=    $(POSTGRESDIR)/man
+
+# Where the formatted documents (e.g., the reference manual) get installed.
+POSTDOCDIR=    $(POSTGRESDIR)/doc
+
+# Where the header files necessary to build frontend programs get installed.
+HEADERDIR= $(POSTGRESDIR)/include
+
+# NAMEDATALEN is the max length for system identifiers (e.g. table names, 
+# attribute names, function names, etc.)  
+#
+# These MUST be set here.  DO NOT COMMENT THESE OUT
+# Setting these too high will result in excess space usage for system catalogs
+# Setting them too low will make the system unusable.
+# values between 16 and 64 that are multiples of four are recommended.
+#
+# NOTE also that databases with different NAMEDATALEN's cannot interoperate!
+#
+NAMEDATALEN = 32
+# OIDNAMELEN should be set to NAMEDATALEN + sizeof(Oid)
+OIDNAMELEN = 36
+
+CFLAGS+= -DNAMEDATALEN=$(NAMEDATALEN) -DOIDNAMELEN=$(OIDNAMELEN)
+
+##############################################################################
+#
+# FEATURES 
+#
+# To disable a feature, comment out the entire definition
+# (that is, prepend '#', don't set it to "0" or "no").
+
+# Comment out ENFORCE_ALIGNMENT if you do NOT want unaligned access to
+# multi-byte types to generate a bus error.
+ENFORCE_ALIGNMENT= true
+
+# Comment out CDEBUG to turn off debugging and sanity-checking.
+#
+#  XXX on MIPS, use -g3 if you want to compile with -O
+CDEBUG= -g
+
+# turn this on if you prefer European style dates instead of American
+# style dates
+# EUROPEAN_DATES = 1
+
+# Comment out PROFILE to disable profiling.
+#
+#  XXX define on MIPS if you want to be able to use pixie.
+#      note that this disables dynamic loading!
+#PROFILE= -p -non_shared
+
+# About the use of readline in psql:
+#    psql does not require the GNU readline and history libraries. Hence, we
+#    do not compile with them by default. However, there are hooks in the
+#    program which supports the use of GNU readline and history. Should you
+#    decide to use them, change USE_READLINE to true and change READLINE_INCDIR
+#    and READLINE_LIBDIR to reflect the location of the readline and histroy
+#    headers and libraries.
+#
+#USE_READLINE= true
+
+# directories for the readline and history libraries.
+READLINE_INCDIR=  /usr/local/include
+HISTORY_INCDIR=   /usr/local/include
+READLINE_LIBDIR=  /usr/local/lib
+HISTORY_LIBDIR=   /usr/local/lib
+
+# If you do not plan to use Host based authentication,
+# comment out the following line
+HBA = 1
+ifdef HBA
+HBAFLAGS= -DHBA
+endif
+
+
+
+# If you plan to use Kerberos for authentication...
+#
+# Comment out KRBVERS if you do not use Kerberos.
+#  Set KRBVERS to "4" for Kerberos v4, "5" for Kerberos v5.
+#  XXX Edit the default Kerberos variables below!
+#
+#KRBVERS=  5
+
+
+# Globally pass Kerberos file locations.
+#  these are used in the postmaster and all libpq applications.
+#
+#  Adjust KRBINCS and KRBLIBS to reflect where you have Kerberos
+#      include files and libraries installed.
+#  PG_KRB_SRVNAM is the name under which POSTGRES is registered in
+#      the Kerberos database (KDC).
+#  PG_KRB_SRVTAB is the location of the server's keytab file.
+#
+ifdef KRBVERS
+KRBINCS= -I/usr/athena/include
+KRBLIBS= -L/usr/athena/lib
+KRBFLAGS+= $(KRBINCS) -DPG_KRB_SRVNAM='"postgres_dbms"'
+   ifeq ($(KRBVERS), 4)
+KRBFLAGS+= -DKRB4
+KRBFLAGS+= -DPG_KRB_SRVTAB='"/etc/srvtab"'
+KRBLIBS+= -lkrb -ldes
+   else
+   ifeq ($(KRBVERS), 5)
+KRBFLAGS+= -DKRB5
+KRBFLAGS+= -DPG_KRB_SRVTAB='"FILE:/krb5/srvtab.postgres"'
+KRBLIBS+= -lkrb5 -lcrypto -lcom_err -lisode
+   endif
+   endif
+endif
+
+#
+# location of Tcl/Tk headers and libraries
+#
+# Uncomment this to build the tcl utilities.
+USE_TCL= true
+# customize these to your site's needs
+#
+TCL_INCDIR= /usr/local/devel/tcl7.4/include
+TCL_LIBDIR= /usr/local/devel/tcl7.4/lib
+TCL_LIB = -ltcl7.4
+TK_INCDIR=  /usr/local/devel/tk4.0/include
+TK_LIBDIR=  /usr/local/devel/tk4.0/lib
+TK_LIB = -ltk4.0
+
+#
+# include port specific rules and variables. For instance:
+#
+# signal(2) handling - this is here because it affects some of 
+# the frontend commands as well as the backend server.
+#
+# Ultrix and SunOS provide BSD signal(2) semantics by default.
+#
+# SVID2 and POSIX signal(2) semantics differ from BSD signal(2) 
+# semantics.  We can use the POSIX sigaction(2) on systems that
+# allow us to request restartable signals (SA_RESTART).
+#
+# Some systems don't allow restartable signals at all unless we 
+# link to a special BSD library.
+#
+# We devoutly hope that there aren't any systems that provide
+# neither POSIX signals nor BSD signals.  The alternative 
+# is to do signal-handler reinstallation, which doesn't work well 
+# at all.
+#
+-include $(MKDIR)/port/postgres.mk.$(PORTNAME)
+
+##############################################################################
+#
+# Flags for CC and LD. (depend on CDEBUG and PROFILE)
+#
+
+# Globally pass debugging/optimization/profiling flags based
+# on the options selected above.
+ifdef CDEBUG
+   CFLAGS+= $(CDEBUG)
+   LDFLAGS+= $(CDEBUG)
+else
+   ifndef CFLAGS_OPT
+      CFLAGS_OPT= -O
+   endif
+   CFLAGS+= $(CFLAGS_OPT)
+#
+# Uncommenting this will make things go a LOT faster, but you will
+# also lose a lot of useful error-checking.
+#
+   CFLAGS+= -DNO_ASSERT_CHECKING
+endif
+
+ifdef PROFILE
+CFLAGS+= $(PROFILE)
+LDFLAGS+= $(PROFILE)
+endif
+
+# Globally pass PORTNAME
+CFLAGS+= -DPORTNAME_$(PORTNAME)
+
+# Globally pass the default TCP port for postmaster(1).
+CFLAGS+= -DPOSTPORT='"5432"'
+
+# include flags from mk/port/postgres.mk.$(PORTNAME)
+CFLAGS+= $(CFLAGS_BE)
+LDADD+= $(LDADD_BE)
+LDFLAGS+= $(LDFLAGS_BE)
+
+
+##############################################################################
+#
+# Miscellaneous configuration
+#
+
+# This is the time, in seconds, at which a given backend server
+# will wait on a lock before deciding to abort the transaction
+# (this is what we do in lieu of deadlock detection).
+#
+# Low numbers are not recommended as they will tend to cause
+# false aborts if many transactions are long-lived.
+CFLAGS+= -DDEADLOCK_TIMEOUT=60
+
+srcdir=        $(SRCDIR)
+includedir=    $(HEADERDIR)
+objdir=        obj
+
+
+##############################################################################
+#
+# Customization.
+#
+-include $(MKDIR)/../Makefile.custom
+
+
diff --git a/src/backend/Makefile b/src/backend/Makefile
new file mode 100644 (file)
index 0000000..4cdc7ad
--- /dev/null
@@ -0,0 +1,289 @@
+#-------------------------------------------------------------------------
+#
+# Makefile--
+#    Makefile for the postgres backend (and the postmaster)
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+#
+# IDENTIFICATION
+#    $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
+#
+#-------------------------------------------------------------------------
+
+#
+# The following turns on intermediate linking of partial objects to speed
+# the link cycle during development. (To turn this off, put "BIGOBJS=false"
+# in your custom makefile, ../Makefile.custom.)
+BIGOBJS= true
+
+
+PROG=  postgres
+
+MKDIR= ../mk
+include $(MKDIR)/postgres.mk
+
+
+include $(CURDIR)/access/Makefile.inc
+include $(CURDIR)/bootstrap/Makefile.inc
+include $(CURDIR)/catalog/Makefile.inc
+include $(CURDIR)/commands/Makefile.inc
+include $(CURDIR)/executor/Makefile.inc
+include $(CURDIR)/include/Makefile.inc
+include $(CURDIR)/lib/Makefile.inc
+include $(CURDIR)/libpq/Makefile.inc
+include $(CURDIR)/main/Makefile.inc
+include $(CURDIR)/nodes/Makefile.inc
+include $(CURDIR)/optimizer/Makefile.inc
+include $(CURDIR)/parser/Makefile.inc
+include $(CURDIR)/port/Makefile.inc
+include $(CURDIR)/postmaster/Makefile.inc
+include $(CURDIR)/regex/Makefile.inc
+include $(CURDIR)/rewrite/Makefile.inc
+include $(CURDIR)/storage/Makefile.inc
+include $(CURDIR)/tcop/Makefile.inc
+include $(CURDIR)/tioga/Makefile.inc
+include $(CURDIR)/utils/Makefile.inc
+
+SRCS:= ${SRCS_ACCESS} ${SRCS_BOOTSTRAP} $(SRCS_CATALOG) ${SRCS_COMMANDS} \
+   ${SRCS_EXECUTOR} $(SRCS_LIB) $(SRCS_LIBPQ) ${SRCS_MAIN} \
+   ${SRCS_NODES} ${SRCS_OPTIMIZER} ${SRCS_PARSER} ${SRCS_PORT} \
+   $(SRCS_POSTMASTER) ${SRCS_REGEX} ${SRCS_REWRITE} ${SRCS_STORAGE} \
+   ${SRCS_TCOP} ${SRCS_UTILS} 
+
+ifeq ($(BIGOBJS), true)
+OBJS= ACCESS.o BOOTSTRAP.o COMMANDS.o EXECUTOR.o MAIN.o MISC.o NODES.o \
+   PARSER.o OPTIMIZER.o REGEX.o REWRITE.o STORAGE.o TCOP.o UTILS.o
+CLEANFILES+= $(subst .s,.o,$(SRCS:.c=.o)) $(OBJS)
+else
+OBJS:= $(subst .s,.o,$(SRCS:%.c=$(objdir)/%.o))
+CLEANFILES+= $(notdir $(OBJS))
+endif
+
+#############################################################################
+#
+# TIOGA stuff
+#
+ifdef TIOGA
+SRCS+= $(SRCS_TIOGA) 
+   ifeq ($(BIGOBJS), true)
+TIOGA.o:   $(SRCS_TIOGA:%.c=$(objdir)/%.o)
+   $(make_partial)
+OBJS+= TIOGA.o
+CLEANFILES+= $(SRCS_TIOGA:%.c=%.o) TIOGA.o
+   else
+OBJS+= $(SRCS_TIOGA:%.c=$(objdir)/%.o)
+   endif
+endif
+
+
+#############################################################################
+#
+# Compiling the postgres backend.
+#
+CFLAGS+=  -DPOSTGRESDIR='"$(POSTGRESDIR)"' \
+   -DPGDATADIR='"$(DATADIR)"' \
+   -I$(CURDIR)/. -I$(CURDIR)/$(objdir) \
+   -I$(CURDIR)/include \
+   -I$(CURDIR)/port/$(PORTNAME)
+
+# turn this on if you prefer European style dates instead of American
+# style dates
+ifdef EUROPEAN_DATES
+CFLAGS += -DEUROPEAN_STYLE
+endif
+
+# kerberos flags
+ifdef KRBVERS
+CFLAGS+= $(KRBFLAGS)
+LDADD+= $(KRBLIBS)
+endif
+
+# host based access flags
+ifdef HBA
+CFLAGS+= $(HBAFLAGS)
+endif
+
+
+#
+# All systems except NEXTSTEP require the math library.
+# Loader flags for system-dependent libraries are appended in
+#  src/backend/port/$(PORTNAME)/Makefile.inc
+#
+ifneq ($(PORTNAME), next)
+LDADD+=    -lm
+endif
+
+# statically link in libc for linux
+ifeq ($(PORTNAME), linux)
+LDADD+= -lc
+endif
+
+postgres: $(POSTGRES_DEPEND) $(OBJS) $(EXPORTS)
+   $(CC) $(LDFLAGS) -o $(objdir)/$(@F) $(addprefix $(objdir)/,$(notdir $(OBJS))) $(LDADD)
+
+# Make this target first if you are doing a parallel make.
+# The targets in 'first' need to be made sequentially because of dependencies.
+# Then, you can make 'all' with parallelism turned on.
+first: $(POSTGRES_DEPEND)
+
+
+#############################################################################
+#
+# Partial objects for platforms with slow linkers.
+#
+ifeq ($(BIGOBJS), true)
+
+OBJS_ACCESS:=     $(SRCS_ACCESS:%.c=$(objdir)/%.o)
+OBJS_BOOTSTRAP:=   $(SRCS_BOOTSTRAP:%.c=$(objdir)/%.o)
+OBJS_CATALOG:=    $(SRCS_CATALOG:%.c=$(objdir)/%.o)
+OBJS_COMMANDS:=       $(SRCS_COMMANDS:%.c=$(objdir)/%.o)
+OBJS_EXECUTOR:=       $(SRCS_EXECUTOR:%.c=$(objdir)/%.o)
+OBJS_MAIN:=       $(SRCS_MAIN:%.c=$(objdir)/%.o)
+OBJS_POSTMASTER:=  $(SRCS_POSTMASTER:%.c=$(objdir)/%.o)
+OBJS_LIB:=    $(SRCS_LIB:%.c=$(objdir)/%.o)
+OBJS_LIBPQ:=      $(SRCS_LIBPQ:%.c=$(objdir)/%.o)
+OBJS_PORT:=       $(addprefix $(objdir)/,$(subst .s,.o,$(SRCS_PORT:.c=.o)))
+OBJS_NODES:=      $(SRCS_NODES:%.c=$(objdir)/%.o)
+OBJS_PARSER:=     $(SRCS_PARSER:%.c=$(objdir)/%.o)
+OBJS_OPTIMIZER:=   $(SRCS_OPTIMIZER:%.c=$(objdir)/%.o)
+OBJS_REGEX:=      $(SRCS_REGEX:%.c=$(objdir)/%.o)
+OBJS_REWRITE:=    $(SRCS_REWRITE:%.c=$(objdir)/%.o)
+OBJS_STORAGE:=    $(SRCS_STORAGE:%.c=$(objdir)/%.o)
+OBJS_TCOP:=       $(SRCS_TCOP:%.c=$(objdir)/%.o)
+OBJS_UTILS:=      $(SRCS_UTILS:%.c=$(objdir)/%.o)
+
+ACCESS.o:  $(OBJS_ACCESS)
+   $(make_partial)
+BOOTSTRAP.o:   $(OBJS_BOOTSTRAP)
+   $(make_partial)
+COMMANDS.o:    $(OBJS_COMMANDS)
+   $(make_partial)
+EXECUTOR.o:    $(OBJS_EXECUTOR)
+   $(make_partial)
+MAIN.o:        $(OBJS_MAIN) $(OBJS_POSTMASTER)
+   $(make_partial)
+MISC.o:        $(OBJS_CATALOG) $(OBJS_LIB) $(OBJS_LIBPQ) $(OBJS_PORT)
+   $(make_partial)
+NODES.o:   $(OBJS_NODES)
+   $(make_partial)
+PARSER.o:  $(OBJS_PARSER)
+   $(make_partial)
+OPTIMIZER.o:   $(OBJS_OPTIMIZER)
+   $(make_partial)
+REGEX.o:   $(OBJS_REGEX)
+   $(make_partial)
+REWRITE.o: $(OBJS_REWRITE)
+   $(make_partial)
+STORAGE.o: $(OBJS_STORAGE)
+   $(make_partial)
+TCOP.o:        $(OBJS_TCOP)
+   $(make_partial)
+UTILS.o:   $(OBJS_UTILS)
+   $(make_partial)
+endif
+
+#############################################################################
+#
+# Installation.
+#
+# Install the bki files to the data directory.  We also copy a version
+# of them that has "PGUID" intact, so one can change the value of the
+# postgres userid before running initdb in the case of customizing the
+# binary release (i.e., fixing up PGUID w/o recompiling the system).
+# Those files are copied out as foo.source.  The program newbki(1) can
+# be run later to reset the postgres login id (but it must be run before
+# initdb is run, or after clearing the data directory with
+# cleardbdir(1)). [newbki distributed with v4r2 but not with Postgres95.]
+#
+
+#  NAMEDATALEN=`egrep "^#define NAMEDATALEN" $(CURDIR)/include/postgres.h | awk '{print $$3}'`; \
+#  OIDNAMELEN=`egrep "^#define OIDNAMELEN" $(CURDIR)/include/postgres.h | awk '{print $$3}'`; \
+
+install: beforeinstall pg_id $(BKIFILES) postgres
+   $(INSTALL) $(INSTL_EXE_OPTS) $(objdir)/postgres $(DESTDIR)$(BINDIR)/postgres
+   @rm -f $(DESTDIR)$(BINDIR)/postmaster
+   cd $(DESTDIR)$(BINDIR); ln -s postgres postmaster
+   @cd $(objdir); \
+   PG_UID=`./pg_id $(POSTGRESLOGIN)`; \
+   POSTGRESLOGIN=$(POSTGRESLOGIN);\
+   echo "NAMEDATALEN = $(NAMEDATALEN)"; \
+   echo "OIDNAMELEN = $(OIDNAMELEN)"; \
+   case $$PG_UID in "NOUSER") \
+       echo "Warning: no account named $(POSTGRESLOGIN), using yours";\
+       POSTGRESLOGIN=`whoami`; \
+       PG_UID=`./pg_id`;; \
+   esac ;\
+   for bki in $(BKIFILES); do \
+       sed \
+           -e "s/postgres PGUID/$$POSTGRESLOGIN $$PG_UID/" \
+           -e "s/NAMEDATALEN/$(NAMEDATALEN)/g" \
+           -e "s/OIDNAMELEN/$(OIDNAMELEN)/g" \
+           -e "s/PGUID/$$PG_UID/" \
+           < $$bki > $$bki.sed ; \
+       echo "Installing $(DESTDIR)$(DATADIR)/files/$$bki."; \
+       $(INSTALL) $(INSTLOPTS) \
+           $$bki.sed $(DESTDIR)$(DATADIR)/files/$$bki; \
+       rm -f $$bki.sed; \
+       echo "Installing $(DESTDIR)$(DATADIR)/files/$$bki.source."; \
+       $(INSTALL) $(INSTLOPTS) \
+           $$bki $(DESTDIR)$(DATADIR)/files/$$bki.source; \
+   done;
+   @echo "Installing $(DATADIR)/pg_hba";
+   @cp $(srcdir)/libpq/pg_hba $(DATADIR)
+   @chmod 644 $(DATADIR)/pg_hba
+
+
+# so we can get the UID of the postgres owner (w/o moving pg_id to
+# src/tools). We just want the vanilla LDFLAGS for pg_id
+IDLDFLAGS:= $(LDFLAGS)
+ifeq ($(PORTNAME), hpux)
+ifeq ($(CC), cc)
+IDLDFLAGS+= -Aa -D_HPUX_SOURCE
+endif
+endif
+pg_id: $(srcdir)/bin/pg_id/pg_id.c
+   $(CC) $(IDLDFLAGS) -o $(objdir)/$(@F) $<
+
+CLEANFILES+= pg_id postgres
+
+
+#############################################################################
+#
+# Support for code development.
+#
+
+#
+# Build the file, "./ID", used by the "gid" (grep-for-identifier) tool
+#
+IDFILE=    ID
+.PHONY: $(IDFILE)
+$(IDFILE):
+   $(CURDIR)/makeID $(PORTNAME)
+
+#
+# Special rule to generate cpp'd version of a .c file.  This is
+# especially useful given all the hellish macro processing going on.
+# The cpp'd version has a .C suffix.  To create foo.C from foo.c, just
+# type
+#  bmake foo.C
+#
+%.cpp: %.c
+   $(CC) -E $(CFLAGS) $(<:.C=.c) | cat -s | cb | tr -s '\012*' '\012' > $(objdir)/$(@F)
+
+cppall: $(SRCS:.c=.cpp)
+
+#
+# To use Purify (SunOS only), define PURIFY to be the path (and
+# options) with which to invoke the Purify loader.  Only the executable
+# needs to be loaded with Purify.
+#
+# PURIFY = /usr/sww/bin/purify -cache-dir=/usr/local/postgres/src/backend/purify-cache
+#.if defined(PURIFY)
+#${PROG}: $(POSTGRES_DEPEND) $(OBJS) $(EXPORTS)
+#  ${PURIFY} ${CC} ${LDFLAGS} -o $(objdir)/$(@F) $(addprefix $(objdir)/,$(notdir $(OBJS))) $(LDADD)
+#
+#CLEANFILES+= .purify* .pure .lock.*.o *_pure_*.o *.pure_*link*
+#.endif
+
diff --git a/src/backend/access/Makefile.inc b/src/backend/access/Makefile.inc
new file mode 100644 (file)
index 0000000..6adc2c6
--- /dev/null
@@ -0,0 +1,35 @@
+#-------------------------------------------------------------------------
+#
+# Makefile.inc--
+#    Makefile for the access methods module
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+#
+# IDENTIFICATION
+#    $Header: /cvsroot/pgsql/src/backend/access/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
+#
+#-------------------------------------------------------------------------
+
+accdir=$(CURDIR)/access
+VPATH:=$(VPATH):$(accdir):\
+   $(accdir)/common:$(accdir)/hash:$(accdir)/heap:$(accdir)/index:\
+   $(accdir)/rtree:$(accdir)/nbtree:$(accdir)/transam
+
+
+SUBSRCS=
+include $(accdir)/common/Makefile.inc
+include $(accdir)/hash/Makefile.inc
+include $(accdir)/heap/Makefile.inc
+include $(accdir)/index/Makefile.inc
+include $(accdir)/rtree/Makefile.inc
+include $(accdir)/nbtree/Makefile.inc
+include $(accdir)/transam/Makefile.inc
+SRCS_ACCESS:= $(SUBSRCS)
+
+HEADERS+= attnum.h funcindex.h genam.h hash.h \
+   heapam.h hio.h htup.h ibit.h iqual.h istrat.h \
+   itup.h nbtree.h printtup.h relscan.h rtree.h \
+   sdir.h skey.h strat.h transam.h tupdesc.h tupmacs.h \
+   valid.h xact.h
+
diff --git a/src/backend/access/attnum.h b/src/backend/access/attnum.h
new file mode 100644 (file)
index 0000000..7c999e5
--- /dev/null
@@ -0,0 +1,61 @@
+/*-------------------------------------------------------------------------
+ *
+ * attnum.h--
+ *    POSTGRES attribute number definitions.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: attnum.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef    ATTNUM_H
+#define ATTNUM_H
+
+#include "c.h"
+
+/*
+ * user defined attribute numbers start at 1.  -ay 2/95
+ */
+typedef int16      AttrNumber;
+
+#define InvalidAttrNumber  0
+
+/* ----------------
+ * support macros
+ * ----------------
+ */
+/*
+ * AttributeNumberIsValid --
+ * True iff the attribute number is valid.
+ */
+#define AttributeNumberIsValid(attributeNumber) \
+    ((bool) ((attributeNumber) != InvalidAttrNumber))
+
+/*
+ * AttrNumberIsForUserDefinedAttr --
+ * True iff the attribute number corresponds to an user defined attribute.
+ */
+#define AttrNumberIsForUserDefinedAttr(attributeNumber) \
+    ((bool) ((attributeNumber) > 0))
+
+/*
+ * AttrNumberGetAttrOffset --
+ * Returns the attribute offset for an attribute number.
+ *
+ * Note:
+ * Assumes the attribute number is for an user defined attribute.
+ */
+#define AttrNumberGetAttrOffset(attNum) \
+     (AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)) ? \
+      ((attNum - 1)) : 0)
+
+/*
+ * AttributeOffsetGetAttributeNumber --
+ * Returns the attribute number for an attribute offset.
+ */
+#define AttrOffsetGetAttrNumber(attributeOffset) \
+     ((AttrNumber) (1 + attributeOffset))
+
+#endif /* ATTNUM_H */
diff --git a/src/backend/access/common/Makefile.inc b/src/backend/access/common/Makefile.inc
new file mode 100644 (file)
index 0000000..5d5dd47
--- /dev/null
@@ -0,0 +1,16 @@
+#-------------------------------------------------------------------------
+#
+# Makefile.inc--
+#    Makefile for access/common
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+#
+# IDENTIFICATION
+#    $Header: /cvsroot/pgsql/src/backend/access/common/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:09 scrappy Exp $
+#
+#-------------------------------------------------------------------------
+
+SUBSRCS+= heaptuple.c heapvalid.c indextuple.c indexvalid.c printtup.c \
+   scankey.c tupdesc.c
+
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
new file mode 100644 (file)
index 0000000..c3e72fb
--- /dev/null
@@ -0,0 +1,1011 @@
+/*-------------------------------------------------------------------------
+ *
+ * heaptuple.c--
+ *    This file contains heap tuple accessor and mutator routines, as well
+ *    as a few various tuple utilities.
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.1.1.1 1996/07/09 06:21:09 scrappy Exp $
+ *
+ * NOTES
+ *    The old interface functions have been converted to macros
+ *    and moved to heapam.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#include <string.h>
+
+#include "postgres.h"
+
+#include "access/htup.h"
+#include "access/itup.h"
+#include "access/tupmacs.h"
+#include "access/skey.h"
+#include "storage/ipc.h"
+#include "storage/buf.h"
+#include "storage/bufmgr.h"
+#include "access/transam.h"
+#include "storage/bufpage.h"       /* for MAXTUPLEN */
+#include "storage/itemptr.h"
+#include "utils/memutils.h"
+#include "utils/elog.h"
+#include "utils/palloc.h"
+#include "utils/rel.h"
+#include "utils/nabstime.h"
+
+/* this is so the sparcstation debugger works */
+
+#ifndef NO_ASSERT_CHECKING
+#ifdef sparc
+#define register
+#endif /* sparc */
+#endif /* NO_ASSERT_CHECKING */
+
+/* ----------------------------------------------------------------
+ *         misc support routines
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * ComputeDataSize
+ * ----------------
+ */
+Size
+ComputeDataSize(TupleDesc tupleDesc,
+       Datum value[],
+       char nulls[])
+{
+    uint32 length;
+    int i;
+    int numberOfAttributes = tupleDesc->natts;
+    AttributeTupleForm *att = tupleDesc->attrs;
+    
+    for (length = 0, i = 0; i < numberOfAttributes; i++) {
+   if (nulls[i] != ' ') continue;
+       
+   switch (att[i]->attlen) {
+   case -1:
+       /*
+        * This is the size of the disk representation and so
+        * must include the additional sizeof long.
+        */
+       if (att[i]->attalign == 'd') {
+       length = DOUBLEALIGN(length)
+           + VARSIZE(DatumGetPointer(value[i]));
+       } else {
+       length = INTALIGN(length)
+           + VARSIZE(DatumGetPointer(value[i]));
+       }
+       break;
+   case sizeof(char):
+       length++;
+       break;
+   case sizeof(short):
+       length = SHORTALIGN(length + sizeof(short));
+       break;
+   case sizeof(int32):
+       length = INTALIGN(length + sizeof(int32));
+       break;
+   default:
+       if (att[i]->attlen < sizeof(int32))
+       elog(WARN, "ComputeDataSize: attribute %d has len %d",
+            i, att[i]->attlen);
+       if (att[i]->attalign == 'd')
+       length = DOUBLEALIGN(length) + att[i]->attlen;
+       else
+       length = LONGALIGN(length) + att[i]->attlen;
+       break;
+   }
+    }
+    
+    return length;
+}
+
+/* ----------------
+ * DataFill
+ * ----------------
+ */
+void
+DataFill(char *data,
+    TupleDesc tupleDesc,
+    Datum value[],
+    char nulls[],
+    char *infomask,
+    bits8 bit[])
+{
+    bits8  *bitP;
+    int        bitmask;
+    uint32 length;
+    int        i;
+    int         numberOfAttributes = tupleDesc->natts;
+    AttributeTupleForm* att = tupleDesc->attrs;
+    
+    if (bit != NULL) {
+   bitP = &bit[-1];
+   bitmask = CSIGNBIT;
+    }
+    
+    *infomask = 0;
+    
+    for (i = 0; i < numberOfAttributes; i++) {
+   if (bit != NULL) {
+       if (bitmask != CSIGNBIT) {
+       bitmask <<= 1;
+       } else {
+       bitP += 1;
+       *bitP = 0x0;
+       bitmask = 1;
+       }
+       
+       if (nulls[i] == 'n') {
+       *infomask |= HEAP_HASNULL;
+       continue;
+       }
+       
+       *bitP |= bitmask;
+   }
+       
+   switch (att[i]->attlen) {
+   case -1:
+       *infomask |= HEAP_HASVARLENA;
+       if (att[i]->attalign=='d') {
+       data = (char *) DOUBLEALIGN(data);
+       } else {
+       data = (char *) INTALIGN(data);
+       }
+       length = VARSIZE(DatumGetPointer(value[i]));
+       memmove(data, DatumGetPointer(value[i]),length);
+       data += length;
+       break;
+   case sizeof(char):
+       *data = att[i]->attbyval ?
+       DatumGetChar(value[i]) : *((char *) value[i]);
+       data += sizeof(char);
+       break;
+   case sizeof(int16):
+       data = (char *) SHORTALIGN(data);
+       * (short *) data = (att[i]->attbyval ?
+               DatumGetInt16(value[i]) :
+               *((short *) value[i]));
+       data += sizeof(short);
+       break;
+   case sizeof(int32):
+       data = (char *) INTALIGN(data);
+       * (int32 *) data = (att[i]->attbyval ?
+               DatumGetInt32(value[i]) :
+               *((int32 *) value[i]));
+       data += sizeof(int32);
+       break;
+   default:
+       if (att[i]->attlen < sizeof(int32))
+       elog(WARN, "DataFill: attribute %d has len %d",
+            i, att[i]->attlen);
+       if (att[i]->attalign == 'd') {
+       data = (char *) DOUBLEALIGN(data);
+       memmove(data, DatumGetPointer(value[i]),
+           att[i]->attlen);
+       data += att[i]->attlen;
+       } else {
+       data = (char *) LONGALIGN(data);
+       memmove(data, DatumGetPointer(value[i]),
+           att[i]->attlen);
+       data += att[i]->attlen;
+       }
+           
+   }
+    }
+}
+
+/* ----------------------------------------------------------------
+ *         heap tuple interface
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * heap_attisnull  - returns 1 iff tuple attribute is not present
+ * ----------------
+ */
+int
+heap_attisnull(HeapTuple tup, int attnum)
+{
+    if (attnum > (int)tup->t_natts)
+   return (1);
+    
+    if (HeapTupleNoNulls(tup)) return(0);
+    
+    if (attnum > 0) {
+   return(att_isnull(attnum - 1, tup->t_bits));
+    } else
+   switch (attnum) {
+   case SelfItemPointerAttributeNumber:
+   case ObjectIdAttributeNumber:
+   case MinTransactionIdAttributeNumber:
+   case MinCommandIdAttributeNumber:
+   case MaxTransactionIdAttributeNumber:
+   case MaxCommandIdAttributeNumber:
+   case ChainItemPointerAttributeNumber:
+   case AnchorItemPointerAttributeNumber:
+   case MinAbsoluteTimeAttributeNumber:
+   case MaxAbsoluteTimeAttributeNumber:
+   case VersionTypeAttributeNumber:
+       break;
+       
+   case 0:
+       elog(WARN, "heap_attisnull: zero attnum disallowed");
+       
+   default:
+       elog(WARN, "heap_attisnull: undefined negative attnum");
+   }
+    
+    return (0);
+}
+
+/* ----------------------------------------------------------------
+ *      system attribute heap tuple support
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * heap_sysattrlen
+ *
+ * This routine returns the length of a system attribute.
+ * ----------------
+ */
+int
+heap_sysattrlen(AttrNumber attno)
+{
+    HeapTupleData  *f = NULL;
+    int            len;
+
+    switch (attno) {
+    case SelfItemPointerAttributeNumber:
+   len = sizeof f->t_ctid;
+   break;
+    case ObjectIdAttributeNumber:
+   len = sizeof f->t_oid;
+   break;
+    case MinTransactionIdAttributeNumber:
+   len = sizeof f->t_xmin;
+   break;
+    case MinCommandIdAttributeNumber:
+   len = sizeof f->t_cmin;
+   break;
+    case MaxTransactionIdAttributeNumber:
+   len = sizeof f->t_xmax;
+   break;
+    case MaxCommandIdAttributeNumber:
+   len = sizeof f->t_cmax;
+   break;
+    case ChainItemPointerAttributeNumber:
+   len = sizeof f->t_chain;
+   break;
+    case AnchorItemPointerAttributeNumber:
+   elog(WARN, "heap_sysattrlen: field t_anchor does not exist!");
+   break;
+    case MinAbsoluteTimeAttributeNumber:
+   len = sizeof f->t_tmin;
+   break;
+    case MaxAbsoluteTimeAttributeNumber:
+   len = sizeof f->t_tmax;
+   break;
+    case VersionTypeAttributeNumber:
+   len = sizeof f->t_vtype;
+   break;
+    default:
+   elog(WARN, "sysattrlen: System attribute number %d unknown.",
+        attno);
+   len = 0;
+   break;
+    }
+    return (len);
+}
+
+/* ----------------
+ * heap_sysattrbyval
+ *
+ * This routine returns the "by-value" property of a system attribute.
+ * ----------------
+ */
+bool
+heap_sysattrbyval(AttrNumber attno)
+{
+    bool       byval;
+    
+    switch (attno) {
+    case SelfItemPointerAttributeNumber:
+   byval = false;
+   break;
+    case ObjectIdAttributeNumber:
+   byval = true;
+   break;
+    case MinTransactionIdAttributeNumber:
+   byval = true;
+   break;
+    case MinCommandIdAttributeNumber:
+   byval = true;
+   break;
+    case MaxTransactionIdAttributeNumber:
+   byval = true;
+   break;
+    case MaxCommandIdAttributeNumber:
+   byval = true;
+   break;
+    case ChainItemPointerAttributeNumber:
+   byval = false;
+   break;
+    case AnchorItemPointerAttributeNumber:
+   byval = false;
+   break;
+    case MinAbsoluteTimeAttributeNumber:
+   byval = true;
+   break;
+    case MaxAbsoluteTimeAttributeNumber:
+   byval = true;
+   break;
+    case VersionTypeAttributeNumber:
+   byval = true;
+   break;
+    default:
+   byval = true;
+   elog(WARN, "sysattrbyval: System attribute number %d unknown.",
+        attno);
+   break;
+    }
+    
+    return byval;
+}
+
+/* ----------------
+ * heap_getsysattr
+ * ----------------
+ */
+char *
+heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
+{
+    switch (attnum) {
+    case SelfItemPointerAttributeNumber:
+   return ((char *)&tup->t_ctid);
+    case ObjectIdAttributeNumber:
+   return ((char *) (long) tup->t_oid);
+    case MinTransactionIdAttributeNumber:
+   return ((char *) (long) tup->t_xmin);
+    case MinCommandIdAttributeNumber:
+   return ((char *) (long) tup->t_cmin);
+    case MaxTransactionIdAttributeNumber:
+   return ((char *) (long) tup->t_xmax);
+    case MaxCommandIdAttributeNumber:
+   return ((char *) (long) tup->t_cmax);
+    case ChainItemPointerAttributeNumber:
+   return ((char *) &tup->t_chain);
+    case AnchorItemPointerAttributeNumber:
+   elog(WARN, "heap_getsysattr: t_anchor does not exist!");
+   break;
+   
+   /*
+    *  For tmin and tmax, we need to do some extra work.  These don't
+    *  get filled in until the vacuum cleaner runs (or we manage to flush
+    *  a page after setting the value correctly below).  If the vacuum
+    *  cleaner hasn't run yet, then the times stored in the tuple are
+    *  wrong, and we need to look up the commit time of the transaction.
+    *  We cache this value in the tuple to avoid doing the work more than
+    *  once.
+    */
+   
+    case MinAbsoluteTimeAttributeNumber:
+   if (!AbsoluteTimeIsBackwardCompatiblyValid(tup->t_tmin) &&
+       TransactionIdDidCommit(tup->t_xmin))
+       tup->t_tmin = TransactionIdGetCommitTime(tup->t_xmin);
+   return ((char *) (long) tup->t_tmin);
+    case MaxAbsoluteTimeAttributeNumber:
+   if (!AbsoluteTimeIsBackwardCompatiblyReal(tup->t_tmax)) {
+       if (TransactionIdDidCommit(tup->t_xmax))
+       tup->t_tmax = TransactionIdGetCommitTime(tup->t_xmax);
+       else
+       tup->t_tmax = CURRENT_ABSTIME;
+   }
+   return ((char *) (long) tup->t_tmax);
+    case VersionTypeAttributeNumber:
+   return ((char *) (long) tup->t_vtype);
+    default:
+   elog(WARN, "heap_getsysattr: undefined attnum %d", attnum);
+    }
+    return(NULL);
+}
+
+/* ----------------
+ * fastgetattr
+ *
+ * This is a newer version of fastgetattr which attempts to be
+ * faster by caching attribute offsets in the attribute descriptor.
+ *
+ * an alternate way to speed things up would be to cache offsets
+ * with the tuple, but that seems more difficult unless you take
+ * the storage hit of actually putting those offsets into the
+ * tuple you send to disk.  Yuck.
+ *
+ * This scheme will be slightly slower than that, but should
+ * preform well for queries which hit large #'s of tuples.  After
+ * you cache the offsets once, examining all the other tuples using
+ * the same attribute descriptor will go much quicker. -cim 5/4/91
+ * ----------------
+ */
+char *
+fastgetattr(HeapTuple tup,
+       int attnum,
+       TupleDesc tupleDesc,
+       bool *isnull)
+{
+    char *tp;      /* ptr to att in tuple */
+    bits8  *bp;            /* ptr to att in tuple */
+    int slow;      /* do we have to walk nulls? */
+    AttributeTupleForm *att = tupleDesc->attrs;
+    
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    
+    Assert(PointerIsValid(isnull));
+    Assert(attnum > 0);
+    
+    /* ----------------
+     *   Three cases:
+     * 
+     *   1: No nulls and no variable length attributes.
+     *   2: Has a null or a varlena AFTER att.
+     *   3: Has nulls or varlenas BEFORE att.
+     * ----------------
+     */
+    
+    *isnull =  false;
+    
+    if (HeapTupleNoNulls(tup)) {
+   attnum--;
+   if (att[attnum]->attcacheoff > 0) {
+       return (char *)
+       fetchatt( &(att[attnum]),
+            (char *)tup + tup->t_hoff + att[attnum]->attcacheoff);
+   } else if (attnum == 0) {
+       /*
+        * first attribute is always at position zero
+        */
+       return((char *) fetchatt(&(att[0]), (char *) tup + tup->t_hoff));
+   }
+       
+   tp = (char *) tup + tup->t_hoff;
+       
+   slow = 0;
+    } else {
+   /*
+    * there's a null somewhere in the tuple
+    */
+
+   bp = tup->t_bits;
+   tp = (char *) tup + tup->t_hoff;
+   slow = 0;
+   attnum--;
+       
+   /* ----------------
+    *  check to see if desired att is null
+    * ----------------
+    */
+   
+   if (att_isnull(attnum, bp)) {
+       *isnull = true;
+       return NULL;
+   }
+
+   /* ----------------
+    *      Now check to see if any preceeding bits are null...
+    * ----------------
+    */
+   
+   {
+       register int  i = 0; /* current offset in bp */
+       
+       for (i = 0; i < attnum && !slow; i++) {
+       if (att_isnull(i, bp)) slow = 1;
+       }
+   }
+    }
+    
+    /*
+     * now check for any non-fixed length attrs before our attribute
+     */
+    if (!slow) {
+   if (att[attnum]->attcacheoff > 0) {
+       return (char *)
+       fetchatt(&(att[attnum]),
+            tp + att[attnum]->attcacheoff);
+   } else if (attnum == 0) {
+       return (char *)
+       fetchatt(&(att[0]), (char *) tup + tup->t_hoff);
+   } else if (!HeapTupleAllFixed(tup)) {
+       register int j = 0;
+           
+       for (j = 0; j < attnum && !slow; j++)
+       if (att[j]->attlen < 1) slow = 1;
+   }
+    }
+    
+    /*
+     * if slow is zero, and we got here, we know that we have a tuple with
+     * no nulls.  We also have to initialize the remainder of
+     * the attribute cached offset values.
+     */
+    if (!slow) {
+   register int j = 1;
+   register long off;
+       
+   /*
+    * need to set cache for some atts
+    */
+       
+   att[0]->attcacheoff = 0;
+   
+   while (att[j]->attcacheoff > 0) j++;
+   
+   off = att[j-1]->attcacheoff + att[j-1]->attlen;
+   
+   for (; j < attnum + 1; j++) {
+       switch(att[j]->attlen) {
+       case -1:
+       off = (att[j]->attalign=='d') ?
+           DOUBLEALIGN(off) : INTALIGN(off);
+       break;
+       case sizeof(char):
+       break;
+       case sizeof(short):
+       off = SHORTALIGN(off);
+       break;
+       case sizeof(int32):
+       off = INTALIGN(off);
+       break;
+       default:
+       if (att[j]->attlen < sizeof(int32)) {
+           elog(WARN,
+            "fastgetattr: attribute %d has len %d",
+            j, att[j]->attlen);
+       }
+       if (att[j]->attalign == 'd')
+           off = DOUBLEALIGN(off);
+       else
+           off = LONGALIGN(off);
+       break;
+       }
+           
+       att[j]->attcacheoff = off;
+       off += att[j]->attlen;
+   }
+   
+   return
+       (char *)fetchatt(&(att[attnum]), tp + att[attnum]->attcacheoff);
+    } else {
+   register bool usecache = true;
+   register int off = 0;
+   register int i;
+   
+   /*
+    * Now we know that we have to walk the tuple CAREFULLY.
+    *
+    * Note - This loop is a little tricky.  On iteration i we
+    * first set the offset for attribute i and figure out how much
+    * the offset should be incremented.  Finally, we need to align the
+    * offset based on the size of attribute i+1 (for which the offset
+    * has been computed). -mer 12 Dec 1991
+    */
+   
+   for (i = 0; i < attnum; i++) {
+       if (!HeapTupleNoNulls(tup)) {
+       if (att_isnull(i, bp)) {
+           usecache = false;
+           continue;
+       }
+       }
+       switch (att[i]->attlen) {
+       case -1:
+       off = (att[i]->attalign=='d') ?
+           DOUBLEALIGN(off) : INTALIGN(off);
+       break;
+       case sizeof(char):
+       break;
+       case sizeof(short):
+       off = SHORTALIGN(off);
+       break;
+       case sizeof(int32):
+       off = INTALIGN(off);
+       break;
+       default:
+       if (att[i]->attlen < sizeof(int32))
+           elog(WARN,
+            "fastgetattr2: attribute %d has len %d",
+            i, att[i]->attlen);
+       if (att[i]->attalign == 'd')
+           off = DOUBLEALIGN(off);
+       else
+           off = LONGALIGN(off);
+       break;
+       }
+       if (usecache && att[i]->attcacheoff > 0) {
+       off = att[i]->attcacheoff;
+       if (att[i]->attlen == -1) {
+           usecache = false;
+       }
+       } else {
+       if (usecache) att[i]->attcacheoff = off;
+       }
+           
+       switch(att[i]->attlen) {
+       case sizeof(char):
+       off++;
+       break;
+       case sizeof(int16):
+       off += sizeof(int16);
+       break;
+       case sizeof(int32):
+       off += sizeof(int32);
+       break;
+       case -1:
+       usecache = false;
+       off += VARSIZE(tp + off);
+       break;
+       default:
+       off += att[i]->attlen;
+       break;
+       }
+   }
+   switch (att[attnum]->attlen) {
+   case -1:
+       off = (att[attnum]->attalign=='d')?
+       DOUBLEALIGN(off) : INTALIGN(off);
+       break;
+   case sizeof(char):
+       break;
+   case sizeof(short):
+       off = SHORTALIGN(off);
+       break;
+   case sizeof(int32):
+       off = INTALIGN(off);
+       break;
+   default:
+       if (att[attnum]->attlen < sizeof(int32))
+       elog(WARN, "fastgetattr3: attribute %d has len %d",
+            attnum, att[attnum]->attlen);
+       if (att[attnum]->attalign == 'd')
+       off = DOUBLEALIGN(off);
+       else
+       off = LONGALIGN(off);
+       break;
+   }
+   return((char *) fetchatt(&(att[attnum]), tp + off));
+    }
+}
+
+/* ----------------
+ * heap_getattr
+ *
+ * returns an attribute from a heap tuple.  uses 
+ * ----------------
+ */
+char *
+heap_getattr(HeapTuple tup,
+        Buffer b,
+        int attnum,
+        TupleDesc tupleDesc,
+        bool *isnull)
+{
+    bool   localIsNull;
+
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    Assert(tup != NULL);
+    
+    if (! PointerIsValid(isnull))
+   isnull = &localIsNull;
+    
+    if (attnum > (int) tup->t_natts) {
+   *isnull = true;
+   return ((char *) NULL);
+    }
+    
+    /* ----------------
+     * take care of user defined attributes
+     * ----------------
+     */
+    if (attnum > 0) {
+   char  *datum;
+   datum = fastgetattr(tup, attnum, tupleDesc, isnull);
+   
+   return (datum);
+    }
+    
+    /* ----------------
+     * take care of system attributes
+     * ----------------
+     */
+    *isnull = false;
+    return
+   heap_getsysattr(tup, b, attnum);
+}
+
+/* ----------------
+ * heap_copytuple
+ *
+ * returns a copy of an entire tuple
+ * ----------------
+ */
+HeapTuple
+heap_copytuple(HeapTuple tuple)
+{
+    HeapTuple  newTuple;
+
+    if (! HeapTupleIsValid(tuple))
+   return (NULL);
+    
+    /* XXX For now, just prevent an undetectable executor related error */
+    if (tuple->t_len > MAXTUPLEN) {
+   elog(WARN, "palloctup: cannot handle length %d tuples",
+        tuple->t_len);
+    }
+    
+    newTuple = (HeapTuple) palloc(tuple->t_len);
+    memmove((char *) newTuple, (char *) tuple, (int) tuple->t_len);
+    return(newTuple);
+}
+
+/* ----------------
+ * heap_deformtuple
+ *
+ * the inverse of heap_formtuple (see below)
+ * ----------------
+ */
+void
+heap_deformtuple(HeapTuple tuple,
+        TupleDesc tdesc,
+        Datum values[],
+        char nulls[])
+{
+    int i;
+    int natts;
+    
+    Assert(HeapTupleIsValid(tuple));
+    
+    natts = tuple->t_natts;
+    for (i = 0; i<natts; i++) {
+   bool isnull;
+       
+   values[i] = (Datum)heap_getattr(tuple,
+                   InvalidBuffer,
+                   i+1,
+                   tdesc,
+                   &isnull);
+   if (isnull)
+       nulls[i] = 'n';
+   else
+       nulls[i] = ' ';
+    }
+}
+
+/* ----------------
+ * heap_formtuple 
+ *
+ * constructs a tuple from the given value[] and null[] arrays
+ *
+ * old comments
+ * Handles alignment by aligning 2 byte attributes on short boundries
+ * and 3 or 4 byte attributes on long word boundries on a vax; and
+ * aligning non-byte attributes on short boundries on a sun.  Does
+ * not properly align fixed length arrays of 1 or 2 byte types (yet).
+ *
+ * Null attributes are indicated by a 'n' in the appropriate byte
+ * of the null[].  Non-null attributes are indicated by a ' ' (space).
+ *
+ * Fix me.  (Figure that must keep context if debug--allow give oid.)
+ * Assumes in order.
+ * ----------------
+ */
+HeapTuple
+heap_formtuple(TupleDesc tupleDescriptor,
+          Datum value[],
+          char nulls[])
+{
+    char   *tp;    /* tuple pointer */
+    HeapTuple  tuple;  /* return tuple */
+    int        bitmaplen;
+    long   len;
+    int        hoff;
+    bool   hasnull = false;
+    int        i;
+    int         numberOfAttributes = tupleDescriptor->natts;    
+
+    len = sizeof *tuple - sizeof tuple->t_bits;
+    
+    for (i = 0; i < numberOfAttributes && !hasnull; i++) {
+   if (nulls[i] != ' ') hasnull = true;
+    }
+    
+    if (numberOfAttributes > MaxHeapAttributeNumber)
+   elog(WARN, "heap_formtuple: numberOfAttributes of %d > %d",
+        numberOfAttributes, MaxHeapAttributeNumber);
+    
+    if (hasnull) {
+   bitmaplen = BITMAPLEN(numberOfAttributes);
+   len       += bitmaplen;
+    }
+
+    hoff = len = DOUBLEALIGN(len); /* be conservative here */
+
+    len += ComputeDataSize(tupleDescriptor, value, nulls);
+    
+    tp = (char *) palloc(len);
+    tuple = (HeapTuple) tp;
+
+    memset(tp, 0, (int)len);
+    
+    tuple->t_len =     len;
+    tuple->t_natts =   numberOfAttributes;
+    tuple->t_hoff = hoff;
+    tuple->t_tmin = INVALID_ABSTIME;
+    tuple->t_tmax = CURRENT_ABSTIME;
+    
+    DataFill((char *)tuple + tuple->t_hoff,
+        tupleDescriptor,
+        value,
+        nulls,
+             &tuple->t_infomask,
+        (hasnull ? tuple->t_bits : NULL));
+    
+    return (tuple);
+}
+
+/* ----------------
+ * heap_modifytuple
+ *
+ * forms a new tuple from an old tuple and a set of replacement values.
+ * ----------------
+ */
+HeapTuple
+heap_modifytuple(HeapTuple tuple,
+        Buffer buffer,
+        Relation relation,
+        Datum replValue[],
+        char replNull[],
+        char repl[])
+{
+    int        attoff;
+    int        numberOfAttributes;
+    Datum  *value;
+    char   *nulls;
+    bool   isNull;
+    HeapTuple  newTuple;
+    int        madecopy;
+    uint8  infomask;
+    
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    Assert(HeapTupleIsValid(tuple));
+    Assert(BufferIsValid(buffer) || RelationIsValid(relation));
+    Assert(HeapTupleIsValid(tuple));
+    Assert(PointerIsValid(replValue));
+    Assert(PointerIsValid(replNull));
+    Assert(PointerIsValid(repl));
+    
+    /* ----------------
+     * if we're pointing to a disk page, then first
+     *  make a copy of our tuple so that all the attributes
+     *  are available.  XXX this is inefficient -cim
+     * ----------------
+     */
+    madecopy = 0;
+    if (BufferIsValid(buffer) == true) {
+   relation =  (Relation) BufferGetRelation(buffer);
+   tuple =     heap_copytuple(tuple);
+   madecopy = 1;
+    }
+    
+    numberOfAttributes = RelationGetRelationTupleForm(relation)->relnatts;
+    
+    /* ----------------
+     * allocate and fill value[] and nulls[] arrays from either
+     *  the tuple or the repl information, as appropriate.
+     * ----------------
+     */
+    value = (Datum *)  palloc(numberOfAttributes * sizeof *value);
+    nulls =  (char *)  palloc(numberOfAttributes * sizeof *nulls);
+    
+    for (attoff = 0;
+    attoff < numberOfAttributes;
+    attoff += 1) {
+   
+   if (repl[attoff] == ' ') {
+       char *attr;
+
+       attr =
+       heap_getattr(tuple,
+                InvalidBuffer, 
+                AttrOffsetGetAttrNumber(attoff),
+                RelationGetTupleDescriptor(relation),
+                &isNull) ;
+       value[attoff] = PointerGetDatum(attr);
+       nulls[attoff] = (isNull) ? 'n' : ' ';
+       
+   } else if (repl[attoff] != 'r') {
+       elog(WARN, "heap_modifytuple: repl is \\%3d", repl[attoff]);
+       
+   } else { /* == 'r' */
+       value[attoff] = replValue[attoff];
+       nulls[attoff] =  replNull[attoff];
+   }
+    }
+    
+    /* ----------------
+     * create a new tuple from the values[] and nulls[] arrays
+     * ----------------
+     */
+    newTuple = heap_formtuple(RelationGetTupleDescriptor(relation),
+                 value,
+                 nulls);
+    
+    /* ----------------
+     * copy the header except for t_len, t_natts, t_hoff, t_bits, t_infomask
+     * ----------------
+     */
+    infomask = newTuple->t_infomask;
+    memmove((char *) &newTuple->t_ctid,    /*XXX*/
+       (char *) &tuple->t_ctid,
+       ((char *) &tuple->t_hoff - (char *) &tuple->t_ctid)); /*XXX*/
+    newTuple->t_infomask = infomask;
+    newTuple->t_natts = numberOfAttributes;    /* fix t_natts just in case */
+    
+    /* ----------------
+     * if we made a copy of the tuple, then free it.
+     * ----------------
+     */
+    if (madecopy)
+   pfree(tuple);
+    
+    return
+   newTuple;
+}
+
+/* ----------------------------------------------------------------
+ *         other misc functions
+ * ----------------------------------------------------------------
+ */
+
+HeapTuple
+heap_addheader(uint32 natts,   /* max domain index */
+          int structlen,   /* its length */
+          char *structure) /* pointer to the struct */
+{
+    register char  *tp;    /* tuple data pointer */
+    HeapTuple      tup;
+    long       len;
+    int            hoff;
+    
+    AssertArg(natts > 0);
+    
+    len = sizeof (HeapTupleData) - sizeof (tup->t_bits);
+    
+    hoff = len = DOUBLEALIGN(len); /* be conservative */
+    len += structlen;
+    tp = (char *) palloc(len);
+    tup = (HeapTuple) tp;
+    memset((char*)tup, 0, len);
+    
+    tup->t_len = (short) len;          /* XXX */
+    tp += tup->t_hoff = hoff;
+    tup->t_natts = natts;
+    tup->t_infomask = 0;
+    
+    memmove(tp, structure, structlen);
+    
+    return (tup);
+}
diff --git a/src/backend/access/common/heapvalid.c b/src/backend/access/common/heapvalid.c
new file mode 100644 (file)
index 0000000..b80c5dd
--- /dev/null
@@ -0,0 +1,134 @@
+/*-------------------------------------------------------------------------
+ *
+ * heapvalid.c--
+ *    heap tuple qualification validity checking code
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.1.1.1 1996/07/09 06:21:09 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "c.h"
+
+#include "access/htup.h"
+#include "access/skey.h"
+#include "access/heapam.h"
+#include "utils/tqual.h"
+#include "access/valid.h"  /* where the declarations go */
+#include "access/xact.h"
+
+#include "storage/buf.h"
+#include "storage/bufmgr.h"
+#include "storage/bufpage.h"
+#include "storage/itemid.h"
+#include "fmgr.h"
+#include "utils/elog.h"
+#include "utils/rel.h"
+
+/* ----------------
+ * heap_keytest
+ *
+ * Test a heap tuple with respect to a scan key.
+ * ----------------
+ */
+bool
+heap_keytest(HeapTuple t,
+        TupleDesc tupdesc,
+        int nkeys,
+        ScanKey keys)
+{
+    bool   isnull;
+    Datum  atp;
+    int        test;
+    
+    for (; nkeys--; keys++) {
+   atp = (Datum)heap_getattr(t, InvalidBuffer,
+                 keys->sk_attno, 
+                 tupdesc,
+                 &isnull);
+   
+   if (isnull)
+       /* XXX eventually should check if SK_ISNULL */
+       return false;
+   
+   if (keys->sk_flags & SK_COMMUTE)
+       test = (long) FMGR_PTR2(keys->sk_func, keys->sk_procedure,
+                   keys->sk_argument, atp);
+   else
+       test = (long) FMGR_PTR2(keys->sk_func, keys->sk_procedure,
+                   atp, keys->sk_argument);
+   
+   if (!test == !(keys->sk_flags & SK_NEGATE))
+       return false;
+    }
+    
+    return true;
+}
+
+/* ----------------
+ * heap_tuple_satisfies
+ *
+ *  Returns a valid HeapTuple if it satisfies the timequal and keytest.
+ *  Returns NULL otherwise.  Used to be heap_satisifies (sic) which
+ *  returned a boolean.  It now returns a tuple so that we can avoid doing two
+ *  PageGetItem's per tuple.
+ *
+ * Complete check of validity including LP_CTUP and keytest.
+ * This should perhaps be combined with valid somehow in the
+ * future.  (Also, additional rule tests/time range tests.)
+ *
+ *  on 8/21/92 mao says:  i rearranged the tests here to do keytest before
+ *  SatisfiesTimeQual.  profiling indicated that even for vacuumed relations,
+ *  time qual checking was more expensive than key testing.  time qual is
+ *  least likely to fail, too.  we should really add the time qual test to
+ *  the restriction and optimize it in the normal way.  this has interactions
+ *  with joey's expensive function work.
+ * ----------------
+ */
+HeapTuple
+heap_tuple_satisfies(ItemId itemId,
+            Relation relation,
+            PageHeader disk_page,
+            TimeQual   qual,
+            int nKeys,
+            ScanKey key)
+{
+    HeapTuple  tuple;
+    bool res;
+    
+    if (! ItemIdIsUsed(itemId))
+   return NULL;
+    
+    tuple = (HeapTuple) PageGetItem((Page) disk_page, itemId);
+    
+    if (key != NULL)
+   res = heap_keytest(tuple, RelationGetTupleDescriptor(relation), 
+              nKeys, key);
+    else
+   res = TRUE;
+    
+    if (res && (relation->rd_rel->relkind == RELKIND_UNCATALOGED
+       || HeapTupleSatisfiesTimeQual(tuple,qual)))
+   return tuple;
+    
+    return (HeapTuple) NULL;
+}
+
+/*
+ *  TupleUpdatedByCurXactAndCmd() -- Returns true if this tuple has
+ * already been updated once by the current transaction/command
+ * pair.
+ */
+bool
+TupleUpdatedByCurXactAndCmd(HeapTuple t)
+{
+    if (TransactionIdEquals(t->t_xmax,
+               GetCurrentTransactionId()) &&
+   t->t_cmax == GetCurrentCommandId())
+   return true;
+    
+    return false;
+}
diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c
new file mode 100644 (file)
index 0000000..be5d2cc
--- /dev/null
@@ -0,0 +1,427 @@
+/*-------------------------------------------------------------------------
+ *
+ * indextuple.c--
+ *     This file contains index tuple accessor and mutator routines,
+ *     as well as a few various tuple utilities.
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.1.1.1 1996/07/09 06:21:09 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include <string.h>
+
+#include "c.h"
+#include "access/ibit.h"
+#include "access/itup.h"   /* where the declarations go */
+#include "access/heapam.h"
+#include "access/genam.h"  
+#include "access/tupdesc.h"
+#include "access/tupmacs.h"
+
+#include "storage/itemptr.h"
+#include "utils/elog.h"
+#include "utils/palloc.h"
+
+static Size IndexInfoFindDataOffset(unsigned short t_info);
+
+/* ----------------------------------------------------------------
+ *       index_ tuple interface routines
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * index_formtuple
+ * ----------------
+ */
+IndexTuple
+index_formtuple(TupleDesc tupleDescriptor,
+       Datum value[],
+       char null[])
+{
+    register char  *tp;    /* tuple pointer */
+    IndexTuple     tuple;  /* return tuple */
+    Size       size, hoff;
+    int        i;
+    unsigned short      infomask = 0;
+    bool       hasnull = false;
+    char       tupmask = 0;
+    int                 numberOfAttributes = tupleDescriptor->natts;
+    
+    if (numberOfAttributes > MaxIndexAttributeNumber)
+   elog(WARN, "index_formtuple: numberOfAttributes of %d > %d",
+        numberOfAttributes, MaxIndexAttributeNumber);
+    
+    
+    for (i = 0; i < numberOfAttributes && !hasnull; i++) {
+   if (null[i] != ' ') hasnull = true;
+    }
+    
+    if (hasnull) infomask |= INDEX_NULL_MASK;
+    
+    hoff = IndexInfoFindDataOffset(infomask);
+    size = hoff
+   + ComputeDataSize(tupleDescriptor,
+             value, null);
+    size = DOUBLEALIGN(size);  /* be conservative */
+    
+    tp = (char *) palloc(size);
+    tuple = (IndexTuple) tp;
+    memset(tp,0,(int)size);
+    
+    DataFill((char *)tp + hoff,
+        tupleDescriptor,
+        value,
+        null,
+        &tupmask,
+        (hasnull ? (bits8*)tp + sizeof(*tuple) : NULL));
+    
+    /*
+     * We do this because DataFill wants to initialize a "tupmask" which
+     * is used for HeapTuples, but we want an indextuple infomask.  The only
+     * "relevent" info is the "has variable attributes" field, which is in
+     * mask position 0x02.  We have already set the null mask above.
+     */
+    
+    if (tupmask & 0x02) infomask |= INDEX_VAR_MASK;
+    
+    /*
+     * Here we make sure that we can actually hold the size.  We also want
+     * to make sure that size is not aligned oddly.  This actually is a
+     * rather odd way to make sure the size is not too large overall.
+     */
+    
+    if (size & 0xE000)
+   elog(WARN, "index_formtuple: data takes %d bytes: too big", size);
+
+    
+    infomask |= size;
+    
+    /* ----------------
+     * initialize metadata
+     * ----------------
+     */
+    tuple->t_info = infomask;
+    return (tuple);
+}
+
+/* ----------------
+ * fastgetiattr
+ *
+ * This is a newer version of fastgetiattr which attempts to be
+ * faster by caching attribute offsets in the attribute descriptor.
+ *
+ * an alternate way to speed things up would be to cache offsets
+ * with the tuple, but that seems more difficult unless you take
+ * the storage hit of actually putting those offsets into the
+ * tuple you send to disk.  Yuck.
+ *
+ * This scheme will be slightly slower than that, but should
+ * preform well for queries which hit large #'s of tuples.  After
+ * you cache the offsets once, examining all the other tuples using
+ * the same attribute descriptor will go much quicker. -cim 5/4/91
+ * ----------------
+ */
+char *
+fastgetiattr(IndexTuple tup,
+        int attnum,
+        TupleDesc tupleDesc,
+        bool *isnull)
+{
+    register char      *tp;        /* ptr to att in tuple */
+    register char      *bp;        /* ptr to att in tuple */
+    int            slow;       /* do we have to walk nulls? */
+    register int       data_off;   /* tuple data offset */
+    
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    
+    Assert(PointerIsValid(isnull));
+    Assert(attnum > 0);
+    
+    /* ----------------
+     *   Three cases:
+     * 
+     *   1: No nulls and no variable length attributes.
+     *   2: Has a null or a varlena AFTER att.
+     *   3: Has nulls or varlenas BEFORE att.
+     * ----------------
+     */
+    
+    *isnull =  false;
+    data_off = IndexTupleHasMinHeader(tup) ? sizeof *tup : 
+   IndexInfoFindDataOffset(tup->t_info);
+    
+    if (IndexTupleNoNulls(tup)) {
+   
+   /* first attribute is always at position zero */
+   
+   if (attnum == 1) {
+       return(fetchatt(&(tupleDesc->attrs[0]), (char *) tup + data_off));
+   }
+   attnum--;
+   
+   if (tupleDesc->attrs[attnum]->attcacheoff > 0) {
+       return(fetchatt(&(tupleDesc->attrs[attnum]),
+               (char *) tup + data_off + 
+               tupleDesc->attrs[attnum]->attcacheoff));
+   }
+   
+   tp = (char *) tup + data_off;
+   
+   slow = 0;
+    }else { /* there's a null somewhere in the tuple */
+   
+   bp = (char *) tup + sizeof(*tup); /* "knows" t_bits are here! */
+   slow = 0;
+   /* ----------------
+    *  check to see if desired att is null
+    * ----------------
+    */
+   
+   attnum--;
+   {
+       if (att_isnull(attnum, bp)) {
+       *isnull = true;
+       return NULL;
+       }
+   }
+   /* ----------------
+    *      Now check to see if any preceeding bits are null...
+    * ----------------
+    */
+   {
+       register int  i = 0; /* current offset in bp */
+       register int  mask;  /* bit in byte we're looking at */
+       register char n;     /* current byte in bp */
+       register int byte, finalbit;
+       
+       byte = attnum >> 3;
+       finalbit = attnum & 0x07;
+       
+       for (; i <= byte; i++) {
+       n = bp[i];
+       if (i < byte) {
+           /* check for nulls in any "earlier" bytes */
+           if ((~n) != 0) {
+           slow++;
+           break;
+           }
+       } else {
+           /* check for nulls "before" final bit of last byte*/
+           mask = (finalbit << 1) - 1;
+           if ((~n) & mask)
+           slow++;
+       }
+       }
+   }
+   tp = (char *) tup + data_off;
+    }
+    
+    /* now check for any non-fixed length attrs before our attribute */
+    
+    if (!slow) {
+   if (tupleDesc->attrs[attnum]->attcacheoff > 0) {
+       return(fetchatt(&(tupleDesc->attrs[attnum]), 
+               tp + tupleDesc->attrs[attnum]->attcacheoff));
+   }else if (!IndexTupleAllFixed(tup)) {
+       register int j = 0;
+       
+       for (j = 0; j < attnum && !slow; j++)
+       if (tupleDesc->attrs[j]->attlen < 1) slow = 1;
+   }
+    }
+    
+    /*
+     * if slow is zero, and we got here, we know that we have a tuple with
+     * no nulls.  We also know that we have to initialize the remainder of
+     * the attribute cached offset values.
+     */
+    
+    if (!slow) {
+   register int j = 1;
+   register long off;
+   
+   /*
+    * need to set cache for some atts
+    */
+   
+   tupleDesc->attrs[0]->attcacheoff = 0;
+   
+   while (tupleDesc->attrs[j]->attcacheoff > 0) j++;
+   
+   off = tupleDesc->attrs[j-1]->attcacheoff + 
+         tupleDesc->attrs[j-1]->attlen;
+   
+   for (; j < attnum + 1; j++) {
+       /*
+        * Fix me when going to a machine with more than a four-byte
+        * word!
+        */
+       
+       switch(tupleDesc->attrs[j]->attlen)
+       {
+       case -1:
+           off = (tupleDesc->attrs[j]->attalign=='d')?
+           DOUBLEALIGN(off):INTALIGN(off);
+           break;
+       case sizeof(char):
+           break;
+       case sizeof(short):
+           off = SHORTALIGN(off);
+           break;
+       case sizeof(int32):
+           off = INTALIGN(off);
+           break;
+       default:
+           if (tupleDesc->attrs[j]->attlen > sizeof(int32))
+           off = (tupleDesc->attrs[j]->attalign=='d')?
+               DOUBLEALIGN(off) : LONGALIGN(off);
+           else
+           elog(WARN, "fastgetiattr: attribute %d has len %d",
+                j, tupleDesc->attrs[j]->attlen);
+           break;
+           
+       }
+       
+       tupleDesc->attrs[j]->attcacheoff = off;
+       off += tupleDesc->attrs[j]->attlen;
+   }
+   
+   return(fetchatt( &(tupleDesc->attrs[attnum]), 
+           tp + tupleDesc->attrs[attnum]->attcacheoff));
+    }else {
+   register bool usecache = true;
+   register int off = 0;
+   register int i;
+   
+   /*
+    * Now we know that we have to walk the tuple CAREFULLY.
+    */
+   
+   for (i = 0; i < attnum; i++) {
+       if (!IndexTupleNoNulls(tup)) {
+       if (att_isnull(i, bp)) {
+           usecache = false;
+           continue;
+       }
+       }
+       
+       if (usecache && tupleDesc->attrs[i]->attcacheoff > 0) {
+       off = tupleDesc->attrs[i]->attcacheoff;
+       if (tupleDesc->attrs[i]->attlen == -1) 
+           usecache = false;
+       else
+           continue;
+       }
+           
+       if (usecache) tupleDesc->attrs[i]->attcacheoff = off;
+       switch(tupleDesc->attrs[i]->attlen)
+       {
+       case sizeof(char):
+           off++;
+           break;
+       case sizeof(short):
+           off = SHORTALIGN(off) + sizeof(short);
+           break;
+       case -1:
+           usecache = false;
+           off = (tupleDesc->attrs[i]->attalign=='d')?
+           DOUBLEALIGN(off):INTALIGN(off);
+           off += VARSIZE(tp + off);
+           break;
+       default:
+           if (tupleDesc->attrs[i]->attlen > sizeof(int32))
+           off = (tupleDesc->attrs[i]->attalign=='d') ?
+               DOUBLEALIGN(off) + tupleDesc->attrs[i]->attlen :
+               LONGALIGN(off) + tupleDesc->attrs[i]->attlen;
+           else
+           elog(WARN, "fastgetiattr2: attribute %d has len %d",
+                i, tupleDesc->attrs[i]->attlen);
+           
+           break;
+       }
+   }
+   
+   return(fetchatt(&tupleDesc->attrs[attnum], tp + off));
+    }
+}
+
+/* ----------------
+ * index_getattr
+ * ----------------
+ */
+Datum
+index_getattr(IndexTuple tuple,
+         AttrNumber attNum,
+         TupleDesc tupDesc,
+         bool *isNullOutP)
+{
+    Assert (attNum > 0);
+
+    return (Datum)
+   fastgetiattr(tuple, attNum, tupDesc, isNullOutP);
+}
+
+RetrieveIndexResult
+FormRetrieveIndexResult(ItemPointer indexItemPointer,
+           ItemPointer heapItemPointer)
+{
+    RetrieveIndexResult    result;
+    
+    Assert(ItemPointerIsValid(indexItemPointer));
+    Assert(ItemPointerIsValid(heapItemPointer));
+    
+    result = (RetrieveIndexResult) palloc(sizeof *result);
+    
+    result->index_iptr = *indexItemPointer;
+    result->heap_iptr = *heapItemPointer;
+    
+    return (result);
+}
+
+/*
+ * Takes an infomask as argument (primarily because this needs to be usable
+ * at index_formtuple time so enough space is allocated).
+ *
+ * Change me if adding an attribute to IndexTuples!!!!!!!!!!!
+ */
+static Size
+IndexInfoFindDataOffset(unsigned short t_info)
+{
+    if (!(t_info & INDEX_NULL_MASK))
+   return((Size) sizeof(IndexTupleData));
+    else {
+   Size size = sizeof(IndexTupleData);
+   
+   if (t_info & INDEX_NULL_MASK) {
+       size += sizeof(IndexAttributeBitMapData);
+   }
+   return DOUBLEALIGN(size);   /* be conservative */
+    }
+}
+
+/*
+ * Copies source into target.  If *target == NULL, we palloc space; otherwise
+ * we assume we have space that is already palloc'ed.
+ */
+void
+CopyIndexTuple(IndexTuple source, IndexTuple *target)
+{
+    Size size;
+    IndexTuple ret;
+    
+    size = IndexTupleSize(source);
+    if (*target == NULL) {
+   *target = (IndexTuple) palloc(size);
+    }
+    
+    ret = *target;
+    memmove((char*)ret, (char*)source, size);
+}
+
diff --git a/src/backend/access/common/indexvalid.c b/src/backend/access/common/indexvalid.c
new file mode 100644 (file)
index 0000000..b437718
--- /dev/null
@@ -0,0 +1,84 @@
+/*-------------------------------------------------------------------------
+ *
+ * indexvalid.c--
+ *    index tuple qualification validity checking code
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.1.1.1 1996/07/09 06:21:09 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "postgres.h"
+
+#include "executor/execdebug.h"
+#include "access/genam.h"
+#include "access/iqual.h"  /* where the declarations go */
+#include "access/itup.h"
+#include "access/skey.h"
+
+#include "storage/buf.h"
+#include "storage/bufpage.h"
+#include "storage/itemid.h"
+#include "utils/rel.h"
+
+/* ----------------------------------------------------------------
+ *       index scan key qualification code
+ * ----------------------------------------------------------------
+ */
+int    NIndexTupleProcessed;
+
+/* ----------------
+ * index_keytest
+ *
+ * old comments
+ * May eventually combine with other tests (like timeranges)?
+ * Should have Buffer buffer; as an argument and pass it to amgetattr.
+ * ----------------
+ */
+bool
+index_keytest(IndexTuple tuple,
+         TupleDesc tupdesc,
+         int scanKeySize,
+         ScanKey key)
+{
+    bool       isNull;
+    Datum      datum;
+    int            test;
+    
+    IncrIndexProcessed();
+    
+    while (scanKeySize > 0) {
+   datum = index_getattr(tuple,
+                 1,
+                 tupdesc,
+                 &isNull);
+   
+   if (isNull) {
+       /* XXX eventually should check if SK_ISNULL */
+       return (false);
+   }
+   
+   if (key[0].sk_flags & SK_COMMUTE) {
+       test = (int) (*(key[0].sk_func))
+       (DatumGetPointer(key[0].sk_argument),
+        datum);
+   } else {
+       test = (int) (*(key[0].sk_func))
+       (datum,
+        DatumGetPointer(key[0].sk_argument));
+   }
+   
+   if (!test == !(key[0].sk_flags & SK_NEGATE)) {
+       return (false);
+   }
+   
+   scanKeySize -= 1;
+   key++;
+    }
+    
+    return (true);
+}
+
diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c
new file mode 100644 (file)
index 0000000..556b73b
--- /dev/null
@@ -0,0 +1,306 @@
+/*-------------------------------------------------------------------------
+ *
+ * printtup.c--
+ *    Routines to print out tuples to the destination (binary or non-binary
+ *    portals, frontend/interactive backend, etc.).
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include <sys/file.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "postgres.h"
+
+#include "access/heapam.h"
+#include "access/htup.h"
+#include "access/skey.h"
+#include "access/printtup.h"
+#include "access/tupdesc.h"
+#include "storage/buf.h"
+#include "utils/memutils.h"
+#include "utils/palloc.h"
+#include "fmgr.h"
+#include "utils/elog.h"
+
+#include "utils/syscache.h"
+#include "catalog/pg_type.h"
+
+#include "libpq/libpq.h"
+
+/* ----------------------------------------------------------------
+ * printtup / debugtup support
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * typtoout - used by printtup and debugtup
+ * ----------------
+ */
+Oid
+typtoout(Oid type)
+{
+    HeapTuple  typeTuple;
+    
+    typeTuple = SearchSysCacheTuple(TYPOID,
+                   ObjectIdGetDatum(type),
+                   0, 0, 0);
+    
+    if (HeapTupleIsValid(typeTuple))
+   return((Oid)
+          ((TypeTupleForm) GETSTRUCT(typeTuple))->typoutput);
+    
+    elog(WARN, "typtoout: Cache lookup of type %d failed", type);
+    return(InvalidOid);
+}
+
+Oid
+gettypelem(Oid type)
+{
+    HeapTuple  typeTuple;
+    
+    typeTuple = SearchSysCacheTuple(TYPOID,
+                   ObjectIdGetDatum(type),
+                   0,0,0);
+    
+    if (HeapTupleIsValid(typeTuple))
+   return((Oid)
+          ((TypeTupleForm) GETSTRUCT(typeTuple))->typelem);
+    
+    elog(WARN, "typtoout: Cache lookup of type %d failed", type);
+    return(InvalidOid);
+}
+
+/* ----------------
+ * printtup
+ * ----------------
+ */
+void
+printtup(HeapTuple tuple, TupleDesc typeinfo)
+{
+    int        i, j, k;
+    char   *outputstr, *attr;
+    bool   isnull;
+    Oid    typoutput;
+    
+    /* ----------------
+     * tell the frontend to expect new tuple data
+     * ----------------
+     */
+    pq_putnchar("D", 1);
+    
+    /* ----------------
+     * send a bitmap of which attributes are null
+     * ----------------
+     */
+    j = 0;
+    k = 1 << 7;
+    for (i = 0; i < tuple->t_natts; ) {
+   attr = heap_getattr(tuple, InvalidBuffer, ++i, typeinfo, &isnull);
+   if (!isnull)
+       j |= k;
+   k >>= 1;
+   if (!(i & 7)) {
+       pq_putint(j, 1);
+       j = 0;
+       k = 1 << 7;
+   }
+    }
+    if (i & 7)
+   pq_putint(j, 1);
+    
+    /* ----------------
+     * send the attributes of this tuple
+     * ----------------
+     */
+    for (i = 0; i < tuple->t_natts; ++i) {
+   attr = heap_getattr(tuple, InvalidBuffer, i+1, typeinfo, &isnull);
+   typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
+   
+   if (!isnull && OidIsValid(typoutput)) {
+       outputstr = fmgr(typoutput, attr, 
+                gettypelem(typeinfo->attrs[i]->atttypid));
+       pq_putint(strlen(outputstr)+4, 4);
+       pq_putnchar(outputstr, strlen(outputstr));
+       pfree(outputstr);
+   }
+    }
+}
+
+/* ----------------
+ * printatt
+ * ----------------
+ */
+static void
+printatt(unsigned attributeId,
+    AttributeTupleForm attributeP,
+    char *value)
+{
+    printf("\t%2d: %.*s%s%s%s\t(typeid = %u, len = %d, byval = %c)\n",
+      attributeId,
+      NAMEDATALEN,     /* attname is a char16 */
+      attributeP->attname.data,
+      value != NULL ? " = \"" : "",
+      value != NULL ? value : "",
+      value != NULL ? "\"" : "",
+      (unsigned int) (attributeP->atttypid),
+      attributeP->attlen,
+      attributeP->attbyval ? 't' : 'f');
+}
+
+/* ----------------
+ * showatts
+ * ----------------
+ */
+void
+showatts(char *name, TupleDesc tupleDesc)
+{
+    int    i;
+    int natts = tupleDesc->natts;
+    AttributeTupleForm *attinfo = tupleDesc->attrs;
+
+    puts(name);
+    for (i = 0; i < natts; ++i)
+   printatt((unsigned) i+1, attinfo[i], (char *) NULL);
+    printf("\t----\n");
+}
+
+/* ----------------
+ * debugtup
+ * ----------------
+ */
+void
+debugtup(HeapTuple tuple, TupleDesc typeinfo)
+{
+    register int   i;
+    char       *attr, *value;
+    bool       isnull;
+    Oid        typoutput;
+    
+    for (i = 0; i < tuple->t_natts; ++i) {
+   attr = heap_getattr(tuple, InvalidBuffer, i+1, typeinfo, &isnull);
+   typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);
+   
+   if (!isnull && OidIsValid(typoutput)) {
+       value = fmgr(typoutput, attr, 
+            gettypelem(typeinfo->attrs[i]->atttypid));
+       printatt((unsigned) i+1, typeinfo->attrs[i], value);
+       pfree(value);
+   }
+    }
+    printf("\t----\n");
+}
+
+/*#define IPORTAL_DEBUG*/
+
+/* ----------------
+ * printtup_internal
+ *      Protocol expects either T, D, C, E, or N.
+ *      We use a different data prefix, e.g. 'B' instead of 'D' to
+ *      indicate a tuple in internal (binary) form.
+ *
+ *      This is same as printtup, except we don't use the typout func.
+ * ----------------
+ */
+void
+printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
+{
+    int        i, j, k;
+    char   *attr;
+    bool   isnull;
+    
+    /* ----------------
+     * tell the frontend to expect new tuple data
+     * ----------------
+     */
+    pq_putnchar("B", 1);
+    
+    /* ----------------
+     * send a bitmap of which attributes are null
+     * ----------------
+     */
+    j = 0;
+    k = 1 << 7;
+    for (i = 0; i < tuple->t_natts; ) {
+   attr = heap_getattr(tuple, InvalidBuffer, ++i, typeinfo, &isnull);
+   if (!isnull)
+       j |= k;
+   k >>= 1;
+   if (!(i & 7)) {
+       pq_putint(j, 1);
+       j = 0;
+       k = 1 << 7;
+   }
+    }
+    if (i & 7)
+   pq_putint(j, 1);
+    
+    /* ----------------
+     * send the attributes of this tuple
+     * ----------------
+     */
+#ifdef IPORTAL_DEBUG
+    fprintf(stderr, "sending tuple with %d atts\n", tuple->t_natts);
+#endif
+    for (i = 0; i < tuple->t_natts; ++i) {
+   int32 len = typeinfo->attrs[i]->attlen;
+   
+   attr = heap_getattr(tuple, InvalidBuffer, i+1, typeinfo, &isnull);
+   if (!isnull) {
+       /* # of bytes, and opaque data */
+       if (len == -1) {
+       /* variable length, assume a varlena structure */
+       len = VARSIZE(attr) - VARHDRSZ;
+       
+       pq_putint(len, sizeof(int32));
+       pq_putnchar(VARDATA(attr), len);
+#ifdef IPORTAL_DEBUG
+       {
+           char *d = VARDATA(attr);
+           
+           fprintf(stderr, "length %d data %x%x%x%x\n",
+               len, *d, *(d+1), *(d+2), *(d+3));
+       }
+#endif
+       } else {
+       /* fixed size */
+       if (typeinfo->attrs[i]->attbyval) {
+           int8 i8;
+           int16 i16;
+           int32 i32;
+           
+           pq_putint(len, sizeof(int32));
+           switch (len) {
+           case sizeof(int8):
+           i8 = DatumGetChar(attr);
+           pq_putnchar((char *) &i8, len);
+           break;
+           case sizeof(int16):
+           i16 = DatumGetInt16(attr);
+           pq_putnchar((char *) &i16, len);
+           break;
+           case sizeof(int32):
+           i32 = DatumGetInt32(attr);
+           pq_putnchar((char *) &i32, len);
+           break;
+           }
+#ifdef IPORTAL_DEBUG
+           fprintf(stderr, "byval length %d data %d\n", len, attr);
+#endif
+       } else {
+           pq_putint(len, sizeof(int32));
+           pq_putnchar(attr, len);
+#ifdef IPORTAL_DEBUG
+           fprintf(stderr, "byref length %d data %x\n", len, attr);
+#endif
+       }
+       }
+   }
+    }
+}
diff --git a/src/backend/access/common/scankey.c b/src/backend/access/common/scankey.c
new file mode 100644 (file)
index 0000000..7a47219
--- /dev/null
@@ -0,0 +1,68 @@
+/*-------------------------------------------------------------------------
+ *
+ * scan.c--
+ *    scan direction and key code
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "c.h"
+#include "access/sdir.h"
+#include "access/attnum.h"
+#include "access/skey.h"
+
+#include "fmgr.h"
+
+/*
+ * ScanKeyEntryIsLegal --
+ * True iff the scan key entry is legal.
+ */
+#define ScanKeyEntryIsLegal(entry) \
+    ((bool) (AssertMacro(PointerIsValid(entry)) && \
+        AttributeNumberIsValid(entry->sk_attno)))
+
+/*
+ * ScanKeyEntrySetIllegal --
+ * Marks a scan key entry as illegal.
+ */
+void
+ScanKeyEntrySetIllegal(ScanKey entry)
+{
+
+    Assert(PointerIsValid(entry));
+    
+    entry->sk_flags = 0;   /* just in case... */
+    entry->sk_attno = InvalidAttrNumber;
+    entry->sk_procedure = 0;   /* should be InvalidRegProcedure */
+}
+
+/*
+ * ScanKeyEntryInitialize --
+ * Initializes an scan key entry.
+ *
+ * Note:
+ * Assumes the scan key entry is valid.
+ * Assumes the intialized scan key entry will be legal.
+ */
+void
+ScanKeyEntryInitialize(ScanKey entry,
+              bits16 flags,
+              AttrNumber attributeNumber,
+              RegProcedure procedure,
+              Datum argument)
+{
+    Assert(PointerIsValid(entry));
+    
+    entry->sk_flags = flags;
+    entry->sk_attno = attributeNumber;
+    entry->sk_procedure = procedure;
+    entry->sk_argument = argument;
+    fmgr_info(procedure, &entry->sk_func, &entry->sk_nargs);
+    
+    Assert(ScanKeyEntryIsLegal(entry));
+}
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c
new file mode 100644 (file)
index 0000000..527eb51
--- /dev/null
@@ -0,0 +1,398 @@
+/*-------------------------------------------------------------------------
+ *
+ * tupdesc.c--
+ *    POSTGRES tuple descriptor support code
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
+ *
+ * NOTES
+ *    some of the executor utility code such as "ExecTypeFromTL" should be
+ *    moved here.
+ *
+ *-------------------------------------------------------------------------
+ */
+#include <stdio.h> /* for sprintf() */
+#include <ctype.h>
+#include <string.h>
+
+#include "postgres.h"
+
+#include "nodes/pg_list.h"
+#include "nodes/parsenodes.h"
+
+#include "access/attnum.h"
+#include "access/htup.h"
+#include "access/tupdesc.h"
+
+#include "utils/builtins.h"
+#include "utils/elog.h"        /* XXX generate exceptions instead */
+#include "utils/palloc.h"
+
+#include "utils/syscache.h"
+#include "catalog/pg_type.h"
+
+#include "nodes/primnodes.h"
+
+#include "parser/catalog_utils.h"
+
+/* ----------------------------------------------------------------
+ * CreateTemplateTupleDesc
+ *
+ * This function allocates and zeros a tuple descriptor structure.
+ * ----------------------------------------------------------------
+ */
+TupleDesc
+CreateTemplateTupleDesc(int natts)
+{
+    uint32 size;
+    TupleDesc desc;
+    
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    AssertArg(natts >= 1);
+    
+    /* ----------------
+     *  allocate enough memory for the tuple descriptor and
+     *  zero it as TupleDescInitEntry assumes that the descriptor
+     *  is filled with NULL pointers.
+     * ----------------
+     */
+    size = natts * sizeof (AttributeTupleForm);
+    desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
+    desc->attrs = (AttributeTupleForm*) palloc(size);
+    memset(desc->attrs, 0, size);
+
+    desc->natts = natts;
+
+    return (desc);
+}
+
+/* ----------------------------------------------------------------
+ * CreateTupleDesc
+ *
+ * This function allocates a new TupleDesc from AttributeTupleForm array
+ * ----------------------------------------------------------------
+ */
+TupleDesc
+CreateTupleDesc(int natts, AttributeTupleForm* attrs)
+{
+    TupleDesc desc;
+    
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    AssertArg(natts >= 1);
+    
+    desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
+    desc->attrs = attrs;
+    desc->natts = natts;    
+
+
+    return (desc);
+}
+
+/* ----------------------------------------------------------------
+ * CreateTupleDescCopy
+ *
+ * This function creates a new TupleDesc by copying from an existing
+ *      TupleDesc
+ * 
+ * ----------------------------------------------------------------
+ */
+TupleDesc
+CreateTupleDescCopy(TupleDesc tupdesc)
+{
+    TupleDesc desc;
+    int i, size;
+
+    desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
+    desc->natts = tupdesc->natts;
+    size = desc->natts * sizeof (AttributeTupleForm);
+    desc->attrs = (AttributeTupleForm*) palloc(size);
+    for (i=0;i<desc->natts;i++) {
+   desc->attrs[i] = 
+       (AttributeTupleForm)palloc(ATTRIBUTE_TUPLE_SIZE);
+   memmove(desc->attrs[i],
+       tupdesc->attrs[i],
+       ATTRIBUTE_TUPLE_SIZE);
+    }
+    return desc;
+}
+
+/* ----------------------------------------------------------------
+ * TupleDescInitEntry
+ *
+ * This function initializes a single attribute structure in
+ * a preallocated tuple descriptor.
+ * ----------------------------------------------------------------
+ */
+bool
+TupleDescInitEntry(TupleDesc desc,
+          AttrNumber attributeNumber,
+          char *attributeName,
+          char *typeName,
+          int attdim,
+          bool attisset)
+{
+    HeapTuple      tuple;
+    TypeTupleForm  typeForm;
+    AttributeTupleForm att;
+    
+    /* ----------------
+     * sanity checks
+     * ----------------
+     */
+    AssertArg(PointerIsValid(desc));
+    AssertArg(attributeNumber >= 1);
+    /* attributeName's are sometimes NULL, 
+       from resdom's.  I don't know why that is, though -- Jolly */
+/*    AssertArg(NameIsValid(attributeName));*/
+/*    AssertArg(NameIsValid(typeName));*/
+    
+    AssertArg(!PointerIsValid(desc->attrs[attributeNumber - 1]));
+    
+
+    /* ----------------
+     * allocate storage for this attribute
+     * ----------------
+     */
+
+    att = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
+    desc->attrs[attributeNumber - 1] = att;
+
+    /* ----------------
+     * initialize some of the attribute fields
+     * ----------------
+     */
+    att->attrelid  = 0;                /* dummy value */
+    
+    if (attributeName != NULL)
+   namestrcpy(&(att->attname), attributeName);
+    else
+   memset(att->attname.data,0,NAMEDATALEN);
+
+    
+    att->attdefrel =   0;          /* dummy value */
+    att->attnvals  =   0;          /* dummy value */
+    att->atttyparg =   0;          /* dummy value */
+    att->attbound =    0;          /* dummy value */
+    att->attcanindex =     0;          /* dummy value */
+    att->attproc =     0;          /* dummy value */
+    att->attcacheoff =     -1;
+    
+    att->attnum = attributeNumber;
+    att->attnelems = attdim;
+    att->attisset = attisset;
+    
+    /* ----------------
+     * search the system cache for the type tuple of the attribute
+     *  we are creating so that we can get the typeid and some other
+     *  stuff.
+     *
+     *  Note: in the special case of 
+     *
+     *     create EMP (name = char16, manager = EMP)
+     *
+     *  RelationNameCreateHeapRelation() calls BuildDesc() which
+     *  calls this routine and since EMP does not exist yet, the
+     *  system cache lookup below fails.  That's fine, but rather
+     *  then doing a elog(WARN) we just leave that information
+     *  uninitialized, return false, then fix things up later.
+     *  -cim 6/14/90
+     * ----------------
+     */
+    tuple = SearchSysCacheTuple(TYPNAME, PointerGetDatum(typeName),
+               0,0,0);
+    if (! HeapTupleIsValid(tuple)) {
+   /* ----------------
+    *   here type info does not exist yet so we just fill
+    *   the attribute with dummy information and return false.
+    * ----------------
+    */
+   att->atttypid = InvalidOid;
+   att->attlen   = (int16) 0;
+   att->attbyval = (bool) 0;
+   att->attalign = 'i';
+   return false;
+    }
+    
+    /* ----------------
+     * type info exists so we initialize our attribute
+     *  information from the type tuple we found..
+     * ----------------
+     */
+    typeForm = (TypeTupleForm) GETSTRUCT(tuple);
+    
+    att->atttypid = tuple->t_oid;
+    att->attalign = typeForm->typalign;
+    
+    /* ------------------------
+       If this attribute is a set, what is really stored in the
+       attribute is the OID of a tuple in the pg_proc catalog.
+       The pg_proc tuple contains the query string which defines
+       this set - i.e., the query to run to get the set.
+       So the atttypid (just assigned above) refers to the type returned
+       by this query, but the actual length of this attribute is the
+       length (size) of an OID.
+       
+       Why not just make the atttypid point to the OID type, instead
+       of the type the query returns?  Because the executor uses the atttypid
+       to tell the front end what type will be returned (in BeginCommand),
+       and in the end the type returned will be the result of the query, not
+       an OID.
+       
+       Why not wait until the return type of the set is known (i.e., the
+       recursive call to the executor to execute the set has returned) 
+       before telling the front end what the return type will be?  Because
+       the executor is a delicate thing, and making sure that the correct
+       order of front-end commands is maintained is messy, especially 
+       considering that target lists may change as inherited attributes
+       are considered, etc.  Ugh.
+       -----------------------------------------
+       */
+    if (attisset) {
+   Type t = type("oid");
+   att->attlen = tlen(t);
+   att->attbyval = tbyval(t);
+    } else {
+   att->attlen   = typeForm->typlen;
+   att->attbyval = typeForm->typbyval;
+    }
+    
+    
+    return true;
+}
+
+
+/* ----------------------------------------------------------------
+ * TupleDescMakeSelfReference
+ *
+ * This function initializes a "self-referential" attribute like
+ *      manager in "create EMP (name=text, manager = EMP)".
+ * It calls TypeShellMake() which inserts a "shell" type
+ * tuple into pg_type.  A self-reference is one kind of set, so
+ *      its size and byval are&