Commit d31084e9 authored by Marc G. Fournier's avatar Marc G. Fournier

Postgres95 1.01 Distribution - Virgin Sources

parents
#-------------------------------------------------------------------------
#
# 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
#-------------------------------------------------------------------------
#
# 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
#-------------------------------------------------------------------------
#
# 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
#-------------------------------------------------------------------------
#
# 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
/*-------------------------------------------------------------------------
*
* 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 */
#-------------------------------------------------------------------------
#
# 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
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* 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;
}
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* 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);
}
/*-------------------------------------------------------------------------
*
* 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
}
}
}
}
}
/*-------------------------------------------------------------------------
*
* 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));
}
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* funcindex.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: funcindex.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef _FUNC_INDEX_INCLUDED_
#define _FUNC_INDEX_INCLUDED_
#include "postgres.h"
typedef struct {
int nargs;
Oid arglist[8];
Oid procOid;
NameData funcName;
} FuncIndexInfo;
typedef FuncIndexInfo *FuncIndexInfoPtr;
/*
* some marginally useful macro definitions
*/
/* #define FIgetname(FINFO) (&((FINFO)->funcName.data[0]))*/
#define FIgetname(FINFO) (FINFO)->funcName.data
#define FIgetnArgs(FINFO) (FINFO)->nargs
#define FIgetProcOid(FINFO) (FINFO)->procOid
#define FIgetArg(FINFO, argnum) (FINFO)->arglist[argnum]
#define FIgetArglist(FINFO) (FINFO)->arglist
#define FIsetnArgs(FINFO, numargs) ((FINFO)->nargs = numargs)
#define FIsetProcOid(FINFO, id) ((FINFO)->procOid = id)
#define FIsetArg(FINFO, argnum, argtype) ((FINFO)->arglist[argnum] = argtype)
#define FIisFunctionalIndex(FINFO) (FINFO->procOid != InvalidOid)
#endif /* FUNCINDEX_H */
/*-------------------------------------------------------------------------
*
* genam.h--
* POSTGRES general access method definitions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: genam.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef GENAM_H
#define GENAM_H
#include "postgres.h"
#include "access/attnum.h"
#include "access/htup.h"
#include "access/istrat.h"
#include "access/itup.h"
#include "access/relscan.h"
#include "access/skey.h"
#include "access/sdir.h"
#include "access/funcindex.h"
/* ----------------
* generalized index_ interface routines
* ----------------
*/
extern Relation index_open(Oid relationId);
extern Relation index_openr(char *relationName);
extern void index_close(Relation relation);
extern InsertIndexResult index_insert(Relation relation,
IndexTuple indexTuple);
extern void index_delete(Relation relation, ItemPointer indexItem);
extern IndexScanDesc index_beginscan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
extern void index_rescan(IndexScanDesc scan, bool scanFromEnd, ScanKey key);
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
extern RetrieveIndexResult index_getnext(IndexScanDesc scan,
ScanDirection direction);
extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum,
uint16 procnum);
extern Datum GetIndexValue(HeapTuple tuple, TupleDesc hTupDesc,
int attOff, AttrNumber attrNums[], FuncIndexInfo *fInfo,
bool *attNull, Buffer buffer);
/* in genam.c */
extern IndexScanDesc RelationGetIndexScan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
extern void IndexScanRestart(IndexScanDesc scan, bool scanFromEnd,
ScanKey key);
extern void IndexScanEnd(IndexScanDesc scan);
extern void IndexScanMarkPosition(IndexScanDesc scan);
extern void IndexScanRestorePosition(IndexScanDesc scan);
#endif /* GENAM_H */
This diff is collapsed.
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for access/hash (hash access method)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
#
#-------------------------------------------------------------------------
SUBSRCS+= hash.c hashfunc.c hashinsert.c hashovfl.c hashpage.c hashscan.c \
hashsearch.c hashstrat.c hashutil.c
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* hashfunc.c--
* Comparison functions for hash access method.
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
* defined on hash tables, they compute the hash value of the argument.
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "utils/nabstime.h"
uint32 hashint2(int16 key)
{
return ((uint32) ~key);
}
uint32 hashint4(uint32 key)
{
return (~key);
}
/* Hash function from Chris Torek. */
uint32 hashfloat4(float32 keyp)
{
int len;
int loop;
uint32 h;
char *kp = (char *) keyp;
len = sizeof(float32data);
#define HASH4a h = (h << 5) - h + *kp++;
#define HASH4b h = (h << 5) + h + *kp++;
#define HASH4 HASH4b
h = 0;
if (len > 0) {
loop = (len + 8 - 1) >> 3;
switch (len & (8 - 1)) {
case 0:
do { /* All fall throughs */
HASH4;
case 7:
HASH4;
case 6:
HASH4;
case 5:
HASH4;
case 4:
HASH4;
case 3:
HASH4;
case 2:
HASH4;
case 1:
HASH4;
} while (--loop);
}
}
return (h);
}
uint32 hashfloat8(float64 keyp)
{
int len;
int loop;
uint32 h;
char *kp = (char *) keyp;
len = sizeof(float64data);
#define HASH4a h = (h << 5) - h + *kp++;
#define HASH4b h = (h << 5) + h + *kp++;
#define HASH4 HASH4b
h = 0;
if (len > 0) {
loop = (len + 8 - 1) >> 3;
switch (len & (8 - 1)) {
case 0:
do { /* All fall throughs */
HASH4;
case 7:
HASH4;
case 6:
HASH4;
case 5:
HASH4;
case 4:
HASH4;
case 3:
HASH4;
case 2:
HASH4;
case 1:
HASH4;
} while (--loop);
}
}
return (h);
}
uint32 hashoid(Oid key)
{
return ((uint32) ~key);
}
uint32 hashchar(char key)
{
int len;
uint32 h;
len = sizeof(char);
#define PRIME1 37
#define PRIME2 1048583
h = 0;
/* Convert char to integer */
h = h * PRIME1 ^ (key - ' ');
h %= PRIME2;
return (h);
}
uint32 hashchar2(uint16 intkey)
{
uint32 h;
int len;
char *key = (char *) &intkey;
h = 0;
len = sizeof(uint16);
/* Convert string to integer */
while (len--)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
return (h);
}
uint32 hashchar4(uint32 intkey)
{
uint32 h;
int len;
char *key = (char *) &intkey;
h = 0;
len = sizeof(uint32);
/* Convert string to integer */
while (len--)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
return (h);
}
uint32 hashchar8(char *key)
{
uint32 h;
int len;
h = 0;
len = sizeof(char8);
/* Convert string to integer */
while (len--)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
return (h);
}
uint32 hashname(NameData *n)
{
uint32 h;
int len;
char *key;
key = n->data;
h = 0;
len = NAMEDATALEN;
/* Convert string to integer */
while (len--)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
return (h);
}
uint32 hashchar16(char *key)
{
uint32 h;
int len;
h = 0;
len = sizeof(char16);
/* Convert string to integer */
while (len--)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
return (h);
}
/*
* (Comment from the original db3 hashing code: )
*
* "This is INCREDIBLY ugly, but fast. We break the string up into 8 byte
* units. On the first time through the loop we get the 'leftover bytes'
* (strlen % 8). On every other iteration, we perform 8 HASHC's so we handle
* all 8 bytes. Essentially, this saves us 7 cmp & branch instructions. If
* this routine is heavily used enough, it's worth the ugly coding.
*
* "OZ's original sdbm hash"
*/
uint32 hashtext(struct varlena *key)
{
int keylen;
char *keydata;
uint32 n;
int loop;
keydata = VARDATA(key);
keylen = VARSIZE(key);
/* keylen includes the four bytes in which string keylength is stored */
keylen -= sizeof(VARSIZE(key));
#define HASHC n = *keydata++ + 65599 * n
n = 0;
if (keylen > 0) {
loop = (keylen + 8 - 1) >> 3;
switch (keylen & (8 - 1)) {
case 0:
do { /* All fall throughs */
HASHC;
case 7:
HASHC;
case 6:
HASHC;
case 5:
HASHC;
case 4:
HASHC;
case 3:
HASHC;
case 2:
HASHC;
case 1:
HASHC;
} while (--loop);
}
}
return (n);
}
/*-------------------------------------------------------------------------
*
* hashinsert.c--
* Item insertion in hash tables for Postgres.
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "storage/bufmgr.h"
#include "storage/bufpage.h"
#include "utils/elog.h"
#include "utils/palloc.h"
#include "utils/rel.h"
#include "utils/excid.h"
#include "access/heapam.h"
#include "access/genam.h"
#include "access/hash.h"
static InsertIndexResult _hash_insertonpg(Relation rel, Buffer buf, int keysz, ScanKey scankey, HashItem hitem, Buffer metabuf);
static OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, int keysz, ScanKey itup_scankey, Size itemsize, HashItem hitem);
/*
* _hash_doinsert() -- Handle insertion of a single HashItem in the table.
*
* This routine is called by the public interface routines, hashbuild
* and hashinsert. By here, hashitem is filled in, and has a unique
* (xid, seqno) pair. The datum to be used as a "key" is in the
* hashitem.
*/
InsertIndexResult
_hash_doinsert(Relation rel, HashItem hitem)
{
Buffer buf;
Buffer metabuf;
BlockNumber blkno;
HashMetaPage metap;
IndexTuple itup;
InsertIndexResult res;
ScanKey itup_scankey;
int natts;
Page page;
metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_READ);
metap = (HashMetaPage) BufferGetPage(metabuf);
_hash_checkpage((Page) metap, LH_META_PAGE);
/* we need a scan key to do our search, so build one */
itup = &(hitem->hash_itup);
if ((natts = rel->rd_rel->relnatts) != 1)
elog(WARN, "Hash indices valid for only one index key.");
itup_scankey = _hash_mkscankey(rel, itup, metap);
/*
* find the first page in the bucket chain containing this key and
* place it in buf. _hash_search obtains a read lock for us.
*/
_hash_search(rel, natts, itup_scankey, &buf, metap);
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE);
/*
* trade in our read lock for a write lock so that we can do the
* insertion.
*/
blkno = BufferGetBlockNumber(buf);
_hash_relbuf(rel, buf, HASH_READ);
buf = _hash_getbuf(rel, blkno, HASH_WRITE);
/*
* XXX btree comment (haven't decided what to do in hash): don't
* think the bucket can be split while we're reading the metapage.
*
* If the page was split between the time that we surrendered our
* read lock and acquired our write lock, then this page may no
* longer be the right place for the key we want to insert.
*/
/* do the insertion */
res = _hash_insertonpg(rel, buf, natts, itup_scankey,
hitem, metabuf);
/* be tidy */
_hash_freeskey(itup_scankey);
return (res);
}
/*
* _hash_insertonpg() -- Insert a tuple on a particular page in the table.
*
* This recursive procedure does the following things:
*
* + if necessary, splits the target page.
* + inserts the tuple.
*
* On entry, we must have the right buffer on which to do the
* insertion, and the buffer must be pinned and locked. On return,
* we will have dropped both the pin and the write lock on the buffer.
*
*/
static InsertIndexResult
_hash_insertonpg(Relation rel,
Buffer buf,
int keysz,
ScanKey scankey,
HashItem hitem,
Buffer metabuf)
{
InsertIndexResult res;
Page page;
BlockNumber itup_blkno;
OffsetNumber itup_off;
int itemsz;
HashPageOpaque pageopaque;
bool do_expand = false;
Buffer ovflbuf;
HashMetaPage metap;
Bucket bucket;
metap = (HashMetaPage) BufferGetPage(metabuf);
_hash_checkpage((Page) metap, LH_META_PAGE);
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE|LH_OVERFLOW_PAGE);
pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
bucket = pageopaque->hasho_bucket;
itemsz = IndexTupleDSize(hitem->hash_itup)
+ (sizeof(HashItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz);
while (PageGetFreeSpace(page) < itemsz) {
/*
* no space on this page; check for an overflow page
*/
if (BlockNumberIsValid(pageopaque->hasho_nextblkno)) {
/*
* ovfl page exists; go get it. if it doesn't have room,
* we'll find out next pass through the loop test above.
*/
ovflbuf = _hash_getbuf(rel, pageopaque->hasho_nextblkno,
HASH_WRITE);
_hash_relbuf(rel, buf, HASH_WRITE);
buf = ovflbuf;
page = BufferGetPage(buf);
} else {
/*
* we're at the end of the bucket chain and we haven't
* found a page with enough room. allocate a new overflow
* page.
*/
do_expand = true;
ovflbuf = _hash_addovflpage(rel, &metabuf, buf);
_hash_relbuf(rel, buf, HASH_WRITE);
buf = ovflbuf;
page = BufferGetPage(buf);
if (PageGetFreeSpace(page) < itemsz) {
/* it doesn't fit on an empty page -- give up */
elog(WARN, "hash item too large");
}
}
_hash_checkpage(page, LH_OVERFLOW_PAGE);
pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(pageopaque->hasho_bucket == bucket);
}
itup_off = _hash_pgaddtup(rel, buf, keysz, scankey, itemsz, hitem);
itup_blkno = BufferGetBlockNumber(buf);
/* by here, the new tuple is inserted */
res = (InsertIndexResult) palloc(sizeof(InsertIndexResultData));
ItemPointerSet(&(res->pointerData), itup_blkno, itup_off);
if (res != NULL) {
/*
* Increment the number of keys in the table.
* We switch lock access type just for a moment
* to allow greater accessibility to the metapage.
*/
metap = (HashMetaPage) _hash_chgbufaccess(rel, &metabuf,
HASH_READ, HASH_WRITE);
metap->hashm_nkeys += 1;
metap = (HashMetaPage) _hash_chgbufaccess(rel, &metabuf,
HASH_WRITE, HASH_READ);
}
_hash_wrtbuf(rel, buf);
if (do_expand ||
(metap->hashm_nkeys / (metap->hashm_maxbucket + 1))
> metap->hashm_ffactor) {
_hash_expandtable(rel, metabuf);
}
_hash_relbuf(rel, metabuf, HASH_READ);
return (res);
}
/*
* _hash_pgaddtup() -- add a tuple to a particular page in the index.
*
* This routine adds the tuple to the page as requested, and keeps the
* write lock and reference associated with the page's buffer. It is
* an error to call pgaddtup() without a write lock and reference.
*/
static OffsetNumber
_hash_pgaddtup(Relation rel,
Buffer buf,
int keysz,
ScanKey itup_scankey,
Size itemsize,
HashItem hitem)
{
OffsetNumber itup_off;
Page page;
page = BufferGetPage(buf);
_hash_checkpage(page, LH_BUCKET_PAGE|LH_OVERFLOW_PAGE);
itup_off = OffsetNumberNext(PageGetMaxOffsetNumber(page));
(void) PageAddItem(page, (Item) hitem, itemsize, itup_off, LP_USED);
/* write the buffer, but hold our lock */
_hash_wrtnorelbuf(rel, buf);
return (itup_off);
}
This diff is collapsed.
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* hashscan.c--
* manage scans on hash tables
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
* update it, we need to avoid missing data that moves around in
* the index. The routines and global variables in this file
* guarantee that all scans in the local address space stay
* correctly positioned. This is all we need to worry about, since
* write locking guarantees that no one else will be on the same
* page at the same time as we are.
*
* The scheme is to manage a list of active scans in the current
* backend. Whenever we add or remove records from an index, we
* check the list of active scans to see if any has been affected.
* A scan is affected only if it is on the same relation, and the
* same page, as the update.
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "storage/bufmgr.h"
#include "storage/bufpage.h"
#include "utils/elog.h"
#include "utils/palloc.h"
#include "utils/rel.h"
#include "utils/excid.h"
#include "access/heapam.h"
#include "access/genam.h"
#include "access/sdir.h"
#include "access/hash.h"
static void _hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
static bool _hash_scantouched(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
typedef struct HashScanListData {
IndexScanDesc hashsl_scan;
struct HashScanListData *hashsl_next;
} HashScanListData;
typedef HashScanListData *HashScanList;
static HashScanList HashScans = (HashScanList) NULL;
/*
* _Hash_regscan() -- register a new scan.
*/
void
_hash_regscan(IndexScanDesc scan)
{
HashScanList new_el;
new_el = (HashScanList) palloc(sizeof(HashScanListData));
new_el->hashsl_scan = scan;
new_el->hashsl_next = HashScans;
HashScans = new_el;
}
/*
* _hash_dropscan() -- drop a scan from the scan list
*/
void
_hash_dropscan(IndexScanDesc scan)
{
HashScanList chk, last;
last = (HashScanList) NULL;
for (chk = HashScans;
chk != (HashScanList) NULL && chk->hashsl_scan != scan;
chk = chk->hashsl_next) {
last = chk;
}
if (chk == (HashScanList) NULL)
elog(WARN, "hash scan list trashed; can't find 0x%lx", scan);
if (last == (HashScanList) NULL)
HashScans = chk->hashsl_next;
else
last->hashsl_next = chk->hashsl_next;
#ifdef PERFECT_MEM
pfree (chk);
#endif /* PERFECT_MEM */
}
void
_hash_adjscans(Relation rel, ItemPointer tid)
{
HashScanList l;
Oid relid;
relid = rel->rd_id;
for (l = HashScans; l != (HashScanList) NULL; l = l->hashsl_next) {
if (relid == l->hashsl_scan->relation->rd_id)
_hash_scandel(l->hashsl_scan, ItemPointerGetBlockNumber(tid),
ItemPointerGetOffsetNumber(tid));
}
}
static void
_hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
{
ItemPointer current;
Buffer buf;
Buffer metabuf;
HashScanOpaque so;
if (!_hash_scantouched(scan, blkno, offno))
return;
metabuf = _hash_getbuf(scan->relation, HASH_METAPAGE, HASH_READ);
so = (HashScanOpaque) scan->opaque;
buf = so->hashso_curbuf;
current = &(scan->currentItemData);
if (ItemPointerIsValid(current)
&& ItemPointerGetBlockNumber(current) == blkno
&& ItemPointerGetOffsetNumber(current) >= offno) {
_hash_step(scan, &buf, BackwardScanDirection, metabuf);
so->hashso_curbuf = buf;
}
current = &(scan->currentMarkData);
if (ItemPointerIsValid(current)
&& ItemPointerGetBlockNumber(current) == blkno
&& ItemPointerGetOffsetNumber(current) >= offno) {
ItemPointerData tmp;
tmp = *current;
*current = scan->currentItemData;
scan->currentItemData = tmp;
_hash_step(scan, &buf, BackwardScanDirection, metabuf);
so->hashso_mrkbuf = buf;
tmp = *current;
*current = scan->currentItemData;
scan->currentItemData = tmp;
}
}
static bool
_hash_scantouched(IndexScanDesc scan,
BlockNumber blkno,
OffsetNumber offno)
{
ItemPointer current;
current = &(scan->currentItemData);
if (ItemPointerIsValid(current)
&& ItemPointerGetBlockNumber(current) == blkno
&& ItemPointerGetOffsetNumber(current) >= offno)
return (true);
current = &(scan->currentMarkData);
if (ItemPointerIsValid(current)
&& ItemPointerGetBlockNumber(current) == blkno
&& ItemPointerGetOffsetNumber(current) >= offno)
return (true);
return (false);
}
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* btstrat.c--
* Srategy map entries for the btree indexed access method
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "storage/bufpage.h"
#include "utils/elog.h"
#include "utils/rel.h"
#include "utils/excid.h"
#include "access/genam.h"
#include "access/hash.h"
/*
* only one valid strategy for hash tables: equality.
*/
static StrategyNumber HTNegate[1] = {
InvalidStrategy
};
static StrategyNumber HTCommute[1] = {
HTEqualStrategyNumber
};
static StrategyNumber HTNegateCommute[1] = {
InvalidStrategy
};
static StrategyEvaluationData HTEvaluationData = {
/* XXX static for simplicity */
HTMaxStrategyNumber,
(StrategyTransformMap)HTNegate,
(StrategyTransformMap)HTCommute,
(StrategyTransformMap)HTNegateCommute,
{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}
};
/* ----------------------------------------------------------------
* RelationGetHashStrategy
* ----------------------------------------------------------------
*/
StrategyNumber
_hash_getstrat(Relation rel,
AttrNumber attno,
RegProcedure proc)
{
StrategyNumber strat;
strat = RelationGetStrategy(rel, attno, &HTEvaluationData, proc);
Assert(StrategyNumberIsValid(strat));
return (strat);
}
bool
_hash_invokestrat(Relation rel,
AttrNumber attno,
StrategyNumber strat,
Datum left,
Datum right)
{
return (RelationInvokeStrategy(rel, &HTEvaluationData, attno, strat,
left, right));
}
This diff is collapsed.
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for access/heap
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:11 scrappy Exp $
#
#-------------------------------------------------------------------------
SUBSRCS+= heapam.c hio.c stats.c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* hio.h--
* POSTGRES heap access method input/output definitions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: hio.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef HIO_H
#define HIO_H
#include "c.h"
#include "storage/block.h"
#include "access/htup.h"
#include "utils/rel.h"
extern void RelationPutHeapTuple(Relation relation, BlockNumber blockIndex,
HeapTuple tuple);
extern void RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple);
#endif /* HIO_H */
This diff is collapsed.
/*-------------------------------------------------------------------------
*
* ibit.h--
* POSTGRES index valid attribute bit map definitions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: ibit.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef IBIT_H
#define IBIT_H
#include "c.h"
#include "utils/memutils.h"
typedef struct IndexAttributeBitMapData {
char bits[(MaxIndexAttributeNumber + MaxBitsPerByte - 1)
/ MaxBitsPerByte];
} IndexAttributeBitMapData;
typedef IndexAttributeBitMapData *IndexAttributeBitMap;
#define IndexAttributeBitMapSize sizeof(IndexAttributeBitMapData)
/*
* IndexAttributeBitMapIsValid --
* True iff attribute bit map is valid.
*/
#define IndexAttributeBitMapIsValid(bits) PointerIsValid(bits)
#endif /* IBIT_H */
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for access/index
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/access/index/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:11 scrappy Exp $
#
#-------------------------------------------------------------------------
SUBSRCS+= genam.c indexam.c istrat.c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for access/rtree (R-Tree access method)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:12 scrappy Exp $
#
#-------------------------------------------------------------------------
SUBSRCS+= rtget.c rtproc.c rtree.c rtscan.c rtstrat.c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment