├── COPYRIGHT ├── Makefile ├── Makefile.global ├── README └── src ├── Makefile ├── Makefile.global ├── backend ├── Makefile ├── access │ ├── Makefile.inc │ ├── att.h │ ├── attnum.h │ ├── attval.h │ ├── btree-externs.h │ ├── btree.h │ ├── common │ │ ├── Makefile.inc │ │ ├── attr.c │ │ ├── heaptuple.c │ │ ├── heapvalid.c │ │ ├── indextuple.c │ │ ├── indexvalid.c │ │ ├── printtup.c │ │ ├── scankey.c │ │ └── tupdesc.c │ ├── ftup.h │ ├── funcindex.h │ ├── genam.h │ ├── hash.h │ ├── hash │ │ ├── Makefile.inc │ │ ├── hash.c │ │ ├── hashfunc.c │ │ ├── hashinsert.c │ │ ├── hashovfl.c │ │ ├── hashpage.c │ │ ├── hashscan.c │ │ ├── hashsearch.c │ │ ├── hashstrat.c │ │ └── hashutil.c │ ├── heap │ │ ├── Makefile.inc │ │ ├── heapam.c │ │ ├── hio.c │ │ ├── hrnd.c │ │ ├── localam.c │ │ ├── rac.c │ │ └── stats.c │ ├── heapam.h │ ├── hio.h │ ├── hrnd.h │ ├── htup.h │ ├── ibit.h │ ├── imark.h │ ├── index-rtree │ │ ├── Makefile.inc │ │ ├── rtget.c │ │ ├── rtproc.c │ │ ├── rtree.c │ │ ├── rtscan.c │ │ └── rtstrat.c │ ├── index │ │ ├── Makefile.inc │ │ ├── genam.c │ │ ├── indexam.c │ │ └── istrat.c │ ├── iqual.h │ ├── isop.h │ ├── istrat.h │ ├── itup.h │ ├── nbtree.h │ ├── nbtree │ │ ├── Makefile.inc │ │ ├── README │ │ ├── nbtcompare.c │ │ ├── nbtinsert.c │ │ ├── nbtpage.c │ │ ├── nbtree.c │ │ ├── nbtscan.c │ │ ├── nbtsearch.c │ │ ├── nbtstrat.c │ │ └── nbtutils.c │ ├── nobtree.h │ ├── nobtree │ │ ├── Makefile.inc │ │ ├── README │ │ ├── nobtcompare.c │ │ ├── nobtinsert.c │ │ ├── nobtpage.c │ │ ├── nobtree.c │ │ ├── nobtscan.c │ │ ├── nobtsearch.c │ │ ├── nobtstrat.c │ │ └── nobtutils.c │ ├── printtup.h │ ├── relscan.h │ ├── rtree.h │ ├── rulescan.h │ ├── sdir.h │ ├── skey.h │ ├── tqual.h │ ├── transam.h │ ├── transam │ │ ├── Makefile.inc │ │ ├── transam.c │ │ ├── transsup.c │ │ ├── varsup.c │ │ └── xact.c │ ├── tupdesc.h │ ├── tupmacs.h │ ├── valid.h │ ├── xact.h │ ├── xlog.h │ └── xtim.h ├── bootstrap │ ├── Makefile.inc │ ├── bkint.h │ ├── boot.sed │ ├── bootparse.y │ ├── bootscanner.lex │ ├── bootstrap.c │ └── socket.c ├── catalog │ ├── Makefile.inc │ ├── README │ ├── catalog.c │ ├── catname.c │ ├── catname.h │ ├── genbki.sh │ ├── heap.c │ ├── index.c │ ├── indexing.c │ ├── indexing.h │ ├── pg_aggregate.c │ ├── pg_aggregate.h │ ├── pg_am.h │ ├── pg_amop.h │ ├── pg_amproc.h │ ├── pg_attribute.h │ ├── pg_database.h │ ├── pg_defaults.h │ ├── pg_demon.h │ ├── pg_group.h │ ├── pg_index.h │ ├── pg_inheritproc.h │ ├── pg_inherits.h │ ├── pg_ipl.h │ ├── pg_language.h │ ├── pg_listener.h │ ├── pg_lobj.c │ ├── pg_lobj.h │ ├── pg_log.h │ ├── pg_magic.h │ ├── pg_naming.c │ ├── pg_naming.h │ ├── pg_opclass.h │ ├── pg_operator.c │ ├── pg_operator.h │ ├── pg_parg.h │ ├── pg_platter.h │ ├── pg_plmap.h │ ├── pg_proc.c │ ├── pg_proc.h │ ├── pg_protos.h │ ├── pg_prs2plans.h │ ├── pg_prs2rule.h │ ├── pg_prs2stub.h │ ├── pg_relation.h │ ├── pg_rewrite.h │ ├── pg_server.h │ ├── pg_statistic.h │ ├── pg_time.h │ ├── pg_type.c │ ├── pg_type.h │ ├── pg_user.h │ ├── pg_variable.h │ ├── pg_version.h │ ├── syscache.h │ └── unused_oids ├── commands │ ├── Makefile.inc │ ├── async.c │ ├── command.c │ ├── command.h │ ├── copy.c │ ├── copy.h │ ├── defind.c │ ├── define.c │ ├── defrem.h │ ├── manip.c │ ├── manip.h │ ├── purge.c │ ├── remove.c │ ├── rename.c │ ├── vacuum.c │ ├── vacuum.h │ ├── version.c │ ├── version.h │ └── view.c ├── executor │ ├── Makefile.inc │ ├── ex_ami.c │ ├── ex_debug.c │ ├── ex_flatten.c │ ├── ex_junk.c │ ├── ex_main.c │ ├── ex_procnode.c │ ├── ex_qual.c │ ├── ex_scan.c │ ├── ex_shmem.c │ ├── ex_tuples.c │ ├── ex_utils.c │ ├── execdebug.h │ ├── execdefs.h │ ├── execdesc.h │ ├── execmisc.h │ ├── execshmem.h │ ├── executor.h │ ├── externs.h │ ├── flatten.h │ ├── functions.c │ ├── hashjoin.h │ ├── n_aggregate.c │ ├── n_append.c │ ├── n_hash.c │ ├── n_hashjoin.c │ ├── n_indexscan.c │ ├── n_material.c │ ├── n_mergejoin.c │ ├── n_nestloop.c │ ├── n_result.c │ ├── n_scantemps.c │ ├── n_seqscan.c │ ├── n_sort.c │ ├── n_unique.c │ ├── paralleldebug.h │ ├── tuptable.h │ ├── x_aggregate.h │ ├── x_append.h │ ├── x_debug.h │ ├── x_eutils.h │ ├── x_execam.h │ ├── x_execinit.h │ ├── x_execmain.h │ ├── x_execstats.h │ ├── x_functions.h │ ├── x_hash.h │ ├── x_hashjoin.h │ ├── x_indexscan.h │ ├── x_junk.h │ ├── x_material.h │ ├── x_mergejoin.h │ ├── x_nestloop.h │ ├── x_procnode.h │ ├── x_qual.h │ ├── x_result.h │ ├── x_scan.h │ ├── x_scantemps.h │ ├── x_seqscan.h │ ├── x_sort.h │ ├── x_tuples.h │ └── x_unique.h ├── lib │ ├── Makefile.inc │ ├── atoms.c │ ├── bit.c │ ├── catalog.h │ ├── copyfuncs.c │ ├── copyfuncs.h │ ├── equalfuncs.c │ ├── equalfuncs.h │ ├── fcache.c │ ├── fstack.c │ ├── hasht.c │ ├── heap.h │ ├── index.h │ ├── lispdep.c │ ├── lisplist.c │ ├── lisplist.h │ ├── lispread.c │ ├── lispread.h │ ├── lispsort.c │ ├── lispsort.h │ ├── lsyscache.c │ ├── nodeFuncs.c │ ├── nodes.c │ ├── oset.c │ ├── outfuncs.c │ ├── outfuncs.h │ ├── ppreserve.c │ ├── qsort.c │ ├── readfuncs.c │ ├── readfuncs.h │ ├── simplelists.c │ ├── stringinfo.c │ ├── utilities.c │ └── xid.c ├── libpq │ ├── Makefile.inc │ ├── auth.c │ ├── auth.h │ ├── be-dumpdata.c │ ├── be-fsstubs.c │ ├── be-pqexec.c │ ├── portal.c │ ├── portalbuf.c │ ├── pqcomm.c │ ├── pqpacket.c │ ├── pqsignal.c │ └── pqsignal.h ├── main │ ├── Makefile.inc │ └── main.c ├── makeID ├── nodes │ ├── Gen_accessors.sh │ ├── Gen_creator.sh │ ├── Makefile.inc │ ├── execnodes.a.h │ ├── execnodes.h │ ├── inherits.sh │ ├── mnodes.h │ ├── nodes.h │ ├── pg_lisp.h │ ├── plannodes.a.h │ ├── plannodes.h │ ├── primnodes.a.h │ ├── primnodes.h │ ├── relation.a.h │ ├── relation.h │ └── slots.ok ├── parser │ ├── Makefile.inc │ ├── atoms.h │ ├── catalog_utils.c │ ├── catalog_utils.h │ ├── dbcommands.c │ ├── error.c │ ├── exceptions.h │ ├── gram.y │ ├── io.c │ ├── io.h │ ├── parse_query.c │ ├── parse_query.h │ ├── parsetree.h │ ├── scan.l │ ├── scanner.c │ └── ylib.c ├── planner │ ├── Makefile.inc │ ├── allpaths.h │ ├── archive.h │ ├── cfi.h │ ├── clause.h │ ├── clauseinfo.h │ ├── clauses.h │ ├── clausesel.h │ ├── costsize.h │ ├── createplan.h │ ├── handleunion.h │ ├── hashutils.h │ ├── indexnode.h │ ├── indxpath.h │ ├── initsplan.h │ ├── internal.h │ ├── joininfo.h │ ├── joinpath.h │ ├── joinrels.h │ ├── joinutils.h │ ├── keys.h │ ├── mergeutils.h │ ├── ordering.h │ ├── orindxpath.h │ ├── paramutils.h │ ├── path │ │ ├── Makefile.inc │ │ ├── allpaths.c │ │ ├── clausesel.c │ │ ├── costsize.c │ │ ├── hashutils.c │ │ ├── indxpath.c │ │ ├── joinpath.c │ │ ├── joinrels.c │ │ ├── joinutils.c │ │ ├── mergeutils.c │ │ ├── orindxpath.c │ │ ├── predmig.c │ │ ├── prune.c │ │ └── xfunc.c │ ├── pathnode.h │ ├── plan │ │ ├── Makefile.inc │ │ ├── createplan.c │ │ ├── initsplan.c │ │ ├── planmain.c │ │ ├── planner.c │ │ ├── setrefs.c │ │ └── sortresult.c │ ├── plancat.h │ ├── planmain.h │ ├── planner.h │ ├── pppp.h │ ├── predmig.h │ ├── prep │ │ ├── Makefile.inc │ │ ├── archive.c │ │ ├── handleunion.c │ │ ├── prepqual.c │ │ ├── preptlist.c │ │ ├── prepunion.c │ │ └── semanopt.c │ ├── prepqual.h │ ├── preptlist.h │ ├── prepunion.h │ ├── prune.h │ ├── relnode.h │ ├── semanopt.h │ ├── setrefs.h │ ├── sortresult.h │ ├── storeplan.h │ ├── sys │ │ ├── Makefile.inc │ │ ├── cfi.c │ │ ├── paramutils.c │ │ ├── plancat.c │ │ ├── pppp.c │ │ └── storeplan.c │ ├── tlist.h │ ├── util │ │ ├── Makefile.inc │ │ ├── clause.c │ │ ├── clauseinfo.c │ │ ├── clauses.c │ │ ├── indexnode.c │ │ ├── internal.c │ │ ├── joininfo.c │ │ ├── keys.c │ │ ├── ordering.c │ │ ├── pathnode.c │ │ ├── relnode.c │ │ ├── tlist.c │ │ └── var.c │ ├── var.h │ └── xfunc.h ├── port │ ├── Makefile.inc │ ├── aix │ │ ├── Makefile.inc │ │ ├── README.dlfcn │ │ ├── dlfcn.c │ │ ├── dlfcn.h │ │ ├── dynloader.c │ │ ├── machine.h │ │ └── port-protos.h │ ├── alpha │ │ ├── Makefile.inc │ │ ├── dynloader.c │ │ ├── machine.h │ │ ├── port-protos.h │ │ ├── port.c │ │ ├── tas.c.template │ │ └── tas.s │ ├── hpux │ │ ├── Makefile.inc │ │ ├── dynloader.c │ │ ├── fixade.h │ │ ├── machine.h │ │ ├── port-protos.h │ │ ├── port.c │ │ ├── tas.c.template │ │ └── tas.s │ ├── linux │ │ ├── Makefile.inc │ │ ├── dynloader.c │ │ ├── machine.h │ │ ├── port-protos.h │ │ └── port.c │ ├── sparc │ │ ├── Makefile.inc │ │ ├── dynloader.c │ │ ├── float.h │ │ ├── machine.h │ │ ├── port-protos.h │ │ ├── port.c │ │ └── strtol.c │ ├── sparc_solaris │ │ ├── Makefile.inc │ │ ├── dynloader.c │ │ ├── machine.h │ │ ├── port-protos.h │ │ ├── port.c │ │ ├── rusagestub.h │ │ ├── strings.h │ │ └── tas.s │ └── ultrix4 │ │ ├── Makefile.inc │ │ ├── dl.h │ │ ├── dynloader.c │ │ ├── machine.h │ │ ├── port-protos.h │ │ └── port.c ├── rewrite │ ├── Makefile.inc │ ├── RemoveRewrite.c │ ├── RewriteDebug.c │ ├── RewriteDebug.h │ ├── RewriteDefine.c │ ├── RewriteDefine.h │ ├── RewriteHandler.c │ ├── RewriteHandler.h │ ├── RewriteManip.c │ ├── RewriteManip.h │ ├── RewriteSupport.c │ ├── RewriteSupport.h │ ├── locks.c │ └── locks.h ├── rules │ ├── Makefile.inc │ ├── params.h │ ├── prs2.h │ ├── prs2 │ │ ├── Makefile.inc │ │ ├── prs2append.c │ │ ├── prs2attr.c │ │ ├── prs2bkwd.c │ │ ├── prs2define.c │ │ ├── prs2delete.c │ │ ├── prs2explain.c │ │ ├── prs2impexp.c │ │ ├── prs2inout.c │ │ ├── prs2locks.c │ │ ├── prs2main.c │ │ ├── prs2plans.c │ │ ├── prs2putlocks.c │ │ ├── prs2rel.c │ │ ├── prs2replace.c │ │ ├── prs2retrieve.c │ │ ├── prs2stack.c │ │ ├── prs2tup.c │ │ └── prs2view.c │ ├── prs2locks.h │ ├── prs2stub.h │ ├── rac.h │ └── stubs │ │ ├── Makefile.inc │ │ ├── stubinout.c │ │ ├── stubjoin.c │ │ ├── stubraw.c │ │ ├── stubrel.c │ │ ├── stubtuple.c │ │ └── stubutil.c ├── storage │ ├── Makefile.inc │ ├── backendid.h │ ├── block.h │ ├── buf.h │ ├── buf_internals.h │ ├── buffer │ │ ├── Makefile.inc │ │ ├── buf_table.c │ │ ├── bufmgr.c │ │ ├── freelist.c │ │ ├── imark.c │ │ └── order.c │ ├── bufmgr.h │ ├── bufpage.h │ ├── execipc.h │ ├── fd.h │ ├── file │ │ ├── Makefile.inc │ │ └── fd.c │ ├── form.h │ ├── ipc.h │ ├── ipc │ │ ├── Makefile.inc │ │ ├── README │ │ ├── execipc.c │ │ ├── ipc.c │ │ ├── ipci.c │ │ ├── s_lock.c │ │ ├── shmem.c │ │ ├── shmqueue.c │ │ ├── sinval.c │ │ ├── sinvaladt.c │ │ └── spin.c │ ├── ipci.h │ ├── item.h │ ├── itemid.h │ ├── itempos.h │ ├── itemptr.h │ ├── jbcomm.h │ ├── jblib.h │ ├── jbstruct.h │ ├── large_object │ │ ├── Makefile.inc │ │ ├── inv_api.c │ │ ├── jo_utils.c │ │ ├── lo_api.c │ │ └── lo_utils.c │ ├── lmgr.h │ ├── lmgr │ │ ├── Makefile.inc │ │ ├── README │ │ ├── lmgr.c │ │ ├── lock.c │ │ ├── multi.c │ │ ├── proc.c │ │ └── single.c │ ├── lock.h │ ├── multilev.h │ ├── off.h │ ├── page.h │ ├── page │ │ ├── Makefile.inc │ │ ├── bufpage.c │ │ ├── itemptr.c │ │ ├── part.c │ │ └── pskip.c │ ├── pagenum.h │ ├── part.h │ ├── pldebug.h │ ├── pos.h │ ├── proc.h │ ├── procq.h │ ├── shmem.h │ ├── sinval.h │ ├── sinvaladt.h │ ├── sj.h │ ├── smgr.h │ ├── smgr │ │ ├── Makefile.inc │ │ ├── README │ │ ├── jbaccess.c │ │ ├── md.c │ │ ├── mm.c │ │ ├── pgjb.c │ │ ├── sj.c │ │ ├── smgr.c │ │ └── smgrtype.c │ ├── spin.h │ └── taslock.h ├── tcop │ ├── Makefile.inc │ ├── aclchk.c │ ├── creatinh.c │ ├── creatinh.h │ ├── dest.c │ ├── dest.h │ ├── fastpath.c │ ├── parsev.c │ ├── parsev.h │ ├── pfrag.c │ ├── pfrag.h │ ├── postgres.c │ ├── pquery.c │ ├── pquery.h │ ├── slaves.c │ ├── slaves.h │ ├── tcop.h │ ├── tcopdebug.h │ ├── tcopprot.h │ ├── utility.c │ └── utility.h ├── tmp │ ├── Makefile.inc │ ├── acl.h │ ├── c.h │ ├── daemon.h │ ├── datum.h │ ├── fastpath.h │ ├── fstack.h │ ├── hasht.h │ ├── installinfo.h │ ├── libpq-be.h │ ├── libpq-fe.h │ ├── libpq-fs.h │ ├── libpq.h │ ├── miscadmin.h │ ├── nodeFuncs.h │ ├── portal.h │ ├── postgres.h │ ├── pqcomm.h │ ├── simplelists.h │ ├── stringinfo.h │ └── utilities.h └── utils │ ├── Gen_fmgrtab.sh │ ├── Makefile.inc │ ├── adt │ ├── Makefile.inc │ ├── acl.c │ ├── array.h │ ├── arrayfuncs.c │ ├── arrayutils.c │ ├── bool.c │ ├── char.c │ ├── chunk.c │ ├── date.c │ ├── datum.c │ ├── dt.c │ ├── filename.c │ ├── float.c │ ├── ftype.c │ ├── geo-ops.c │ ├── geo-selfuncs.c │ ├── int.c │ ├── lo_regprocs.c │ ├── misc.c │ ├── nabstime.c │ ├── name.c │ ├── not_in.c │ ├── numutils.c │ ├── oid.c │ ├── oidchar16.c │ ├── oidint2.c │ ├── oidint4.c │ ├── regexp.c │ ├── regproc.c │ ├── selfuncs.c │ ├── sets.c │ ├── tid.c │ └── varlena.c │ ├── builtins.h │ ├── cache │ ├── Makefile.inc │ ├── catcache.c │ ├── inval.c │ ├── rel.c │ ├── relcache.c │ └── syscache.c │ ├── catcache.h │ ├── dynamic_loader.h │ ├── error │ ├── Makefile.inc │ ├── assert.c │ ├── elog.c │ ├── exc.c │ ├── excabort.c │ ├── excid.c │ └── format.c │ ├── exc.h │ ├── excid.h │ ├── fcache.h │ ├── fmgr │ ├── Makefile.inc │ ├── dfmgr.c │ └── ufp.c │ ├── fmgrtab.h │ ├── geo-decls.h │ ├── hash │ ├── Makefile.inc │ ├── dynahash.c │ └── hashfn.c │ ├── hsearch.h │ ├── init │ ├── Makefile.inc │ ├── enbl.c │ ├── globals.c │ ├── magic.c │ ├── miscinit.c │ └── postinit.c │ ├── inval.h │ ├── large_object.h │ ├── log.h │ ├── lselect.h │ ├── lsyscache.h │ ├── mcxt.h │ ├── memutils.h │ ├── mmgr │ ├── Makefile.inc │ ├── aset.c │ ├── mcxt.c │ ├── palloc.c │ ├── pg_malloc.c │ └── portalmem.c │ ├── module.h │ ├── nabstime.h │ ├── oidcompos.h │ ├── palloc.h │ ├── pg_malloc.h │ ├── psort.h │ ├── rel.h │ ├── relcache.h │ ├── sets.h │ ├── sort │ ├── Makefile.inc │ ├── lselect.c │ └── psort.c │ └── time │ ├── Makefile.inc │ └── tqual.c ├── bigTAGS ├── bin ├── Makefile ├── Makefile.global ├── cleardbdir │ ├── Makefile │ └── cleardbdir.sh ├── createdb │ ├── Makefile │ └── createdb.sh ├── createuser │ ├── Makefile │ └── createuser.sh ├── destroydb │ ├── Makefile │ └── destroydb.sh ├── destroyuser │ ├── Makefile │ └── destroyuser.sh ├── fsutils │ ├── Makefile │ ├── Makefile.global │ ├── icopy │ │ ├── Makefile │ │ └── icopy.c │ ├── pcat │ │ ├── Makefile │ │ └── pcat.c │ ├── pcd │ │ ├── Makefile │ │ ├── aliases.csh │ │ └── pcd.c │ ├── pls │ │ ├── Makefile │ │ ├── cdefs.h │ │ ├── cmp.c │ │ ├── extern.h │ │ ├── fts.c │ │ ├── fts.h │ │ ├── ls.1 │ │ ├── ls.c │ │ ├── ls.h │ │ ├── print.c │ │ ├── pwcache.c │ │ └── util.c │ ├── pmkdir │ │ ├── Makefile │ │ ├── pmkdir.c │ │ └── strerror.c │ ├── pmv │ │ ├── Makefile │ │ ├── pathnames.h │ │ └── pmv.c │ ├── ppwd │ │ ├── Makefile │ │ └── ppwd.c │ ├── prm │ │ ├── Makefile │ │ └── prm.c │ └── prmdir │ │ ├── Makefile │ │ └── prmdir.c ├── initdb │ ├── Makefile │ └── initdb.sh ├── ipcclean │ ├── Makefile │ ├── aix │ │ └── ipcclean.sh │ ├── alpha │ │ └── ipcclean.sh │ ├── hpux │ │ └── ipcclean.sh │ ├── sparc │ │ └── ipcclean.sh │ ├── sparc_solaris │ │ └── ipcclean.sh │ └── ultrix4 │ │ └── ipcclean.sh ├── monitor │ ├── Makefile │ └── monitor.c ├── newbki │ ├── Makefile │ └── newbki.sh ├── pagedoc │ ├── Makefile │ └── pagedoc.c ├── pg_id │ ├── Makefile │ └── pg_id.c ├── pg_ufp │ └── Makefile ├── pg_version │ ├── Makefile │ └── pg_version.c ├── reindexdb │ ├── Makefile │ └── reindexdb.sh ├── s2kutils │ ├── Makefile │ ├── Makefile.global │ ├── s2kdestroy │ │ ├── Makefile │ │ └── s2kdestroy.sh │ ├── s2kinit │ │ ├── Makefile │ │ └── s2kinit.sh │ └── s2klist │ │ ├── Makefile │ │ └── s2klist.sh ├── shmemdoc │ ├── Makefile │ ├── shmemdoc.c │ ├── shmemipc.h │ └── shmemipci.h └── vacuum │ ├── Makefile │ └── vacuum.sh ├── contrib ├── Makefile ├── Makefile.global ├── README ├── cplusplus │ ├── Makefile │ ├── README │ ├── pg.h │ ├── pgtest.c │ └── sample.pgtest.out ├── pgperl │ ├── Makefile │ ├── README │ ├── pg-libpq.mus │ ├── sample-testlibpq.out │ ├── testlibpq.pl │ └── usersub.c ├── relshow │ ├── Makefile │ ├── README │ └── relshow.c ├── spog │ ├── Makefile │ ├── README │ ├── command.c │ ├── pg_edit.1 │ ├── pg_edit.sh │ ├── pg_info.1 │ ├── pg_info.sh │ ├── query.c │ ├── spog.1 │ ├── spog.c │ └── spog.h └── xposthelp │ ├── Makefile │ ├── PostgresRoutines.c │ ├── README │ ├── posthelp.c │ ├── xposthelp.c │ ├── xposthelp.h │ └── xposthelp.icon ├── doc ├── Makefile ├── Makefile.global ├── README ├── implementation │ ├── Makefile │ ├── README │ ├── am.me │ ├── array.me │ ├── fastpath.me │ ├── fmgr.me │ ├── libpq.me │ ├── parse-tree.me │ ├── query-tree.me │ └── smgr.me ├── postgres-setup.me ├── postgres.faq ├── release4.2.me ├── source-tree.me ├── useful │ ├── aix-advlink.ps │ ├── aix-linking.ps │ └── kerberos.faq └── user_manual │ ├── Makefile │ ├── manual-arch.fig │ ├── manual-er.fig │ ├── manual-files.fig │ └── manual.me ├── examples ├── README ├── chapter10 ├── chapter11 ├── chapter13 ├── chapter15 ├── chapter5 ├── chapter6 ├── chapter8 ├── chapter9 ├── circle.c ├── int4_abs.c ├── makefile.aix ├── makefile.hpux ├── makefile.osf1 ├── makefile.solaris ├── makefile.sunos └── makefile.ultrix4 ├── grepsrc ├── libpq ├── Makefile ├── README ├── fe-dumpdata.c ├── fe-pqexec.c ├── fe-pqstubs.c ├── fe-pqufs.c └── fsextension ├── pci ├── ref ├── Makefile ├── built-in.3pqsrc ├── catalogs.3pqsrc ├── fastpath.3pqsrc ├── files │ ├── bki.5src │ ├── files.5src │ ├── information.5src │ ├── page.5src │ ├── page.pic │ ├── template.5src │ └── unfsd_exports.5src ├── index.me ├── introduction ├── large_objects.3pqsrc ├── libpq.3pqsrc ├── make_kwtab ├── make_optab ├── postquel │ ├── abort.cmdsrc │ ├── addattr.cmdsrc │ ├── append.cmdsrc │ ├── attachas.cmdsrc │ ├── begin.cmdsrc │ ├── binary.tbl │ ├── change_acl.cmdsrc │ ├── close.cmdsrc │ ├── cluster.cmdsrc │ ├── copy.cmdsrc │ ├── create.cmdsrc │ ├── create_version.cmdsrc │ ├── createdb.cmdsrc │ ├── define_aggregate.cmdsrc │ ├── define_function.cmdsrc │ ├── define_index.cmdsrc │ ├── define_operator.cmdsrc │ ├── define_rule.cmdsrc │ ├── define_type.cmdsrc │ ├── define_view.cmdsrc │ ├── delete.cmdsrc │ ├── destroy.cmdsrc │ ├── destroydb.cmdsrc │ ├── end.cmdsrc │ ├── extend_index.cmdsrc │ ├── fetch.cmdsrc │ ├── left_unary.tbl │ ├── listen.cmdsrc │ ├── load.cmdsrc │ ├── merge.cmdsrc │ ├── move.cmdsrc │ ├── notify.cmdsrc │ ├── postquel.cmdsrc │ ├── purge.cmdsrc │ ├── remove_aggregate.cmdsrc │ ├── remove_function.cmdsrc │ ├── remove_index.cmdsrc │ ├── remove_operator.cmdsrc │ ├── remove_rule.cmdsrc │ ├── remove_type.cmdsrc │ ├── remove_view.cmdsrc │ ├── rename.cmdsrc │ ├── replace.cmdsrc │ ├── retrieve.cmdsrc │ ├── right_unary.tbl │ └── vacuum.cmdsrc ├── references ├── tmac.an.nr ├── tmac.an.old ├── tmac.an.tr ├── toc └── unix │ ├── createdb.1src │ ├── createuser.1src │ ├── destroydb.1src │ ├── destroyuser.1src │ ├── icopy.1src │ ├── initdb.1src │ ├── ipcclean.1src │ ├── monitor.1src │ ├── newbki.1src │ ├── pagedoc.1src │ ├── pcat.1src │ ├── pcd.1src │ ├── pls.1src │ ├── pmkdir.1src │ ├── pmv.1src │ ├── postgres.1src │ ├── postmaster.1src │ ├── ppwd.1src │ ├── prm.1src │ ├── prmdir.1src │ ├── reindexdb.1src │ ├── s2kutils.1src │ ├── shmemdoc.1src │ ├── unix.1src │ └── vacuum.1src ├── regress ├── Makefile ├── Makefile.global ├── data │ ├── dept.data │ ├── desc.data │ ├── emp.data │ ├── hash.data │ ├── onek.data │ ├── person.data │ ├── real_city.data │ ├── rect.data │ ├── streets.data │ ├── stud_emp.data │ ├── student.data │ └── tenk.data ├── multi │ ├── README │ ├── lookcook.awk │ ├── pgcook.pl │ └── sinval.pl └── regress │ ├── Makefile │ ├── aportal.c │ ├── aportalappend.source │ ├── aportalcreate.source │ ├── aportaltest.source │ ├── checkdiff │ ├── create.source │ ├── destroy.source │ ├── errors.source │ ├── fstest.source │ ├── iportal.c │ ├── queries.source │ ├── regress.c │ ├── regress.sh │ ├── sample.regress.out │ ├── ufp1.c │ ├── ufp2.c │ └── ufp3.c └── tools ├── Makefile ├── Makefile.global ├── bmake ├── Bootstrap ├── Makefile ├── Makefile.boot ├── WARNING ├── arch.c ├── bit.h ├── buf.c ├── buf.h ├── compat.c ├── cond.c ├── config.h ├── dir.c ├── doc │ ├── Makefile │ ├── pmake.1 │ ├── tmac.ansp │ └── tutorial.ms ├── hash.c ├── hash.h ├── job.c ├── job.h ├── list.h ├── lst.h ├── lst.lib │ ├── lstAppend.c │ ├── lstAtEnd.c │ ├── lstAtFront.c │ ├── lstClose.c │ ├── lstConcat.c │ ├── lstDatum.c │ ├── lstDeQueue.c │ ├── lstDestroy.c │ ├── lstDupl.c │ ├── lstEnQueue.c │ ├── lstFind.c │ ├── lstFindFrom.c │ ├── lstFirst.c │ ├── lstForEach.c │ ├── lstForEachFrom.c │ ├── lstInit.c │ ├── lstInsert.c │ ├── lstInt.h │ ├── lstIsAtEnd.c │ ├── lstIsEmpty.c │ ├── lstLast.c │ ├── lstMember.c │ ├── lstNext.c │ ├── lstOpen.c │ ├── lstRemove.c │ ├── lstReplace.c │ └── lstSucc.c ├── main.c ├── make.1 ├── make.c ├── make.h ├── mk-proto │ ├── postgres.global.mk │ ├── postgres.lib.mk │ ├── postgres.man.mk │ ├── postgres.prog.mk │ ├── postgres.shell.mk │ ├── postgres.sub.mk │ ├── postgres.subdir.mk │ └── sys.mk ├── nonints.h ├── parse.c ├── pathnames.h ├── setenv.c ├── sprite.h ├── str.c ├── strdup.c ├── strerror.c ├── suff.c ├── targ.c └── var.c ├── bmkdir ├── Makefile └── bmkdir.c ├── bsdinst ├── Makefile ├── README └── bsdinst.sh ├── libdl ├── COPYRIGHT ├── Makefile ├── README ├── dl.h ├── dlArch.c ├── dlInterf.c ├── dlPriv.h ├── dlRef.c ├── dlReloc.c ├── man │ ├── dl_misc.3 │ └── dl_open.3 └── test │ ├── README │ ├── a.c │ ├── abc.OUT │ ├── abc.c │ ├── b.c │ ├── bar.c │ ├── baz.c │ ├── c.c │ ├── call_mf.OUT │ ├── call_mf.c │ ├── foo.c │ ├── jumbo.OUT │ ├── jumbo.c │ ├── jumboobj.c │ ├── main.OUT │ ├── main.c │ ├── makefile │ └── mathfunc.c ├── mkdep ├── Makefile ├── README └── mkdep.sh ├── mkldexport ├── Makefile └── mkldexport.sh └── solcc └── solcc /COPYRIGHT: -------------------------------------------------------------------------------- 1 | POSTGRES Data Base Management System 2 | 3 | Copyright (c) 1989 Regents of the University of California 4 | 5 | Permission to use, copy, modify, and distribute this software and its 6 | documentation for educational, research, and non-profit purposes and 7 | without fee is hereby granted, provided that the above copyright 8 | notice appear in all copies and that both that copyright notice and 9 | this permission notice appear in supporting documentation, and that 10 | the name of the University of California not be used in advertising 11 | or publicity pertaining to distribution of the software without 12 | specific, written prior permission. Permission to incorporate this 13 | software into commercial products can be obtained from the Campus 14 | Software Office, 295 Evans Hall, University of California, Berkeley, 15 | Ca., 94720. The University of California makes no representations 16 | about the suitability of this software for any purpose. It is 17 | provided "as is" without express or implied warranty. 18 | 19 | 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Use bmake(1) to run this Makefile. 3 | # 4 | SUBDIR= src 5 | 6 | .include 7 | -------------------------------------------------------------------------------- /Makefile.global: -------------------------------------------------------------------------------- 1 | # This exists so the obj/Makefile.global in this 2 | # directory (if it exists) is included. 3 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | March 1994 2 | 3 | This is release 4.2 of POSTGRES. 4 | 5 | The source code for the system is contained under the src/ directory, 6 | the reference manual is under ref/, and the user manual, installation 7 | guide and release notes are under doc/. 8 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Build and install postgres. 3 | # 4 | # You have to cd into doc/ and ref/ by hand to make them. They are 5 | # not done automatically because they depend on groff, which you may not 6 | # have installed. 7 | # Formatted copies of the documents are already made in ../{doc,ref} 8 | # for you. 9 | # 10 | 11 | SUBDIR= backend libpq bin regress 12 | 13 | .include 14 | -------------------------------------------------------------------------------- /src/backend/access/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include "${.CURDIR}/access/common/Makefile.inc" 5 | .include "${.CURDIR}/access/hash/Makefile.inc" 6 | .include "${.CURDIR}/access/heap/Makefile.inc" 7 | .include "${.CURDIR}/access/index/Makefile.inc" 8 | .include "${.CURDIR}/access/index-rtree/Makefile.inc" 9 | .include "${.CURDIR}/access/nbtree/Makefile.inc" 10 | # the nobtree code is all #ifdef'd out anyway 11 | #.include "${.CURDIR}/access/nobtree/Makefile.inc" 12 | .include "${.CURDIR}/access/transam/Makefile.inc" 13 | 14 | .PATH: ${.CURDIR}/access 15 | 16 | HEADERS+= att.h attnum.h attval.h \ 17 | btree-externs.h btree.h ftup.h funcindex.h \ 18 | genam.h hash.h heapam.h hio.h hrnd.h htup.h ibit.h imark.h iqual.h \ 19 | isop.h istrat.h itup.h nbtree.h \ 20 | nobtree.h printtup.h relscan.h rtree.h rulescan.h sdir.h \ 21 | skey.h tqual.h transam.h tupdesc.h tupmacs.h valid.h \ 22 | xact.h xlog.h xtim.h 23 | -------------------------------------------------------------------------------- /src/backend/access/att.h: -------------------------------------------------------------------------------- 1 | /* 2 | * att.h -- 3 | * POSTGRES attribute definitions. 4 | */ 5 | 6 | #ifndef AttIncluded /* Include this file only once */ 7 | #define AttIncluded 1 8 | 9 | /* 10 | * Identification: 11 | */ 12 | #define ATT_H "$Header$" 13 | 14 | #include "tmp/c.h" 15 | #include "access/skey.h" /* just to reduce levels of #include */ 16 | #include "catalog/pg_attribute.h" 17 | 18 | typedef AttributeTupleForm Attribute; 19 | 20 | typedef Attribute *AttributePtr; 21 | 22 | /* 23 | * AttributeIsValid 24 | * True iff the attribute is valid. 25 | */ 26 | #define AttributeIsValid(attribute) PointerIsValid(attribute) 27 | 28 | #endif /* !defined(AttIncluded) */ 29 | -------------------------------------------------------------------------------- /src/backend/access/attval.h: -------------------------------------------------------------------------------- 1 | /* 2 | * attval.h -- 3 | * POSTGRES attribute value definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef AttValIncluded /* Include this file only once. */ 10 | #define AttValIncluded 1 11 | 12 | #include "tmp/postgres.h" 13 | 14 | typedef Datum AttributeValue; 15 | 16 | #include "access/attnum.h" 17 | #include "access/htup.h" 18 | #include "access/itup.h" 19 | #include "access/tupdesc.h" 20 | 21 | /* ---------------- 22 | * support macros 23 | * ---------------- 24 | */ 25 | 26 | /* 27 | * AMgetattr -- 28 | */ 29 | #define AMgetattr(tuple, attNum, tupleDescriptor, isNullOutP) \ 30 | index_getattr(tuple, attNum, tupleDescriptor, isNullOutP) 31 | 32 | /* ---------------- 33 | * extern decls 34 | * ---------------- 35 | */ 36 | 37 | /* 38 | * IndexTupleGetAttributeValue 39 | * Returns the value of an index tuple attribute. 40 | */ 41 | extern 42 | AttributeValue 43 | IndexTupleGetAttributeValue ARGS(( 44 | IndexTuple tuple, 45 | AttributeNumber attributeNumber, 46 | TupleDescriptor tupleDescriptor, 47 | Boolean *isNullOutP 48 | )); 49 | 50 | #endif /* !defined(AttValIncluded) */ 51 | -------------------------------------------------------------------------------- /src/backend/access/common/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/common 6 | 7 | # attr.c: OBSOLETE 8 | 9 | SRCS+= heaptuple.c heapvalid.c indextuple.c indexvalid.c printtup.c \ 10 | scankey.c tupdesc.c 11 | -------------------------------------------------------------------------------- /src/backend/access/hash/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/hash 6 | 7 | SRCS+= hash.c hashfunc.c hashinsert.c hashovfl.c hashpage.c hashscan.c \ 8 | hashsearch.c hashstrat.c hashutil.c 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/backend/access/heap/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .PATH: ${.CURDIR}/access/heap 5 | 6 | SRCS+= heapam.c hio.c hrnd.c localam.c rac.c stats.c 7 | -------------------------------------------------------------------------------- /src/backend/access/ibit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ibit.h -- 3 | * POSTGRES index valid attribute bit map definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef IBitIncluded /* Include this file only once. */ 10 | #define IBitIncluded 1 11 | 12 | #include "tmp/c.h" 13 | #include "utils/memutils.h" 14 | 15 | typedef struct IndexAttributeBitMapData { 16 | char bits[(MaxIndexAttributeNumber + MaxBitsPerByte - 1) 17 | / MaxBitsPerByte]; 18 | } IndexAttributeBitMapData; 19 | 20 | typedef IndexAttributeBitMapData *IndexAttributeBitMap; 21 | 22 | #define IndexAttributeBitMapSize sizeof(IndexAttributeBitMapData) 23 | 24 | /* 25 | * IndexAttributeBitMapIsValid -- 26 | * True iff attribute bit map is valid. 27 | */ 28 | #define IndexAttributeBitMapIsValid(bits) PointerIsValid(bits) 29 | 30 | #endif /* !defined(IBitIncluded) */ 31 | -------------------------------------------------------------------------------- /src/backend/access/index-rtree/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/index-rtree 6 | 7 | SRCS+= rtget.c rtproc.c rtree.c rtscan.c rtstrat.c 8 | -------------------------------------------------------------------------------- /src/backend/access/index/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/index 6 | 7 | SRCS+= genam.c indexam.c istrat.c 8 | -------------------------------------------------------------------------------- /src/backend/access/nbtree/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/nbtree 6 | 7 | SRCS+= nbtcompare.c nbtinsert.c nbtpage.c nbtree.c nbtscan.c nbtsearch.c \ 8 | nbtstrat.c nbtutils.c 9 | -------------------------------------------------------------------------------- /src/backend/access/nobtree/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/nobtree 6 | 7 | SRCS+= nobtcompare.c nobtinsert.c nobtpage.c nobtree.c nobtscan.c \ 8 | nobtsearch.c nobtstrat.c nobtutils.c 9 | -------------------------------------------------------------------------------- /src/backend/access/nobtree/README: -------------------------------------------------------------------------------- 1 | $Header$ 2 | 3 | This is an implementation of ``No-Overwrite B-trees'' (actually B-link 4 | tree, ala Lehman and Yao) written by Mark Sullivan and Mike Olson. 5 | The algorithms are described in: 6 | 7 | Sullivan, M.; Olson, M. 8 | An index implementation supporting fast recovery for the POSTGRES storage 9 | system. 10 | Proceedings of the Eighth International Conference on Data 11 | Engineering, Tempe, AZ, USA, Feb. 1992, p. 293-300. 12 | 13 | You are hereby warned that it hasn't been compiled, let alone run, in 14 | quite some time. 15 | -------------------------------------------------------------------------------- /src/backend/access/printtup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * printtup.h -- 3 | * 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef PrintTupIncluded /* Include this file only once */ 10 | #define PrintTupIncluded 1 11 | 12 | extern void printtup ARGS((HeapTuple tuple, struct attribute *typeinfo[])); 13 | extern void printtup_internal ARGS((HeapTuple tuple, struct attribute *typeinfo[])); 14 | extern void debugtup ARGS((HeapTuple tuple, struct attribute *typeinfo[])); 15 | 16 | #endif /* !defined(PrintTupIncluded) */ 17 | -------------------------------------------------------------------------------- /src/backend/access/transam/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/access/transam 6 | 7 | SRCS+= transam.c transsup.c varsup.c xact.c 8 | -------------------------------------------------------------------------------- /src/backend/access/xtim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * xtim.h -- 3 | * POSTGRES transaction time definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef XTimIncluded /* Include this file only once. */ 10 | #define XTimIncluded 1 11 | 12 | #include "utils/nabstime.h" 13 | 14 | /* 15 | * TransactionIdGetCommitTime -- 16 | * Returns commit time of transaction associated with an identifier. 17 | * 18 | * Note: 19 | * Assumes transaction identifier is valid. 20 | */ 21 | extern 22 | AbsoluteTime 23 | TransactionIdGetCommitTime ARGS(( 24 | TransactionId transactionId 25 | )); 26 | 27 | #endif /* !defined(XTimIncluded) */ 28 | -------------------------------------------------------------------------------- /src/backend/bootstrap/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # Another kinda weird Makefile.inc cause we need two 3 | # scanner/parsers in the backend and most yaccs and lexs 4 | # don't have the prefix option. 5 | # 6 | # sed files are HACK CITY! - redo... 7 | # 8 | # $Header$ 9 | # 10 | BD= ${.CURDIR}/bootstrap 11 | 12 | .PATH: ${BD} 13 | 14 | BOOTYACCS= bootstrap.h bootparse.c 15 | 16 | SRCS+= socket.c bootstrap.c bootparse.c bootscanner.c 17 | 18 | ${BOOTYACCS}: bootparse.y 19 | ${YACC} ${YFLAGS} ${BD}/bootparse.y; \ 20 | sed -f ${BD}/boot.sed < y.tab.c > bootparse.c; \ 21 | mv y.tab.h bootstrap.h; \ 22 | rm -f y.tab.c 23 | 24 | bootscanner.c: bootscanner.lex 25 | lex ${BD}/bootscanner.lex; \ 26 | sed -f ${BD}/boot.sed < lex.yy.c > bootscanner.c; \ 27 | rm -f lex.yy.c 28 | 29 | # 30 | # The following insures that y.tab.h gets made as bootstrap.c 31 | # includes it 32 | # 33 | bootstrap.o: ${BOOTYACCS} 34 | 35 | .depend: bootparse.c bootscanner.c 36 | 37 | CLEANFILES+= bootscanner.c ${BOOTYACCS} y.tab.h y.output 38 | 39 | HEADERS+= bkint.h 40 | -------------------------------------------------------------------------------- /src/backend/bootstrap/boot.sed: -------------------------------------------------------------------------------- 1 | # 2 | # lex.sed - sed rules to remove conflicts between the backend interface 3 | # LEX scanner and the POSTQUEL LEX scanner 4 | # 5 | # $Header$ 6 | # 7 | s/^yy/Int_yy/g 8 | s/\([^a-zA-Z0-9_]\)yy/\1Int_yy/g 9 | -------------------------------------------------------------------------------- /src/backend/catalog/pg_group.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * pg_group.h 4 | * 5 | * DESCRIPTION 6 | * 7 | * NOTES 8 | * 9 | * IDENTIFICATION 10 | * $Header$ 11 | * ---------------------------------------------------------------- 12 | */ 13 | #ifndef PgGroupIncluded 14 | #define PgGroupIncluded 1 /* include this only once */ 15 | 16 | /* ---------------- 17 | * postgres.h contains the system type definintions and the 18 | * CATALOG(), BOOTSTRAP and DATA() sugar words so this file 19 | * can be read by both genbki.sh and the C compiler. 20 | * ---------------- 21 | */ 22 | #include "tmp/postgres.h" 23 | 24 | CATALOG(pg_group) BOOTSTRAP { 25 | char16 groname; 26 | int2 grosysid; 27 | int2 grolist[1]; 28 | } FormData_pg_group; 29 | /* VARIABLE LENGTH STRUCTURE */ 30 | 31 | typedef FormData_pg_group *Form_pg_group; 32 | 33 | #define Name_pg_group "pg_group" 34 | #define Natts_pg_group 1 35 | #define Anum_pg_group_groname 1 36 | #define Anum_pg_group_grosysid 2 37 | #define Anum_pg_group_grolist 3 38 | 39 | #endif PgGroupIncluded 40 | -------------------------------------------------------------------------------- /src/backend/catalog/unused_oids: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # unused_oids 3 | # 4 | # $Header$ 5 | # 6 | # finds blocks of oids that have not already been claimed by 7 | # post_hackers for internal purposes. primarily useful for 8 | # finding valid oids for new internal function oids. the numbers 9 | # printed are inclusive ranges of valid (unused) oids. 10 | # 11 | # before using a large empty block, make sure you aren't about 12 | # to take over what was intended as expansion space for something 13 | # else. also, before using a number, do a "grepsrc" to make sure 14 | # that someone isn't using a literal numeric constant somewhere.. 15 | # 16 | # non-berkeley post_hackers should probably not try to use oids 17 | # less than the highest one that comes with the distributed source. 18 | # 19 | # run this script in src/backend/catalog. 20 | # 21 | egrep '^DATA' pg_*.h | \ 22 | sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \ 23 | sort -n | \ 24 | uniq | \ 25 | awk ' 26 | BEGIN { 27 | last = 0; 28 | } 29 | /^[0-9]/ { 30 | if ($1 > last + 1) { 31 | if ($1 > last + 2) { 32 | print last + 1, "-", $1 - 1; 33 | } else { 34 | print last + 1; 35 | } 36 | } 37 | last = $1; 38 | } 39 | END { 40 | print last + 1, "-"; 41 | }' 42 | -------------------------------------------------------------------------------- /src/backend/commands/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/commands 6 | 7 | SRCS+= async.c command.c copy.c defind.c define.c manip.c purge.c \ 8 | remove.c rename.c vacuum.c version.c view.c 9 | 10 | HEADERS+= command.h copy.h defrem.h manip.h vacuum.h version.h 11 | -------------------------------------------------------------------------------- /src/backend/executor/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .PATH: ${.CURDIR}/executor 5 | 6 | SRCS+= ex_ami.c ex_debug.c ex_flatten.c ex_junk.c ex_main.c ex_procnode.c \ 7 | ex_qual.c ex_scan.c ex_shmem.c ex_tuples.c ex_utils.c functions.c \ 8 | n_aggregate.c n_append.c n_hash.c n_hashjoin.c n_indexscan.c \ 9 | n_material.c n_mergejoin.c n_nestloop.c n_result.c n_scantemps.c \ 10 | n_seqscan.c n_sort.c n_unique.c 11 | 12 | HEADERS+= execdebug.h execdefs.h execdesc.h execmisc.h execshmem.h \ 13 | executor.h externs.h flatten.h hashjoin.h paralleldebug.h \ 14 | tuptable.h x_aggregate.h x_append.h x_debug.h x_eutils.h \ 15 | x_execam.h x_execinit.h x_execmain.h x_execstats.h x_functions.h \ 16 | x_hash.h x_hashjoin.h x_indexscan.h x_junk.h x_material.h \ 17 | x_mergejoin.h x_nestloop.h x_procnode.h x_qual.h x_result.h \ 18 | x_scan.h x_scantemps.h x_seqscan.h x_sort.h x_tuples.h x_unique.h 19 | -------------------------------------------------------------------------------- /src/backend/executor/execshmem.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * execshmem.h 4 | * 5 | * DESCRIPTION 6 | * support for executor allocated shared memory. used by 7 | * wei's slave backend code. 8 | * 9 | * $Header$ 10 | * ---------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef ExecShMemIncluded 14 | #define ExecShMemIncluded 1 15 | 16 | struct memoryheaderdata { 17 | char *beginaddr; 18 | int size; 19 | struct memoryheaderdata *next; 20 | }; 21 | typedef struct memoryheaderdata MemoryHeaderData; 22 | typedef MemoryHeaderData *MemoryHeader; 23 | 24 | /* ex_shmem.c */ 25 | extern char *ExecSMReserve ARGS((int size)); 26 | extern void ExecSMInit ARGS((void)); 27 | extern MemoryHeader ExecGetSMSegment ARGS((void)); 28 | extern void ExecSMSegmentFree ARGS((MemoryHeader mp)); 29 | extern void ExecSMSegmentFreeUnused ARGS((MemoryHeader mp, int usedsize)); 30 | 31 | #endif /* ExecShMemIncluded */ 32 | -------------------------------------------------------------------------------- /src/backend/executor/flatten.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * ex_flatten.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for ex_flatten.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef ex_flattenIncluded /* include this file only once */ 17 | #define ex_flattenIncluded 1 18 | 19 | extern Datum ExecEvalIter ARGS((Iter iterNode, ExprContext econtext, bool *resultIsNull, bool *iterIsDone)); 20 | extern void ExecEvalFjoin ARGS((List tlist, ExprContext econtext, bool *isNullVect, bool *fj_isDone)); 21 | extern bool FjoinBumpOuterNodes ARGS((List tlist, ExprContext econtext, DatumPtr results, String nulls)); 22 | 23 | #endif /* ex_flattenIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/executor/paralleldebug.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * paralleldebug.h 4 | * 5 | * DESCRIPTION 6 | * declarations for parallel debugging purposes 7 | * 8 | * IDENTIFICATION 9 | * $Header$ 10 | * ---------------------------------------------------------------- 11 | */ 12 | 13 | #include 14 | struct paralleldebuginfo { 15 | char name[16]; 16 | int count; 17 | usclk_t time; 18 | usclk_t start_time; 19 | }; 20 | #define PDI_SHAREDLOCK 0 21 | #define PDI_EXCLUSIVELOCK 1 22 | #define PDI_FILEREAD 2 23 | #define PDI_FILESEEK 3 24 | 25 | extern struct paralleldebuginfo ParallelDebugInfo[]; 26 | #define BeginParallelDebugInfo(i) ParallelDebugInfo[i].count++; \ 27 | ParallelDebugInfo[i].start_time=getusclk() 28 | #define EndParallelDebugInfo(i) ParallelDebugInfo[i].time+=getusclk()- \ 29 | ParallelDebugInfo[i].start_time 30 | -------------------------------------------------------------------------------- /src/backend/executor/x_aggregate.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * aggregate.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for aggregate.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef aggregateIncluded /* include this file only once */ 17 | #define aggregateIncluded 1 18 | 19 | extern TupleTableSlot ExecAgg ARGS((Agg node)); 20 | extern List ExecInitAgg ARGS((Agg node, EState estate, Plan parent)); 21 | extern int ExecCountSlotsAgg ARGS((Plan node)); 22 | extern void ExecEndAgg ARGS((Agg node)); 23 | 24 | #endif /* aggregateIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/executor/x_append.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_append.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_append.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_appendIncluded /* include this file only once */ 17 | #define n_appendIncluded 1 18 | 19 | extern List exec_append_initialize_next ARGS((Append node)); 20 | extern List ExecInitAppend ARGS((Append node, EState estate, Plan parent)); 21 | extern int ExecCountSlotsAppend ARGS((Plan node)); 22 | extern TupleTableSlot ExecProcAppend ARGS((Append node)); 23 | extern void ExecEndAppend ARGS((Append node)); 24 | 25 | #endif /* n_appendIncluded */ 26 | -------------------------------------------------------------------------------- /src/backend/executor/x_execinit.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | extern void InitializeExecutor ARGS((void)); 3 | -------------------------------------------------------------------------------- /src/backend/executor/x_execstats.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | extern void ResetTupleCount ARGS((void)); 3 | extern void DisplayTupleCount ARGS((FILE *statfp)); 4 | -------------------------------------------------------------------------------- /src/backend/executor/x_functions.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * functions.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for functions.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef functionsIncluded /* include this file only once */ 17 | #define functionsIncluded 1 18 | 19 | extern Datum ProjectAttribute ARGS((TupleDescriptor TD, List tlist, HeapTuple tup, Boolean *isnullP)); 20 | extern TupleTableSlot copy_function_result ARGS((FunctionCachePtr fcache, TupleTableSlot resultSlot)); 21 | extern Datum postquel_function ARGS((Func funcNode, char *args[], bool *isNull, bool *isDone)); 22 | 23 | #endif /* functionsIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/executor/x_junk.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * ex_junk.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for ex_junk.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef ex_junkIncluded /* include this file only once */ 17 | #define ex_junkIncluded 1 18 | 19 | extern JunkFilter ExecInitJunkFilter ARGS((List targetList)); 20 | extern bool ExecGetJunkAttribute ARGS((JunkFilter junkfilter, TupleTableSlot slot, Name attrName, Datum *value, Boolean *isNull)); 21 | extern HeapTuple ExecRemoveJunk ARGS((JunkFilter junkfilter, TupleTableSlot slot)); 22 | 23 | #endif /* ex_junkIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/executor/x_material.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_material.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_material.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_materialIncluded /* include this file only once */ 17 | #define n_materialIncluded 1 18 | 19 | extern TupleTableSlot ExecMaterial ARGS((Material node)); 20 | extern List ExecInitMaterial ARGS((Material node, EState estate, Plan parent)); 21 | extern int ExecCountSlotsMaterial ARGS((Plan node)); 22 | extern void ExecEndMaterial ARGS((Material node)); 23 | extern List ExecMaterialMarkPos ARGS((Material node)); 24 | extern void ExecMaterialRestrPos ARGS((Material node)); 25 | 26 | #endif /* n_materialIncluded */ 27 | -------------------------------------------------------------------------------- /src/backend/executor/x_nestloop.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_nestloop.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_nestloop.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_nestloopIncluded /* include this file only once */ 17 | #define n_nestloopIncluded 1 18 | 19 | extern TupleTableSlot ExecNestLoop ARGS((NestLoop node)); 20 | extern List ExecInitNestLoop ARGS((NestLoop node, EState estate, Plan parent)); 21 | extern int ExecCountSlotsNestLoop ARGS((Plan node)); 22 | extern List ExecEndNestLoop ARGS((NestLoop node)); 23 | 24 | #endif /* n_nestloopIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/executor/x_procnode.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * ex_procnode.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for ex_procnode.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef ex_procnodeIncluded /* include this file only once */ 17 | #define ex_procnodeIncluded 1 18 | 19 | extern List ExecInitNode ARGS((Plan node, EState estate, Plan parent)); 20 | extern TupleTableSlot ExecProcNode ARGS((Plan node)); 21 | extern int ExecCountSlotsNode ARGS((Plan node)); 22 | extern void ExecEndNode ARGS((Plan node)); 23 | 24 | #endif /* ex_procnodeIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/executor/x_result.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_result.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_result.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_resultIncluded /* include this file only once */ 17 | #define n_resultIncluded 1 18 | 19 | extern TupleTableSlot ExecResult ARGS((Result node)); 20 | extern List ExecInitResult ARGS((Plan node, EState estate, Plan parent)); 21 | extern int ExecCountSlotsResult ARGS((Plan node)); 22 | extern void ExecEndResult ARGS((Result node)); 23 | 24 | #endif /* n_resultIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/executor/x_scan.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * ex_scan.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for ex_scan.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef ex_scanIncluded /* include this file only once */ 17 | #define ex_scanIncluded 1 18 | 19 | extern TupleTableSlot ExecScan ARGS((Scan node, Pointer (*accessMtd)())); 20 | 21 | #endif /* ex_scanIncluded */ 22 | -------------------------------------------------------------------------------- /src/backend/executor/x_scantemps.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_scantemps.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_scantemps.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_scantempsIncluded /* include this file only once */ 17 | #define n_scantempsIncluded 1 18 | 19 | extern TupleTableSlot ExecScanTemps ARGS((ScanTemps node)); 20 | extern List ExecInitScanTemps ARGS((ScanTemps node, EState estate, Plan parent)); 21 | extern int ExecCountSlotsScanTemps ARGS((Plan node)); 22 | extern void ExecEndScanTemps ARGS((ScanTemps node)); 23 | 24 | #endif /* n_scantempsIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/executor/x_seqscan.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_seqscan.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_seqscan.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_seqscanIncluded /* include this file only once */ 17 | #define n_seqscanIncluded 1 18 | 19 | extern TupleTableSlot SeqNext ARGS((SeqScan node)); 20 | extern TupleTableSlot ExecSeqScan ARGS((SeqScan node)); 21 | extern ObjectId InitScanRelation ARGS((Plan node, EState estate, ScanState scanstate, Plan outerPlan)); 22 | extern List ExecInitSeqScan ARGS((Plan node, EState estate, Plan parent)); 23 | extern int ExecCountSlotsSeqScan ARGS((Plan node)); 24 | extern void ExecEndSeqScan ARGS((SeqScan node)); 25 | extern void ExecSeqReScan ARGS((Plan node)); 26 | extern List ExecSeqMarkPos ARGS((Plan node)); 27 | extern void ExecSeqRestrPos ARGS((Plan node)); 28 | 29 | #endif /* n_seqscanIncluded */ 30 | -------------------------------------------------------------------------------- /src/backend/executor/x_sort.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_sort.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_sort.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_sortIncluded /* include this file only once */ 17 | #define n_sortIncluded 1 18 | 19 | extern Pointer FormSortKeys ARGS((Sort sortnode)); 20 | extern TupleTableSlot ExecSort ARGS((Sort node)); 21 | extern List ExecInitSort ARGS((Sort node, EState estate, Plan parent)); 22 | extern int ExecCountSlotsSort ARGS((Plan node)); 23 | extern void ExecEndSort ARGS((Sort node)); 24 | extern List ExecSortMarkPos ARGS((Plan node)); 25 | extern void ExecSortRestrPos ARGS((Plan node)); 26 | 27 | #endif /* n_sortIncluded */ 28 | -------------------------------------------------------------------------------- /src/backend/executor/x_unique.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * n_unique.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for n_unique.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef n_uniqueIncluded /* include this file only once */ 17 | #define n_uniqueIncluded 1 18 | 19 | extern bool ExecIdenticalTuples ARGS((List t1, List t2)); 20 | extern TupleTableSlot ExecUnique ARGS((Unique node)); 21 | extern List ExecInitUnique ARGS((Unique node, EState estate, Plan parent)); 22 | extern int ExecCountSlotsUnique ARGS((Plan node)); 23 | extern void ExecEndUnique ARGS((Unique node)); 24 | 25 | #endif /* n_uniqueIncluded */ 26 | -------------------------------------------------------------------------------- /src/backend/lib/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/lib 6 | 7 | SRCS+= atoms.c bit.c copyfuncs.c equalfuncs.c fcache.c fstack.c \ 8 | hasht.c lispdep.c lisplist.c lispread.c lispsort.c \ 9 | lsyscache.c nodeFuncs.c nodes.c oset.c outfuncs.c \ 10 | qsort.c readfuncs.c simplelists.c stringinfo.c \ 11 | utilities.c xid.c 12 | 13 | HEADERS+= catalog.h equalfuncs.h index.h lispread.h outfuncs.h \ 14 | copyfuncs.h heap.h lisplist.h lispsort.h readfuncs.h 15 | 16 | -------------------------------------------------------------------------------- /src/backend/lib/catalog.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------ 2 | * FILE 3 | * catalog.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for functions in lib/catalog/catalog.c 7 | * 8 | * IDENTIFICATION 9 | * $Header$ 10 | * ------------------------------------------- 11 | */ 12 | #ifndef LIBCATALOGINCLUDED 13 | #define LIBCATALOGINCLUDED 14 | /* catalog.c */ 15 | char *relpath ARGS((char relname [])); 16 | bool issystem ARGS((char relname [])); 17 | bool NameIsSystemRelationName ARGS((Name name )); 18 | bool NameIsSharedSystemRelationName ARGS((Name relname )); 19 | ObjectId newoid ARGS((void )); 20 | int fillatt ARGS((int natts , AttributeTupleForm att [])); 21 | #endif 22 | -------------------------------------------------------------------------------- /src/backend/lib/hasht.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hasht.c -- 3 | * hash table related functions that are not directly supported 4 | * by the hashing packages under utils/hash. 5 | * 6 | */ 7 | 8 | #include "tmp/c.h" 9 | 10 | RcsId("$Header$"); 11 | 12 | #include "utils/memutils.h" 13 | #include "utils/log.h" 14 | #include "utils/hsearch.h" 15 | 16 | /* ----------------------------------- 17 | * HashTableWalk 18 | * 19 | * call function on every element in hashtable 20 | * one extra argument, arg may be supplied 21 | * ----------------------------------- 22 | */ 23 | void 24 | HashTableWalk(hashtable, function, arg) 25 | HTAB *hashtable; 26 | void (*function)(); 27 | int arg; 28 | { 29 | long *hashent; 30 | long *data; 31 | int keysize; 32 | 33 | keysize = hashtable->hctl->keysize; 34 | (void)hash_seq((HTAB *)NULL); 35 | while ((hashent = hash_seq(hashtable)) != (long *) TRUE) { 36 | if (hashent == NULL) 37 | elog(FATAL, "error in HashTableWalk."); 38 | /* 39 | * XXX the corresponding hash table insertion does NOT 40 | * LONGALIGN -- make sure the keysize is ok 41 | */ 42 | data = (long *) LONGALIGN((char*) hashent + keysize); 43 | (*function)(data, arg); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/backend/lib/lisplist.c: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | 3 | #include 4 | #include "nodes/pg_lisp.h" 5 | 6 | /* 7 | * lispList will take a list of "valid" lispValues 8 | * and produce a pg_lisp list 9 | * NOTE: terminates on first "-1" it finds. 10 | * e.g. lispList ( lispAtom("foo"), lispString("bar"), -1 , x ) 11 | * will produce ( foo "bar" ) 12 | */ 13 | 14 | LispValue 15 | MakeList ( va_alist ) 16 | va_dcl 17 | { 18 | va_list args; 19 | List retval = LispNil; 20 | List temp = LispNil; 21 | List tempcons = LispNil; 22 | 23 | va_start(args); 24 | 25 | while ((temp = va_arg(args, LispValue)) != (LispValue) -1) { 26 | temp = lispCons ( temp, LispNil ); 27 | if ( tempcons == LispNil ) 28 | retval = temp; 29 | else 30 | CDR(tempcons) = temp; 31 | tempcons = temp; 32 | } 33 | 34 | va_end(args); 35 | 36 | return ( retval ); 37 | } 38 | -------------------------------------------------------------------------------- /src/backend/lib/lisplist.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | /* lisplist.c */ 3 | extern LispValue MakeList(/* LispValue, ... */); 4 | -------------------------------------------------------------------------------- /src/backend/lib/lispread.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------ 2 | * FILE 3 | * lispread.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for functions in lib/C/lispread.c 7 | * 8 | * IDENTIFICATION 9 | * $Header$ 10 | * ------------------------------------------- 11 | */ 12 | 13 | #ifndef LISPREAD_H 14 | #define LISPREAD_H 15 | NodeTag lispTokenType ARGS((char *token , int length )); 16 | LispValue lispRead ARGS((bool read_car_only )); 17 | char *lsptok ARGS((char *string , int *length )); 18 | LispValue lispReadStringWithParams ARGS((char *string , ParamListInfo *thisParamListP )); 19 | LispValue lispReadString ARGS((char *string )); 20 | #endif LISPREAD_H 21 | -------------------------------------------------------------------------------- /src/backend/lib/lispsort.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | extern LispValue lisp_qsort ARGS((LispValue list, /* the list to be sorted */ 3 | int (*compare)())); /* function to compare 4 | two nodes */ 5 | -------------------------------------------------------------------------------- /src/backend/libpq/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | # 6 | # The frontend libpq interfaces to the backend through these files. 7 | # 8 | .PATH: ${.CURDIR}/libpq 9 | 10 | SRCS+= be-dumpdata.c be-fsstubs.c be-pqexec.c 11 | 12 | # 13 | # These files are shared with the frontend library. 14 | # 15 | SRCS+= auth.c pqcomm.c portal.c portalbuf.c pqpacket.c pqsignal.c 16 | HEADERS+= auth.h pqsignal.h 17 | -------------------------------------------------------------------------------- /src/backend/libpq/pqsignal.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * pqsignal.c 4 | * 5 | * DESCRIPTION 6 | * reliable BSD-style signal(2) routine 7 | * stolen from RWW who stole it from Stevens... 8 | * 9 | * NOTES 10 | * This shouldn't be in libpq, but the monitor and some other 11 | * things need it... 12 | * 13 | * IDENTIFICATION 14 | * $Header$ 15 | * ---------------------------------------------------------------- 16 | */ 17 | 18 | #include "libpq/pqsignal.h" 19 | 20 | pqsigfunc 21 | pqsignal(signo, func) 22 | int signo; 23 | pqsigfunc func; 24 | { 25 | #if defined(USE_POSIX_SIGNALS) 26 | struct sigaction act, oact; 27 | 28 | act.sa_handler = func; 29 | sigemptyset(&act.sa_mask); 30 | act.sa_flags = 0; 31 | if (signo != SIGALRM) { 32 | act.sa_flags |= SA_RESTART; 33 | } 34 | if (sigaction(signo, &act, &oact) < 0) 35 | return(SIG_ERR); 36 | return(oact.sa_handler); 37 | #else /* !USE_POSIX_SIGNALS */ 38 | Assert(0); 39 | #endif /* !USE_POSIX_SIGNALS */ 40 | } 41 | -------------------------------------------------------------------------------- /src/backend/libpq/pqsignal.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * pqsignal.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for the reliable BSD-style signal(2) routine. 7 | * 8 | * NOTES 9 | * This shouldn't be in libpq, but the monitor and some other 10 | * things need it... 11 | * 12 | * IDENTIFICATION 13 | * $Header$ 14 | * ---------------------------------------------------------------- 15 | */ 16 | 17 | #ifndef pqsignalIncluded /* include this file only once */ 18 | #define pqsignalIncluded 1 19 | 20 | #include 21 | 22 | #include "tmp/c.h" 23 | 24 | typedef void (*pqsigfunc) ARGS((int)); 25 | 26 | extern pqsigfunc pqsignal ARGS((int signo, pqsigfunc func)); 27 | 28 | #if defined(USE_POSIX_SIGNALS) 29 | #define signal(signo, handler) pqsignal(signo, (pqsigfunc) handler) 30 | #endif /* USE_POSIX_SIGNALS */ 31 | 32 | #endif /* pqsignalIncluded */ 33 | -------------------------------------------------------------------------------- /src/backend/main/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/main 6 | 7 | SRCS+= main.c 8 | -------------------------------------------------------------------------------- /src/backend/makeID: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | 6 | if test $# -ne 1; then 7 | echo "usage: $0 PORTNAME" 8 | exit 1 9 | fi 10 | PORTNAME=$1 11 | 12 | gfind . obj/. port/$PORTNAME \( -name obj -o -name port \) -prune -o \( -name '*.[ch]' -o -name '*.gen' \) -type f -print | mkid -S.gen=c - 2>&1 | grep -v 'No scanner for language' 13 | exit 0 14 | -------------------------------------------------------------------------------- /src/backend/parser/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | PARSED= ${.CURDIR}/parser 5 | 6 | .PATH: ${PARSED} 7 | 8 | PARSEYACCS= gram.c parse.h 9 | 10 | ${PARSEYACCS}: gram.y 11 | yacc -d ${.ALLSRC}; \ 12 | mv y.tab.c gram.c; \ 13 | mv y.tab.h parse.h; 14 | 15 | SRCS+= catalog_utils.c dbcommands.c error.c io.c parse_query.c scanner.c \ 16 | ylib.c gram.c scan.c 17 | 18 | CLEANFILES+= scan.c ${PARSEYACCS} 19 | 20 | ${PROG}: ${PARSEYACCS} 21 | 22 | .depend: scan.c ${PARSEYACCS} 23 | 24 | .if ${PORTNAME} == "bsd44" 25 | YFLAGS+= -l 26 | .endif 27 | 28 | HEADERS+= atoms.h catalog_utils.h exceptions.h io.h parse_query.h \ 29 | parsetree.h 30 | -------------------------------------------------------------------------------- /src/backend/parser/atoms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * atoms.h 3 | * - string,atom lookup thingy, reduces strcmp traffic greatly 4 | * in the bowels of the system. Look for actual defs in lib/C/atoms.c 5 | * 6 | * $Header$ 7 | */ 8 | 9 | /* 10 | #define lengthof(byte_array) (sizeof(byte_array) / sizeof((byte_array)[0])) 11 | #define endof(byte_array) (&byte_array[lengthof(byte_array)]) 12 | */ 13 | typedef struct ScanKeyword { 14 | char *name; 15 | int value; 16 | } ScanKeyword; 17 | 18 | extern ScanKeyword *ScanKeywordLookup ARGS((char *txt)); 19 | extern String AtomValueGetString ARGS((int atomval)); 20 | extern ScanKeyword ScanKeywords[]; 21 | 22 | -------------------------------------------------------------------------------- /src/backend/parser/catalog_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _P_CATALOG_UTILS_H 2 | #define _P_CATALOG_UTILS_H \ 3 | "$Header$" 4 | 5 | #include "tmp/postgres.h" 6 | 7 | #include "access/htup.h" 8 | #include "utils/rel.h" 9 | #include "catalog/pg_proc.h" 10 | #include "catalog/pg_type.h" 11 | #include "catalog/syscache.h" 12 | 13 | typedef HeapTuple Type; 14 | typedef HeapTuple Operator; 15 | 16 | extern Type type(), get_id_type(); 17 | extern OID att_typeid(), typeid(); 18 | extern bool varisset(); 19 | extern int16 tlen(); 20 | extern bool tbyval(); 21 | extern Relation get_rdesc(), get_rgdesc(); 22 | extern char *outstr(), *instr(), *instr1(), *instr2(); 23 | extern Operator oper(), right_oper(), left_oper(); 24 | extern Name tname(), get_id_typname(); 25 | extern bool func_get_detail(); 26 | extern void func_error(); 27 | 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/backend/parser/error.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * error.c 4 | * 5 | * NOTES 6 | * 7 | * IDENTIFICATION 8 | * $Header$ 9 | * ---------------------------------------------------------------- 10 | */ 11 | static char *error_c = "$Header$"; 12 | 13 | #include 14 | #include "utils/log.h" 15 | 16 | /* 17 | * Default error handler for syntax errors. 18 | */ 19 | yyerror(message) 20 | char message[]; 21 | { 22 | extern char yytext[]; 23 | 24 | elog(WARN, "parser: %s at or near \"%s\"\n", message, yytext); 25 | } 26 | 27 | /* 28 | * Scanner error handler. 29 | */ 30 | serror(str) 31 | char str[]; 32 | { 33 | elog(WARN, "*** scanner error: %s\n", str); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/backend/parser/exceptions.h: -------------------------------------------------------------------------------- 1 | #ifndef exceptions_h 2 | #define exceptions_h "$Header$" 3 | 4 | #include "utils/exc.h" 5 | #include "utils/excid.h" 6 | 7 | /* All raises in parser are in this form */ 8 | #define p_raise(X, Y) raise4((X), 0, NULL, (Y)) 9 | 10 | #endif exceptions_h 11 | -------------------------------------------------------------------------------- /src/backend/parser/io.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * io.c 4 | * 5 | * NOTES 6 | * 7 | * IDENTIFICATION 8 | * $Header$ 9 | * ---------------------------------------------------------------- 10 | */ 11 | 12 | #include 13 | #include "utils/log.h" 14 | #include "io.h" 15 | 16 | int StringInput; 17 | char *TheString; 18 | char *Ch; 19 | 20 | void 21 | init_io() 22 | { 23 | 24 | Ch = NULL; 25 | } 26 | 27 | char 28 | input() 29 | { 30 | char c; 31 | 32 | if (StringInput) { 33 | if (Ch == NULL) { 34 | Ch = TheString; 35 | return(*Ch++); 36 | } else if (*Ch == '\0') { 37 | return(0); 38 | } else { 39 | return(*Ch++); 40 | } 41 | } else { 42 | c = getchar(); 43 | if (c == EOF) { 44 | return(0); 45 | } else { 46 | return(c); 47 | } 48 | } 49 | } 50 | 51 | void 52 | unput(c) 53 | char c; 54 | { 55 | 56 | if (StringInput) { 57 | if (Ch == NULL) { 58 | elog(FATAL, "Unput() failed.\n"); 59 | /* NOTREACHED */ 60 | } else if (c != 0) { 61 | *--Ch = c; 62 | } 63 | } else { 64 | ungetc(c, stdin); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/backend/parser/io.h: -------------------------------------------------------------------------------- 1 | static char *io_h = "$Header$"; 2 | 3 | extern int StringInput; 4 | extern char *TheString; 5 | -------------------------------------------------------------------------------- /src/backend/planner/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include "${.CURDIR}/planner/path/Makefile.inc" 6 | .include "${.CURDIR}/planner/plan/Makefile.inc" 7 | .include "${.CURDIR}/planner/prep/Makefile.inc" 8 | .include "${.CURDIR}/planner/sys/Makefile.inc" 9 | .include "${.CURDIR}/planner/util/Makefile.inc" 10 | 11 | .PATH: ${.CURDIR}/planner 12 | 13 | HEADERS+= \ 14 | allpaths.h archive.h cfi.h clause.h clauseinfo.h clauses.h \ 15 | clausesel.h costsize.h createplan.h handleunion.h hashutils.h \ 16 | indexnode.h indxpath.h initsplan.h internal.h joininfo.h \ 17 | joinpath.h joinrels.h joinutils.h keys.h mergeutils.h ordering.h \ 18 | orindxpath.h paramutils.h pathnode.h plancat.h planmain.h \ 19 | planner.h pppp.h predmig.h prepqual.h preptlist.h prepunion.h \ 20 | prune.h relnode.h semanopt.h setrefs.h sortresult.h storeplan.h \ 21 | tlist.h var.h xfunc.h 22 | -------------------------------------------------------------------------------- /src/backend/planner/allpaths.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * allpaths.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for allpaths.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef allpathsIncluded /* include this file only once */ 17 | #define allpathsIncluded 1 18 | 19 | extern LispValue find_paths ARGS((LispValue rels, int nest_level, LispValue sortkeys)); 20 | extern LispValue find_rel_paths ARGS((LispValue rels, int level, LispValue sortkeys)); 21 | extern LispValue find_join_paths ARGS((LispValue outer_rels, int levels_left, int nest_level)); 22 | extern void printclauseinfo ARGS((char *ind, List cl)); 23 | extern void printjoininfo ARGS((char *ind, List jl)); 24 | extern void printpath ARGS((char *ind, Path p)); 25 | extern void printpathlist ARGS((char *ind, LispValue pl)); 26 | extern void printrels ARGS((char *ind, List rl)); 27 | extern void PrintRels ARGS((List rl)); 28 | extern void PRel ARGS((Rel r)); 29 | 30 | #endif /* allpathsIncluded */ 31 | -------------------------------------------------------------------------------- /src/backend/planner/archive.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * archive.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for archive.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef archiveIncluded /* include this file only once */ 17 | #define archiveIncluded 1 18 | 19 | extern void plan_archive ARGS((List rt)); 20 | extern LispValue find_archive_rels ARGS((LispValue relid)); 21 | 22 | #endif /* archiveIncluded */ 23 | -------------------------------------------------------------------------------- /src/backend/planner/cfi.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * cfi.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for cfi.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef cfiIncluded /* include this file only once */ 17 | #define cfiIncluded 1 18 | 19 | extern List index_info ARGS((bool not_first, ObjectId relid)); 20 | extern List index_selectivity ARGS((ObjectId indid, List classes, List opnos, ObjectId relid, List attnos, List values, List flags, int32 nkeys)); 21 | extern LispValue find_version_parents ARGS((LispValue relation_oid)); 22 | extern int32 function_index_info ARGS((int32 function_oid, int32 index_oid)); 23 | extern int32 function_index_info ARGS((int32 function_oid, int32 index_oid)); 24 | 25 | #endif /* cfiIncluded */ 26 | -------------------------------------------------------------------------------- /src/backend/planner/clauseinfo.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * clauseinfo.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for clauseinfo.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef clauseinfoIncluded /* include this file only once */ 17 | #define clauseinfoIncluded 1 18 | 19 | extern bool valid_or_clause ARGS((LispValue clauseinfo)); 20 | extern LispValue get_actual_clauses ARGS((LispValue clauseinfo_list)); 21 | extern LispValue get_relattvals ARGS((LispValue clauseinfo_list)); 22 | extern LispValue get_joinvars ARGS((LispValue relid, LispValue clauseinfo_list)); 23 | extern LispValue get_joinvar ARGS((ObjectId relid, CInfo clauseinfo)); 24 | extern LispValue get_opnos ARGS((LispValue clauseinfo_list)); 25 | 26 | #endif /* clauseinfoIncluded */ 27 | -------------------------------------------------------------------------------- /src/backend/planner/clausesel.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * clausesel.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for clausesel.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef clauseselIncluded /* include this file only once */ 17 | #define clauseselIncluded 1 18 | 19 | extern void set_clause_selectivities ARGS((LispValue clauseinfo_list, Cost new_selectivity)); 20 | extern Cost product_selec ARGS((LispValue clauseinfo_list)); 21 | extern void set_rest_relselec ARGS((LispValue rel_list)); 22 | extern void set_rest_selec ARGS((LispValue clauseinfo_list)); 23 | extern Cost compute_clause_selec ARGS((LispValue clause, LispValue or_selectivities)); 24 | extern Cost compute_selec ARGS((LispValue clauses, LispValue or_selectivities)); 25 | extern LispValue translate_relid ARGS((LispValue relid)); 26 | 27 | #endif /* clauseselIncluded */ 28 | -------------------------------------------------------------------------------- /src/backend/planner/hashutils.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * hashutils.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for hashutils.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef hashutilsIncluded /* include this file only once */ 17 | #define hashutilsIncluded 1 18 | 19 | extern LispValue group_clauses_by_hashop ARGS((LispValue clauseinfo_list, LispValue inner_relid)); 20 | extern HInfo match_hashop_hashinfo ARGS((ObjectId hashop, LispValue hashinfo_list)); 21 | 22 | #endif /* hashutilsIncluded */ 23 | -------------------------------------------------------------------------------- /src/backend/planner/indexnode.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * indexnode.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for indexnode.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef indexnodeIncluded /* include this file only once */ 17 | #define indexnodeIncluded 1 18 | 19 | extern LispValue find_relation_indices ARGS((Rel rel)); 20 | extern LispValue find_secondary_index ARGS((bool notfirst, ObjectId relid)); 21 | 22 | #endif /* indexnodeIncluded */ 23 | -------------------------------------------------------------------------------- /src/backend/planner/initsplan.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * initsplan.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for initsplan.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef initsplanIncluded /* include this file only once */ 17 | #define initsplanIncluded 1 18 | 19 | extern void initialize_targetlist ARGS((List tlist)); 20 | extern void initialize_qualification ARGS((LispValue clauses)); 21 | extern void add_clause_to_rels ARGS((LispValue clause)); 22 | extern void add_join_clause_info_to_rels ARGS((CInfo clauseinfo, List join_relids)); 23 | extern void add_vars_to_rels ARGS((List vars, List join_relids)); 24 | extern void initialize_join_clause_info ARGS((LispValue rel_list)); 25 | extern MergeOrder mergesortop ARGS((LispValue clause)); 26 | extern ObjectId hashjoinop ARGS((LispValue clause)); 27 | 28 | #endif /* initsplanIncluded */ 29 | -------------------------------------------------------------------------------- /src/backend/planner/joininfo.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * joininfo.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for joininfo.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef joininfoIncluded /* include this file only once */ 17 | #define joininfoIncluded 1 18 | 19 | extern JInfo joininfo_member ARGS((LispValue join_relids, LispValue joininfo_list)); 20 | extern JInfo find_joininfo_node ARGS((Rel this_rel, List join_relids)); 21 | extern Var other_join_clause_var ARGS((Var var, LispValue clause)); 22 | 23 | #endif /* joininfoIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/planner/mergeutils.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * mergeutils.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for mergeutils.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef mergeutilsIncluded /* include this file only once */ 17 | #define mergeutilsIncluded 1 18 | 19 | extern LispValue group_clauses_by_order ARGS((LispValue clauseinfo_list, LispValue inner_relid)); 20 | extern int dump_rel ARGS((Rel rel)); 21 | extern MInfo match_order_mergeinfo ARGS((MergeOrder ordering, List mergeinfo_list)); 22 | 23 | #endif /* mergeutilsIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/planner/ordering.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * ordering.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for ordering.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef orderingIncluded /* include this file only once */ 17 | #define orderingIncluded 1 18 | 19 | extern bool equal_path_path_ordering ARGS((LispValue path_ordering1, LispValue path_ordering2)); 20 | extern bool equal_path_merge_ordering ARGS((LispValue path_ordering, LispValue merge_ordering)); 21 | extern bool equal_merge_merge_ordering ARGS((LispValue merge_ordering1, LispValue merge_ordering2)); 22 | 23 | #endif /* orderingIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/planner/orindxpath.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * orindxpath.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for orindxpath.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef orindxpathIncluded /* include this file only once */ 17 | #define orindxpathIncluded 1 18 | 19 | extern LispValue create_or_index_paths ARGS((Rel rel, List clauses)); 20 | extern LispValue best_or_subclause_indices ARGS((Rel rel, List subclauses, List indices, List examined_indexids, Cost subcost, List selectivities)); 21 | extern LispValue best_or_subclause_index ARGS((Rel rel, LispValue subclause, List indices)); 22 | 23 | #endif /* orindxpathIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/planner/paramutils.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * paramutils.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for paramutils.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef paramutilsIncluded /* include this file only once */ 17 | #define paramutilsIncluded 1 18 | 19 | extern LispValue find_parameters ARGS((LispValue plan)); 20 | extern LispValue find_all_parameters ARGS((LispValue tree)); 21 | extern LispValue substitute_parameters ARGS((LispValue plan, LispValue params)); 22 | extern LispValue assoc_params ARGS((LispValue plan, LispValue param_alist)); 23 | 24 | #endif /* paramutilsIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/planner/path/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/planner/path 6 | 7 | SRCS+= allpaths.c clausesel.c costsize.c hashutils.c indxpath.c \ 8 | joinpath.c joinrels.c joinutils.c mergeutils.c orindxpath.c \ 9 | predmig.c prune.c xfunc.c 10 | -------------------------------------------------------------------------------- /src/backend/planner/plan/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/planner/plan 6 | 7 | # OBSOLETE? : recurplanner.c 8 | 9 | SRCS+= createplan.c initsplan.c planmain.c planner.c \ 10 | setrefs.c sortresult.c 11 | -------------------------------------------------------------------------------- /src/backend/planner/planner.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * planner.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for planner.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef plannerIncluded /* include this file only once */ 17 | #define plannerIncluded 1 18 | 19 | #include "planner/internal.h" 20 | 21 | extern Plan planner ARGS((LispValue parse)); 22 | extern Plan make_sortplan ARGS((List tlist, List sortkeys, List sortops, Plan plannode)); 23 | extern Plan init_query_planner ARGS((LispValue root, LispValue tlist, LispValue qual)); 24 | extern Existential make_existential ARGS((Plan left, Plan right)); 25 | extern void pg_checkretval ARGS((ObjectId rettype, List parselist)); 26 | 27 | #endif /* plannerIncluded */ 28 | -------------------------------------------------------------------------------- /src/backend/planner/prep/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/planner/prep 6 | 7 | SRCS+= archive.c handleunion.c prepqual.c preptlist.c prepunion.c semanopt.c 8 | -------------------------------------------------------------------------------- /src/backend/planner/preptlist.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * preptlist.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for preptlist.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef preptlistIncluded /* include this file only once */ 17 | #define preptlistIncluded 1 18 | 19 | extern List preprocess_targetlist ARGS((List tlist, int command_type, LispValue result_relation, List range_table)); 20 | extern LispValue expand_targetlist ARGS((List tlist, ObjectId relid, int command_type, Index result_relation)); 21 | extern LispValue replace_matching_resname ARGS((LispValue new_tlist, LispValue old_tlist)); 22 | extern LispValue new_relation_targetlist ARGS((ObjectId relid, Index rt_index, NodeTag node_type)); 23 | 24 | #endif /* preptlistIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/planner/prune.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * prune.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for prune.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef pruneIncluded /* include this file only once */ 17 | #define pruneIncluded 1 18 | 19 | extern LispValue prune_joinrels ARGS((LispValue rel_list)); 20 | extern LispValue prune_joinrel ARGS((Rel rel, List other_rels)); 21 | extern void prune_rel_paths ARGS((List rel_list)); 22 | extern bool mergepath_contain_redundant_sorts ARGS((MergePath path)); 23 | extern bool path_contain_rotated_mergepaths ARGS((Path p1, Path p2)); 24 | extern bool path_contain_redundant_indexscans ARGS((Path path, bool order_expected)); 25 | extern void test_prune_unnecessary_paths ARGS((Rel rel)); 26 | extern Path prune_rel_path ARGS((Rel rel, Path unorderedpath)); 27 | extern LispValue merge_joinrels ARGS((LispValue rel_list1, LispValue rel_list2)); 28 | extern LispValue prune_oldrels ARGS((LispValue old_rels)); 29 | 30 | #endif /* pruneIncluded */ 31 | -------------------------------------------------------------------------------- /src/backend/planner/relnode.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * relnode.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for relnode.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef relnodeIncluded /* include this file only once */ 17 | #define relnodeIncluded 1 18 | 19 | extern Rel get_rel ARGS((LispValue relid)); 20 | extern Rel rel_member ARGS((List relid, List rels)); 21 | 22 | #endif /* relnodeIncluded */ 23 | -------------------------------------------------------------------------------- /src/backend/planner/semanopt.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * semanopt.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for semanopt.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef semanoptIncluded /* include this file only once */ 17 | #define semanoptIncluded 1 18 | 19 | extern List SemantOpt ARGS((List varlist, List rangetable, List qual, List *is_redundent, int is_first)); 20 | extern List SemantOpt2 ARGS((List rangetable, List qual, List modqual, List tlist)); 21 | extern void replace_tlist ARGS((Index left, Index right, List tlist)); 22 | extern void replace_varnodes ARGS((Index left, Index right, List qual)); 23 | extern List find_allvars ARGS((List root, List rangetable, List tlist, List qual)); 24 | extern List update_vars ARGS((List rangetable, List varlist, List qual)); 25 | extern Index ConstVarno ARGS((List rangetable, Const constnode, char **attname)); 26 | extern List MakeTClause ARGS((void)); 27 | extern List MakeFClause ARGS((void)); 28 | 29 | #endif /* semanoptIncluded */ 30 | -------------------------------------------------------------------------------- /src/backend/planner/sortresult.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * sortresult.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for sortresult.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef sortresultIncluded /* include this file only once */ 17 | #define sortresultIncluded 1 18 | 19 | extern LispValue relation_sortkeys ARGS((LispValue tlist)); 20 | extern LispValue sort_list_car ARGS((LispValue list)); 21 | extern void sort_relation_paths ARGS((LispValue pathlist, LispValue sortkeys, Rel rel, int width)); 22 | extern Plan sort_level_result ARGS((Plan plan, int numkeys)); 23 | 24 | #endif /* sortresultIncluded */ 25 | -------------------------------------------------------------------------------- /src/backend/planner/storeplan.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * storeplan.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for storeplan.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef storeplanIncluded /* include this file only once */ 17 | #define storeplanIncluded 1 18 | 19 | extern LispValue StringToPlan ARGS((char *string)); 20 | extern LispValue StringToPlanWithParams ARGS((char *string, ParamListInfo *paramListP)); 21 | extern char *PlanToString ARGS((LispValue l)); 22 | 23 | #endif /* storeplanIncluded */ 24 | -------------------------------------------------------------------------------- /src/backend/planner/sys/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/planner/sys 6 | 7 | # XXX $%^$%^$ DEPRECATED: paramutils.c 8 | SRCS+= cfi.c plancat.c pppp.c storeplan.c 9 | -------------------------------------------------------------------------------- /src/backend/planner/util/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/planner/util 6 | 7 | SRCS+= clause.c clauseinfo.c clauses.c indexnode.c internal.c \ 8 | joininfo.c keys.c ordering.c pathnode.c relnode.c tlist.c var.c 9 | -------------------------------------------------------------------------------- /src/backend/planner/var.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * var.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for var.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef varIncluded /* include this file only once */ 17 | #define varIncluded 1 18 | 19 | extern LispValue pull_agg_clause ARGS((LispValue clause)); 20 | extern LispValue pull_varnos ARGS((LispValue me)); 21 | extern LispValue pull_var_clause ARGS((LispValue clause)); 22 | extern bool var_equal ARGS((LispValue var1, LispValue var2)); 23 | extern int numlevels ARGS((Var var)); 24 | extern ObjectId var_getrelid ARGS((Var var)); 25 | 26 | #endif /* varIncluded */ 27 | -------------------------------------------------------------------------------- /src/backend/port/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | # port specific stuff 6 | .PATH: ${.CURDIR}/port/${PORTNAME} 7 | .include "${.CURDIR}/port/${PORTNAME}/Makefile.inc" 8 | -------------------------------------------------------------------------------- /src/backend/port/aix/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # AIX specific stuff 3 | # 4 | # $Header$ 5 | # 6 | 7 | CFLAGS+= -DCLASS_CONFLICT -DDISABLE_XOPEN_NLS -DNEED_ISINF 8 | 9 | LDFLAGS+= -bE:${PROG}.exp 10 | 11 | LDADD+= -ll -lld 12 | 13 | HEADERS+= dlfcn.h machine.h port-protos.h 14 | 15 | SRCS+= dlfcn.c dynloader.c 16 | 17 | ${PROG}.exp: ${PROG}.noexp 18 | mv -f ${.ALLSRC} ${PROG} 19 | mkldexport ${PROG} ${BINDIR} > ${.TARGET} 20 | mv -f ${PROG} ${.ALLSRC} 21 | 22 | ${PROG}.noexp: ${OBJS} 23 | touch -f ${PROG}.exp 24 | ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} 25 | 26 | EXPORTS= ${PROG}.exp 27 | 28 | CLEANFILES+= ${PROG}.noexp ${PROG}.exp 29 | -------------------------------------------------------------------------------- /src/backend/port/aix/dlfcn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)dlfcn.h 1.3 revision of 92/12/27 20:58:32 3 | * This is an unpublished work copyright (c) 1992 Helios Software GmbH 4 | * 3000 Hannover 1, Germany 5 | */ 6 | 7 | /* 8 | * Mode flags for the dlopen routine. 9 | */ 10 | #define RTLD_LAZY 1 11 | #define RTLD_NOW 2 12 | 13 | /* 14 | * To be able to intialize, a library may provide a dl_info structure 15 | * that contains functions to be called to initialize and terminate. 16 | */ 17 | struct dl_info { 18 | void (*init)(void); 19 | void (*fini)(void); 20 | }; 21 | 22 | #if __STDC__ || defined(_IBMR2) 23 | void *dlopen(const char *path, int mode); 24 | void *dlsym(void *handle, const char *symbol); 25 | char *dlerror(void); 26 | int dlclose(void *handle); 27 | #else 28 | void *dlopen(); 29 | void *dlsym(); 30 | char *dlerror(); 31 | int dlclose(); 32 | #endif 33 | -------------------------------------------------------------------------------- /src/backend/port/aix/machine.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header$ 4 | */ 5 | 6 | #ifndef MACHINE_H 7 | #define MACHINE_H 8 | 9 | #define BLCKSZ 8192 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/backend/port/aix/port-protos.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------------- 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * port-specific prototypes for AIX 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | * --------------------------------------------------------------------------- 13 | */ 14 | 15 | /* dynloader.c */ 16 | 17 | /* pg_dl{open,close,sym} prototypes are in utils/dynamic_loader.h */ 18 | -------------------------------------------------------------------------------- /src/backend/port/alpha/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # Alpha OSF/1 specific stuff 3 | # 4 | # $Header$ 5 | # 6 | 7 | CFLAGS+= -DUSE_POSIX_TIME -DDISABLE_XOPEN_NLS -DNEED_ISINF -DHAS_LONG_LONG 8 | 9 | LDADD+= -lln 10 | 11 | # 12 | # The YACC grammar is too big.. 13 | # 14 | .if !defined(CDEBUG) 15 | CFLAGS+= -Olimit 2000 16 | .endif 17 | 18 | HEADERS+= machine.h 19 | 20 | SRCS+= dynloader.c port.c tas.s 21 | -------------------------------------------------------------------------------- /src/backend/port/alpha/dynloader.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header$ 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "tmp/postgres.h" 10 | #include "fmgr.h" /* for func_ptr */ 11 | #include "utils/dynamic_loader.h" /* for protos */ 12 | #include "port-protos.h" /* for #define'd pg_dl* */ 13 | 14 | /* 15 | * Dynamic Loader on Alpha OSF/1.x 16 | * 17 | * this dynamic loader uses the system dynamic loading interface for shared 18 | * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared 19 | * library as the file to be dynamically loaded. 20 | * 21 | * Note that only pg_dlopen is defined here. pg_dlsym and pg_dlclose 22 | * are actually macros. 23 | */ 24 | 25 | /* 26 | * pg_dlopen-- 27 | * attempts to dynamically loaded in filename and returns error in 28 | * err, if any. 29 | */ 30 | void *pg_dlopen( filename, err ) 31 | char *filename; char **err; 32 | { 33 | void *handle= NULL; 34 | 35 | if ((handle=dlopen(filename, RTLD_LAZY))==NULL) { 36 | *err = dlerror(); 37 | } 38 | return (void *)handle; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/backend/port/alpha/machine.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header$ 4 | */ 5 | 6 | #ifndef MACHINE_H 7 | #define MACHINE_H 8 | 9 | #define BLCKSZ 8192 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/backend/port/alpha/port-protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for OSF/1-specific routines 7 | * 8 | * NOTES 9 | * OSF/1 provides the dlopen() interface, so most of the pg_dlopen() 10 | * stuff maps directly into it. 11 | * 12 | * IDENTIFICATION 13 | * $Header$ 14 | */ 15 | 16 | #include "utils/dynamic_loader.h" 17 | 18 | /* dynloader.c */ 19 | 20 | #define pg_dlsym(h, f) ((func_ptr)dlsym(h, f)) 21 | #define pg_dlclose(h) dlclose(h) 22 | 23 | /* port.c */ 24 | 25 | extern init_address_fixup ARGS((void)); 26 | -------------------------------------------------------------------------------- /src/backend/port/alpha/port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port.c 4 | * 5 | * DESCRIPTION 6 | * OSF/1-specific routines 7 | * 8 | * INTERFACE ROUTINES 9 | * init_address_fixup 10 | * 11 | * NOTES 12 | * 13 | * IDENTIFICATION 14 | * $Header$ 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "tmp/c.h" 22 | 23 | #include "utils/log.h" 24 | 25 | RcsId("$Header$"); 26 | 27 | init_address_fixup() 28 | { 29 | #ifdef NOFIXADE 30 | int buffer[] = { SSIN_UACPROC, UAC_SIGBUS }; 31 | #endif /* NOFIXADE */ 32 | #ifdef NOPRINTADE 33 | int buffer[] = { SSIN_UACPROC, UAC_NOPRINT }; 34 | #endif /* NOPRINTADE */ 35 | 36 | if (setsysinfo(SSI_NVPAIRS, buffer, 1, (caddr_t) NULL, 37 | (unsigned long) NULL) < 0) { 38 | elog(NOTICE, "setsysinfo failed: %d\n", errno); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/backend/port/alpha/tas.c.template: -------------------------------------------------------------------------------- 1 | /* 2 | * To generate tas.s using this template: 3 | * 1. cc -S -c tas.c 4 | * don't use the -O option! -O2 removes the second test.. 5 | * 2. edit tas.s: 6 | * - replace the first ldq with ldq_l. 7 | * - replace the stq with stq_c. 8 | * - remove the second ldq and change the "beq $3" to a 9 | * "beq $2" (we need to test the same register we tried to 10 | * store with the stq_c). 11 | * - fix the livereg bitmask if you feel particularly 12 | * virtuous. 13 | * This template was written so that failure results in a forward branch 14 | * and the store is not attempted unless the locked load succeeded (i.e., 15 | * the lock variable is zero). See page 5-7 of the Alpha Architecture 16 | * Handbook (EC-H1689-10, release of 4/92) for details. 17 | */ 18 | tas(lock) 19 | long *lock; 20 | { 21 | if (*lock == 0) { 22 | *lock = 1; 23 | if (*lock) 24 | return 0; 25 | } 26 | return 1; 27 | } 28 | -------------------------------------------------------------------------------- /src/backend/port/alpha/tas.s: -------------------------------------------------------------------------------- 1 | .ugen 2 | .verstamp 3 11 3 | .text 4 | .align 4 5 | .file 2 "tas.c" 6 | .globl tas 7 | .loc 2 20 8 | # 20 { 9 | .ent tas 2 10 | tas: 11 | .option O1 12 | ldgp $gp, 0($27) 13 | .frame $sp, 0, $26, 0 14 | .prologue 1 15 | .loc 2 20 16 | 17 | .loc 2 21 18 | # 21 if (*lock == 0) { 19 | ldq_l $1, 0($16) 20 | bne $1, $32 21 | .loc 2 21 22 | 23 | .loc 2 22 24 | # 22 *lock = 1; 25 | ldiq $2, 1 26 | stq_c $2, 0($16) 27 | .loc 2 23 28 | # 23 if (*lock) 29 | beq $2, $32 30 | .loc 2 24 31 | # 24 return 0; 32 | bis $31, $31, $0 33 | .livereg 0x807F0002,0x3FC00000 34 | ret $31, ($26), 1 35 | $32: 36 | .loc 2 26 37 | # 25 } 38 | # 26 return 1; 39 | ldil $0, 1 40 | $33: 41 | .livereg 0xFC7F0002,0x3FC00000 42 | ret $31, ($26), 1 43 | .end tas 44 | -------------------------------------------------------------------------------- /src/backend/port/hpux/machine.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header: hpux machine.h Rik Tue Jan 19 17:10:13 GMT 1993 4 | */ 5 | 6 | #ifndef MACHINE_H 7 | #define MACHINE_H 8 | 9 | #define BLCKSZ 8192 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/backend/port/hpux/port-protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * port-specific prototypes for HP-UX 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | */ 13 | 14 | #ifndef PortProtos_H /* include this file only once */ 15 | #define PortProtos_H 1 16 | 17 | #include /* for shl_t */ 18 | 19 | #include "utils/dynamic_loader.h" 20 | 21 | /* dynloader.c */ 22 | 23 | /* pg_dl{open,close,sym} prototypes are in utils/dynamic_loader.h */ 24 | 25 | /* port.c */ 26 | 27 | extern int init_address_fixup ARGS((void)); 28 | extern double rint ARGS((double x)); 29 | extern double cbrt ARGS((double x)); 30 | extern long random ARGS((void)); 31 | extern void srandom ARGS((int seed)); 32 | extern int getrusage ARGS((int who, struct rusage *ru)); 33 | 34 | #endif /* PortProtos_H */ 35 | -------------------------------------------------------------------------------- /src/backend/port/hpux/port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port.c 4 | * 5 | * DESCRIPTION 6 | * port-specific routines for HP-UX 7 | * 8 | * INTERFACE ROUTINES 9 | * init_address_fixup 10 | * random 11 | * srandom 12 | * getrusage 13 | * 14 | * NOTES 15 | * For the most part, this file gets around some non-POSIX calls 16 | * in POSTGRES. 17 | * 18 | * IDENTIFICATION 19 | * $Header$ 20 | */ 21 | 22 | #include /* for rand()/srand() prototypes */ 23 | #include /* for pow() prototype */ 24 | #include /* for syscall #defines */ 25 | 26 | #include "tmp/c.h" 27 | 28 | init_address_fixup() 29 | { 30 | /* 31 | * On PA-RISC, unaligned access fixup is handled by the compiler, 32 | * not by the kernel. 33 | */ 34 | } 35 | 36 | long 37 | random() 38 | { 39 | return(lrand48()); 40 | } 41 | 42 | void 43 | srandom(seed) 44 | int seed; 45 | { 46 | srand48((long int) seed); 47 | } 48 | 49 | getrusage(who, ru) 50 | int who; 51 | struct rusage *ru; 52 | { 53 | return(syscall(SYS_GETRUSAGE, who, ru)); 54 | } 55 | -------------------------------------------------------------------------------- /src/backend/port/hpux/tas.s: -------------------------------------------------------------------------------- 1 | 2 | .SPACE $TEXT$,SORT=8 3 | .SUBSPA $CODE$,QUAD=0,ALIGN=4,ACCESS=44,CODE_ONLY,SORT=24 4 | tas 5 | .PROC 6 | .CALLINFO CALLER,FRAME=0,ENTRY_SR=3 7 | .ENTRY 8 | LDO 15(%r26),%r31 ;offset 0x0 9 | DEPI 0,31,4,%r31 ;offset 0x4 10 | LDCWX 0(0,%r31),%r23 ;offset 0x8 11 | COMICLR,= 0,%r23,%r0 ;offset 0xc 12 | DEP,TR %r0,31,32,%r28 ;offset 0x10 13 | $00000001 14 | LDI 1,%r28 ;offset 0x14 15 | $L0 16 | .EXIT 17 | BV,N %r0(%r2) ;offset 0x18 18 | .PROCEND ;in=26;out=28; 19 | 20 | 21 | .SPACE $TEXT$ 22 | .SUBSPA $CODE$ 23 | .SPACE $PRIVATE$,SORT=16 24 | .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31,SORT=16 25 | .SPACE $TEXT$ 26 | .SUBSPA $CODE$ 27 | .EXPORT tas,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR 28 | .END 29 | -------------------------------------------------------------------------------- /src/backend/port/linux/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | # Linux specific stuff. Right now, we disable the dynamic loader. 5 | # 6 | # (C) 1994, Kai Petzke, wpp@marie.physik.tu-berlin.de 7 | # 8 | 9 | 10 | SRCS+= dynloader.c # port.c 11 | HEADERS+= machine.h 12 | 13 | CFLAGS+= -DNEED_CBRT 14 | 15 | LDADD+= -ldld 16 | -------------------------------------------------------------------------------- /src/backend/port/linux/machine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | */ 4 | 5 | #ifndef MACHINE_H 6 | #define MACHINE_H 7 | 8 | #define BLCKSZ 8192 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/backend/port/linux/port-protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * port-specific prototypes for SunOS 4 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | */ 13 | 14 | #ifndef PortProtos_H /* include this file only once */ 15 | #define PortProtos_H 1 16 | 17 | #include "fmgr.h" /* for func_ptr */ 18 | #include "utils/dynamic_loader.h" 19 | 20 | /* dynloader.c */ 21 | 22 | #define pg_dlsym(handle, funcname) ((func_ptr) dld_get_func((funcname))) 23 | #define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); }) 24 | 25 | 26 | /* port.c */ 27 | 28 | #endif /* PortProtos_H */ 29 | -------------------------------------------------------------------------------- /src/backend/port/linux/port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port.c 4 | * 5 | * DESCRIPTION 6 | * Linux-specific routines 7 | * 8 | * INTERFACE ROUTINES 9 | * 10 | * NOTES 11 | * 12 | * IDENTIFICATION 13 | * $Header$ 14 | */ 15 | -------------------------------------------------------------------------------- /src/backend/port/sparc/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # SPARC/SunOS 4 specific stuff 3 | # 4 | # $Header$ 5 | # 6 | 7 | CFLAGS+= -DUSE_POSIX_TIME 8 | 9 | LDADD+= -lln -ldl 10 | 11 | # 12 | # SunOS 4 strtol is broken -- doesn't report overflow using errno. 13 | # 14 | SRCS+= strtol.c 15 | 16 | SRCS+= port.c dynloader.c 17 | HEADERS+= machine.h 18 | -------------------------------------------------------------------------------- /src/backend/port/sparc/float.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * float.h 4 | * 5 | * DESCRIPTION 6 | * definitions for ANSI floating point 7 | * 8 | * NOTES 9 | * These come straight out of ANSI X3.159-1989 (p.18) and 10 | * would be unnecessary if SunOS 4 were ANSI-compliant. 11 | * 12 | * This is only a partial listing because I'm lazy to type 13 | * the whole thing in. 14 | * 15 | * IDENTIFICATION 16 | * $Header$ 17 | * ---------------------------------------------------------------- 18 | */ 19 | 20 | #ifndef floatIncluded /* include this file only once */ 21 | #define floatIncluded 1 22 | 23 | #define FLT_DIG 6 24 | #define FLT_MIN ((float) 1.17549435e-38) 25 | #define FLT_MAX ((float) 3.40282347e+38) 26 | #define DBL_DIG 15 27 | #define DBL_MIN 2.2250738585072014e-308 28 | #define DBL_MAX 1.7976931348623157e+308 29 | 30 | #endif /* floatIncluded */ 31 | -------------------------------------------------------------------------------- /src/backend/port/sparc/machine.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header$ 4 | */ 5 | 6 | #ifndef MACHINE_H 7 | #define MACHINE_H 8 | 9 | #define BLCKSZ 8192 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/backend/port/sparc/port-protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * port-specific prototypes for SunOS 4 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | */ 13 | 14 | #ifndef PortProtos_H /* include this file only once */ 15 | #define PortProtos_H 1 16 | 17 | #include 18 | #include "fmgr.h" /* for func_ptr */ 19 | #include "utils/dynamic_loader.h" 20 | 21 | /* dynloader.c */ 22 | 23 | #define pg_dlsym dlsym 24 | #define pg_dlclose dlclose 25 | 26 | /* port.c */ 27 | 28 | void sparc_bug_set_outerjoincost ARGS((char *p, long val)); 29 | 30 | #endif /* PortProtos_H */ 31 | -------------------------------------------------------------------------------- /src/backend/port/sparc/port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port.c 4 | * 5 | * DESCRIPTION 6 | * SunOS4-specific routines 7 | * 8 | * INTERFACE ROUTINES 9 | * sparc_bug_set_outerjoincost 10 | * 11 | * NOTES 12 | * 13 | * IDENTIFICATION 14 | * $Header$ 15 | */ 16 | #include "nodes/relation.h" 17 | 18 | RcsId("$Header$"); 19 | 20 | /* 21 | * Hackety-hack for Sparc compiler error. 22 | * 23 | * See planner/path/joinpath.c 24 | */ 25 | void 26 | sparc_bug_set_outerjoincost(p, val) 27 | char *p; 28 | long val; 29 | { 30 | set_outerjoincost((Path)p, (Cost)val); 31 | } 32 | -------------------------------------------------------------------------------- /src/backend/port/sparc_solaris/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # SPARC/Solaris 2.x specific stuff 3 | # 4 | # $Header$ 5 | # 6 | 7 | CFLAGS+= -DUSE_POSIX_TIME -DNEED_ISINF -DNEED_RUSAGE -DNO_EMPTY_STMTS 8 | 9 | LDADD+= -ll -ldl 10 | 11 | SRCS+= port.c dynloader.c tas.s 12 | 13 | HEADERS+= machine.h 14 | -------------------------------------------------------------------------------- /src/backend/port/sparc_solaris/machine.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header$ 4 | */ 5 | 6 | #ifndef MACHINE_H 7 | #define MACHINE_H 8 | 9 | #define BLCKSZ 8192 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/backend/port/sparc_solaris/port-protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * port-specific prototypes for SunOS 4 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | */ 13 | 14 | #ifndef PortProtos_H /* include this file only once */ 15 | #define PortProtos_H 1 16 | 17 | #include 18 | #include "fmgr.h" /* for func_ptr */ 19 | #include "utils/dynamic_loader.h" 20 | 21 | /* dynloader.c */ 22 | 23 | #define pg_dlsym dlsym 24 | #define pg_dlclose dlclose 25 | 26 | /* port.c */ 27 | 28 | void sparc_bug_set_outerjoincost ARGS((char *p, long val)); 29 | extern long random ARGS((void)); 30 | extern void srandom ARGS((int seed)); 31 | 32 | #endif /* PortProtos_H */ 33 | -------------------------------------------------------------------------------- /src/backend/port/sparc_solaris/rusagestub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * rusagestub.h 4 | * 5 | * DESCRIPTION 6 | * Stubs for getrusage(3). 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | */ 13 | 14 | #ifndef rusagestubIncluded /* include this file only once */ 15 | #define rusagestubIncluded 1 16 | 17 | #include /* for struct timeval */ 18 | #include /* for struct tms */ 19 | #include /* for CLK_TCK */ 20 | 21 | #define RUSAGE_SELF 0 22 | #define RUSAGE_CHILDREN -1 23 | 24 | struct rusage { 25 | struct timeval ru_utime; /* user time used */ 26 | struct timeval ru_stime; /* system time used */ 27 | }; 28 | 29 | extern int getrusage ARGS((int who, struct rusage *rusage)); 30 | 31 | #endif /* rusagestubIncluded */ 32 | -------------------------------------------------------------------------------- /src/backend/port/sparc_solaris/strings.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * strings.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for BSD string functions. 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | * ---------------------------------------------------------------- 13 | */ 14 | 15 | #ifndef stringsIncluded /* include this file only once */ 16 | #define stringsIncluded 1 17 | 18 | #include 19 | 20 | #define index(s,c) strchr((s),(c)) 21 | #define rindex(s,c) strrchr((s),(c)) 22 | #define bcopy(s,d,len) memmove((d),(s),(size_t)(len)) 23 | #define bzero(b,len) memset((b),0,(size_t)(len)) 24 | #define bcmp(s,d,len) memcmp((s),(d),(size_t)(len)) 25 | 26 | #endif /* stringsIncluded */ 27 | -------------------------------------------------------------------------------- /src/backend/port/sparc_solaris/tas.s: -------------------------------------------------------------------------------- 1 | !! 2 | !! $Header$ 3 | !! 4 | !! this would be a piece of inlined assembler but it appears 5 | !! to be easier to just write the assembler than to try to 6 | !! figure out how to make sure that in/out registers are kept 7 | !! straight in the asm's. 8 | !! 9 | .file "tas.c" 10 | .section ".text" 11 | .align 4 12 | .global tas 13 | .type tas,#function 14 | .proc 04 15 | tas: 16 | !! 17 | !! this is a leaf procedure - no need to save windows and 18 | !! diddle the CWP. 19 | !! 20 | !#PROLOGUE# 0 21 | !#PROLOGUE# 1 22 | 23 | !! 24 | !! write 0xFF into the lock address, saving the old value in %o0. 25 | !! this is an atomic action, even on multiprocessors. 26 | !! 27 | ldstub [%o0],%o0 28 | 29 | !! 30 | !! if it was already set when we set it, somebody else already 31 | !! owned the lock -- return 1. 32 | !! 33 | cmp %o0,0 34 | bne .LL2 35 | mov 1,%o0 36 | 37 | !! 38 | !! otherwise, it was clear and we now own the lock -- return 0. 39 | !! 40 | mov 0,%o0 41 | .LL2: 42 | !! 43 | !! this is a leaf procedure - no need to restore windows and 44 | !! diddle the CWP. 45 | !! 46 | retl 47 | nop 48 | .LLfe1: 49 | .size tas,.LLfe1-tas 50 | .ident "GCC: (GNU) 2.5.8" 51 | -------------------------------------------------------------------------------- /src/backend/port/ultrix4/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # Ultrix4.x specific stuff 3 | # 4 | # $Header$ 5 | # 6 | 7 | CFLAGS+= -DNEED_ISINF -DUSE_POSIX_TIME 8 | 9 | LDADD+= -ldl -lln 10 | 11 | # 12 | # The YACC grammar is too big.. 13 | # 14 | .if !defined(CDEBUG) 15 | CFLAGS+= -Olimit 2000 16 | .endif 17 | 18 | HEADERS+= machine.h 19 | 20 | SRCS+= dynloader.c port.c 21 | -------------------------------------------------------------------------------- /src/backend/port/ultrix4/machine.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * $Header$ 4 | */ 5 | 6 | #ifndef MACHINE_H 7 | #define MACHINE_H 8 | 9 | #define BLCKSZ 8192 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /src/backend/port/ultrix4/port-protos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port-protos.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for Ultrix-specific routines 7 | * 8 | * NOTES 9 | * Since Andrew's libdl maps into the regular SVIDish dlopen() 10 | * interface, we can just #define some of the pg_dlopen() stuff 11 | * into the dlopen() routines. 12 | * 13 | * IDENTIFICATION 14 | * $Header$ 15 | */ 16 | 17 | #include "utils/dynamic_loader.h" 18 | 19 | /* dynloader.c */ 20 | 21 | #define pg_dlsym(h, f) ((func_ptr)dl_sym(h, f)) 22 | #define pg_dlclose(h) dl_close(h) 23 | 24 | /* port.c */ 25 | 26 | extern init_address_fixup ARGS((void)); 27 | -------------------------------------------------------------------------------- /src/backend/port/ultrix4/port.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FILE 3 | * port.c 4 | * 5 | * DESCRIPTION 6 | * Ultrix-specific routines 7 | * 8 | * INTERFACE ROUTINES 9 | * init_address_fixup 10 | * 11 | * NOTES 12 | * 13 | * IDENTIFICATION 14 | * $Header$ 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include "tmp/c.h" 21 | 22 | RcsId("$Header$"); 23 | 24 | init_address_fixup() 25 | { 26 | #ifdef NOFIXADE 27 | syscall(SYS_sysmips, MIPS_FIXADE, 0, NULL, NULL, NULL); 28 | #endif /* NOFIXADE */ 29 | } 30 | -------------------------------------------------------------------------------- /src/backend/rewrite/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .PATH: ${.CURDIR}/rewrite 5 | 6 | SRCS+= RemoveRewrite.c RewriteDebug.c RewriteDefine.c \ 7 | RewriteHandler.c RewriteManip.c RewriteSupport.c locks.c 8 | 9 | HEADERS+= RewriteDebug.h RewriteDefine.h RewriteHandler.h RewriteManip.h \ 10 | RewriteSupport.h locks.h 11 | -------------------------------------------------------------------------------- /src/backend/rewrite/RewriteDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | */ 4 | 5 | 6 | 7 | /* RewriteDebug.c */ 8 | char *VarOrUnionGetDesc ARGS((Var varnode , List rangetable )); 9 | int Print_quals ARGS((List quals )); 10 | int Print_expr ARGS((List expr )); 11 | int Print_targetlist ARGS((List tlist )); 12 | int Print_rangetable ARGS((List rtable )); 13 | int Print_parse ARGS((List parsetree )); 14 | void PrintRuleLock ARGS((Prs2OneLock rlock )); 15 | void PrintRuleLockList ARGS((List rlist )); 16 | -------------------------------------------------------------------------------- /src/backend/rewrite/RewriteDefine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | */ 4 | 5 | /* RewriteDefine.c */ 6 | void strcpyq ARGS((char *dest , char *source )); 7 | OID InsertRule ARGS((Name rulname , int evtype , Name evobj , Name evslot , char *evqual , bool evinstead , char *actiontree )); 8 | void ModifyActionToReplaceCurrent ARGS((List retrieve_parsetree )); 9 | void ValidateRule ARGS((int event_type , char *eobj_string , char *eslot_string , List event_qual , List *action , int is_instead , ObjectId event_attype )); 10 | int DefineQueryRewrite ARGS((List args )); 11 | int ShowRuleAction ARGS((LispValue ruleaction )); 12 | -------------------------------------------------------------------------------- /src/backend/rewrite/RewriteManip.h: -------------------------------------------------------------------------------- 1 | 2 | /* module: /users/goh/postgres/src/parser/RewriteManip.c 3 | * $Header$ 4 | */ 5 | 6 | /* RewriteManip.c */ 7 | void OffsetVarNodes ARGS((List qual_or_tlist , int offset )); 8 | void ChangeVarNodes ARGS((List qual_or_tlist , int old_varno , int new_varno )); 9 | void AddQual ARGS((List parsetree , List qual )); 10 | void AddNotQual ARGS((List parsetree , List qual )); 11 | void FixResdomTypes ARGS((List user_tlist )); 12 | void ResolveNew ARGS((RewriteInfo *info , List targetlist , List tree )); 13 | void FixNew ARGS((RewriteInfo *info , List parsetree )); 14 | void HandleRIRAttributeRule ARGS((List parsetree , List rt , List tl , int rt_index , int attr_num , int *modified , int *badpostquel )); 15 | void HandleViewRule ARGS((List parsetree , List rt , List tl , int rt_index , int *modified )); 16 | 17 | -------------------------------------------------------------------------------- /src/backend/rewrite/RewriteSupport.h: -------------------------------------------------------------------------------- 1 | 2 | /* module: /users/goh/postgres/src/parser/RewriteSupport.c 3 | * 4 | * $Header$ 5 | */ 6 | 7 | List RuleIdGetActionInfo ARGS((OID ruleoid , int *instead_flag )); 8 | char *OperOidGetName ARGS((oid oproid )); 9 | -------------------------------------------------------------------------------- /src/backend/rules/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include "${.CURDIR}/rules/prs2/Makefile.inc" 5 | .include "${.CURDIR}/rules/stubs/Makefile.inc" 6 | 7 | .PATH: ${.CURDIR}/rules 8 | 9 | HEADERS+= params.h prs2.h prs2locks.h prs2stub.h rac.h 10 | -------------------------------------------------------------------------------- /src/backend/rules/prs2/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/rules/prs2 6 | 7 | SRCS+= prs2append.c prs2attr.c prs2bkwd.c prs2define.c prs2delete.c \ 8 | prs2explain.c prs2impexp.c prs2inout.c prs2locks.c prs2main.c \ 9 | prs2plans.c prs2putlocks.c prs2rel.c prs2replace.c prs2retrieve.c \ 10 | prs2stack.c prs2tup.c prs2view.c 11 | -------------------------------------------------------------------------------- /src/backend/rules/stubs/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/rules/stubs 6 | 7 | SRCS+= stubinout.c stubjoin.c stubraw.c stubrel.c stubtuple.c stubutil.c 8 | -------------------------------------------------------------------------------- /src/backend/storage/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include "${.CURDIR}/storage/buffer/Makefile.inc" 5 | .include "${.CURDIR}/storage/file/Makefile.inc" 6 | .include "${.CURDIR}/storage/ipc/Makefile.inc" 7 | .include "${.CURDIR}/storage/large_object/Makefile.inc" 8 | .include "${.CURDIR}/storage/lmgr/Makefile.inc" 9 | .include "${.CURDIR}/storage/page/Makefile.inc" 10 | .include "${.CURDIR}/storage/smgr/Makefile.inc" 11 | 12 | .PATH: ${.CURDIR}/storage 13 | 14 | HEADERS+= backendid.h block.h buf.h buf_internals.h \ 15 | bufmgr.h bufpage.h execipc.h fd.h form.h ipc.h ipci.h \ 16 | item.h itemid.h itempos.h itemptr.h jbcomm.h jblib.h \ 17 | jbstruct.h lmgr.h lock.h multilev.h off.h page.h pagenum.h \ 18 | part.h pldebug.h pos.h proc.h procq.h shmem.h \ 19 | sinval.h sinvaladt.h sj.h smgr.h spin.h taslock.h 20 | -------------------------------------------------------------------------------- /src/backend/storage/backendid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * backendid.h -- 3 | * POSTGRES backend id communication definitions 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef BackendIdHincluded 10 | #define BackendIdHincluded 1 11 | 12 | /* ---------------- 13 | * pulled out of sinval.h to temporarily reduce #include nesting. 14 | * -cim 8/17/90 15 | * ---------------- 16 | */ 17 | typedef int16 BackendId; /* unique currently active backend identifier */ 18 | 19 | #define InvalidBackendId (-1) 20 | 21 | typedef int32 BackendTag; /* unique backend identifier */ 22 | 23 | #define InvalidBackendTag (-1) 24 | 25 | extern BackendId MyBackendId; /* backend id of this backend */ 26 | extern BackendTag MyBackendTag; /* backend tag of this backend */ 27 | 28 | #endif BackendIdHincluded 29 | -------------------------------------------------------------------------------- /src/backend/storage/buffer/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/buffer 6 | 7 | # 8 | # OBSOLETE? - imark.c 9 | 10 | SRCS+= buf_table.c bufmgr.c freelist.c order.c 11 | -------------------------------------------------------------------------------- /src/backend/storage/file/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/file 6 | 7 | SRCS+= fd.c 8 | -------------------------------------------------------------------------------- /src/backend/storage/form.h: -------------------------------------------------------------------------------- 1 | /* 2 | * form.h -- 3 | * POSTGRES formated tuple (user) attribute values definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef FormIncluded /* Include this file only once. */ 10 | #define FormIncluded 1 11 | 12 | #include "tmp/c.h" 13 | 14 | /* 15 | * FormData -- 16 | * Formated (aligned) data. 17 | * 18 | * Note: 19 | * Currently assumes that long alignment is the most strict alignment 20 | * needed. 21 | */ 22 | typedef struct FormData { 23 | long filler; 24 | } FormData; 25 | 26 | typedef Pointer Form; 27 | 28 | /* 29 | * FormIsValid -- 30 | * True iff the formated tuple attribute values is valid. 31 | */ 32 | #define FormIsValid(form) PointerIsValid(form) 33 | 34 | #endif /* !defined(FormIncluded) */ 35 | -------------------------------------------------------------------------------- /src/backend/storage/ipc/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/ipc 6 | 7 | SRCS+= execipc.c ipc.c ipci.c s_lock.c shmem.c shmqueue.c sinval.c \ 8 | sinvaladt.c spin.c 9 | -------------------------------------------------------------------------------- /src/backend/storage/item.h: -------------------------------------------------------------------------------- 1 | /* 2 | * item.h -- 3 | * POSTGRES disk item definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef ItemIncluded /* Include this file only once. */ 10 | #define ItemIncluded 1 11 | 12 | #include "tmp/c.h" 13 | #include "access/htup.h" 14 | 15 | typedef Pointer Item; 16 | 17 | typedef uint16 ItemIndex; 18 | typedef uint16 ItemNumber; 19 | 20 | /* 21 | * ItemIsValid 22 | * True iff the block number is valid. 23 | */ 24 | #define ItemIsValid(item) PointerIsValid(item) 25 | 26 | #endif /* !defined(ItemIncluded) */ 27 | -------------------------------------------------------------------------------- /src/backend/storage/itempos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * itempos.h -- 3 | * Standard POSTGRES buffer page long item subposition definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef ItemPosIncluded /* Include this file only once. */ 10 | #define ItemPosIncluded 1 11 | 12 | #include "tmp/c.h" 13 | #include "storage/buf.h" 14 | #include "storage/itemid.h" 15 | 16 | typedef struct ItemSubpositionData { 17 | Buffer op_db; 18 | ItemId op_lpp; 19 | char *op_cp; /* XXX */ 20 | uint32 op_len; 21 | } ItemSubpositionData; 22 | 23 | typedef ItemSubpositionData *ItemSubposition; 24 | 25 | /* 26 | * PNOBREAK(OBJP, LEN) 27 | * struct objpos *OBJP; 28 | * unsigned LEN; 29 | */ 30 | #define PNOBREAK(OBJP, LEN) ((OBJP)->op_len >= LEN) 31 | 32 | /* 33 | * PSKIP(OBJP, LEN) 34 | * struct objpos *OBJP; 35 | * unsigned LEN; 36 | */ 37 | #define PSKIP(OBJP, LEN)\ 38 | { (OBJP)->op_cp += (LEN); (OBJP)->op_len -= (LEN); } 39 | 40 | #endif /* !defined(ItemPosIncluded) */ 41 | -------------------------------------------------------------------------------- /src/backend/storage/large_object/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/large_object 6 | 7 | SRCS+= inv_api.c lo_api.c lo_utils.c jo_utils.c 8 | -------------------------------------------------------------------------------- /src/backend/storage/lmgr/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/lmgr 6 | 7 | SRCS+= lmgr.c lock.c multi.c proc.c single.c 8 | -------------------------------------------------------------------------------- /src/backend/storage/page.h: -------------------------------------------------------------------------------- 1 | /* 2 | * page.h -- 3 | * POSTGRES buffer page abstraction definitions. 4 | */ 5 | 6 | #ifndef PageIncluded /* Include this file only once */ 7 | #define PageIncluded 1 8 | 9 | /* 10 | * Identification: 11 | */ 12 | #define PAGE_H "$Header$" 13 | 14 | #include "tmp/c.h" 15 | 16 | typedef Pointer Page; 17 | 18 | /* 19 | * PageIsValid -- 20 | * True iff page is valid. 21 | */ 22 | #define PageIsValid(page) PointerIsValid(page) 23 | 24 | #endif /* !defined(PageIncluded) */ 25 | -------------------------------------------------------------------------------- /src/backend/storage/page/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/page 6 | 7 | # 8 | # OBSOLETE? - block.c item.c itemid.c off.c page.c pagenum.c pos.c 9 | # 10 | 11 | SRCS+= bufpage.c itemptr.c part.c pskip.c 12 | -------------------------------------------------------------------------------- /src/backend/storage/page/part.c: -------------------------------------------------------------------------------- 1 | /* 2 | * part.c -- 3 | * POSTGRES "partition" code. 4 | */ 5 | 6 | #include "tmp/c.h" 7 | 8 | #include "storage/block.h" 9 | #include "storage/bufpage.h" /* XXX for PageSize */ 10 | #include "storage/off.h" 11 | #include "storage/part.h" 12 | 13 | RcsId("$Header$"); 14 | 15 | /* 16 | * PagePartitionIsValid is now a macro in part.h -cim 4/27/91 17 | */ 18 | 19 | PagePartition 20 | CreatePagePartition(blockSize, pageSize) 21 | BlockSize blockSize; 22 | PageSize pageSize; 23 | { 24 | Assert(BlockSizeIsValid(blockSize)); 25 | Assert(PageSizeIsValid(pageSize)); 26 | 27 | if (pageSize > blockSize || blockSize % pageSize != 0) { 28 | return (InvalidPagePartition); 29 | } 30 | { 31 | Count numberOfPages = blockSize / pageSize; 32 | PagePartition partition = 0; 33 | 34 | while (numberOfPages > 1) { 35 | partition += 1; 36 | numberOfPages /= 2; 37 | } 38 | return (partition); 39 | } 40 | } 41 | 42 | Count 43 | PagePartitionGetPagesPerBlock(partition) 44 | PagePartition partition; 45 | { 46 | Count numberOfPages = 1; 47 | 48 | while (partition > 0) { 49 | numberOfPages *= 2; 50 | partition -= 1; 51 | } 52 | return (numberOfPages); 53 | } 54 | -------------------------------------------------------------------------------- /src/backend/storage/pagenum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pagenum.h -- 3 | * POSTGRES page number definitions. 4 | */ 5 | 6 | #ifndef PageNumIncluded /* Include this file only once */ 7 | #define PageNumIncluded 1 8 | 9 | /* 10 | * Identification: 11 | */ 12 | #define PAGENUM_H "$Header$" 13 | 14 | #include "tmp/c.h" 15 | #include "storage/page.h" 16 | #include "storage/part.h" 17 | 18 | typedef uint16 PageNumber; 19 | 20 | #define FirstPageNumber 0 /* page nubmer for the first page of a block */ 21 | 22 | typedef uint32 LogicalPageNumber; 23 | 24 | #define InvalidLogicalPageNumber 0 25 | 26 | /* 27 | * PageNumberIsValid -- 28 | * True iff the page number is valid. 29 | */ 30 | #define PageNumberIsValid(pageNumber, partition) \ 31 | ((bool)((pageNumber) < PagePartitionGetPagesPerBlock(partition))) 32 | 33 | /* 34 | * LogicalPageNumberIsValid -- 35 | * True iff the logical page number is valid. 36 | */ 37 | #define LogicalPageNumberIsValid(pageNumber) \ 38 | ((bool)((pageNumber) != InvalidLogicalPageNumber)) 39 | 40 | 41 | #endif /* !defined(PageNumIncluded) */ 42 | -------------------------------------------------------------------------------- /src/backend/storage/pldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pldebug.h -- 3 | * POSTGRES lock manager debugging definitions. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef PLDebugIncluded /* Include this file only once */ 10 | #define PLDebugIncluded 1 11 | 12 | #include 13 | #include 14 | 15 | 16 | #define ERROR 1 17 | #define LDEBUG 2 18 | /* #define DEBUG 2 /* !! */ 19 | #define DEBERR 3 20 | #define STATISTIC 4 21 | #define LOCK 5 22 | 23 | #define LOCK_LOG_FILE "LtLockLog" /* the shared lock log file name*/ 24 | #define SYNCH_LOG_FILE "LtSyncLog" /* the trace file name */ 25 | 26 | extern void DebugOn(); 27 | extern void DebugOff(); 28 | extern int DebugIsOn(); 29 | extern void DebugErrorOn(); 30 | extern void DebugErrorOff(); 31 | extern int DebugErrorIsOn(); 32 | extern void DebugFileOn(); 33 | extern void DebugFileOff(); 34 | extern int DebugFileIsOn(); 35 | extern void DebugStderrOn(); 36 | extern void DebugStderrOff(); 37 | extern int DebugStderrIsOn(); 38 | extern void LockLogFileInit(); 39 | 40 | #endif /*!defined(PLDebugIncluded) */ 41 | -------------------------------------------------------------------------------- /src/backend/storage/procq.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | 3 | 4 | /* don't include twice */ 5 | 6 | #ifndef _PROCQ_H_ 7 | #define _PROCQ_H_ 8 | 9 | #include "storage/shmem.h" 10 | 11 | 12 | typedef struct procQueue { 13 | SHM_QUEUE links; 14 | int size; 15 | } PROC_QUEUE; 16 | 17 | #endif _PROCQ_H_ 18 | -------------------------------------------------------------------------------- /src/backend/storage/smgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * smgr.h -- storage manager switch public interface declarations. 3 | * 4 | * $Header$ 5 | */ 6 | 7 | #ifndef _SMGR_H_ 8 | 9 | #define SM_FAIL 0 10 | #define SM_SUCCESS 1 11 | 12 | #define DEFAULT_SMGR 0 13 | 14 | extern int smgrinit(); 15 | extern void smgrshutdown(); 16 | extern int smgrcreate(); 17 | extern int smgrunlink(); 18 | extern int smgrextend(); 19 | extern int smgropen(); 20 | extern int smgrclose(); 21 | extern int smgrread(); 22 | extern int smgrwrite(); 23 | extern int smgrflush(); 24 | extern int smgrblindwrt(); 25 | extern int smgrnblocks(); 26 | extern int smgrcommit(); 27 | extern int smgrabort(); 28 | extern bool smgriswo(); 29 | 30 | #endif /* ndef _SMGR_H_ */ 31 | -------------------------------------------------------------------------------- /src/backend/storage/smgr/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/storage/smgr 6 | 7 | SRCS+= jbaccess.c md.c mm.c pgjb.c sj.c smgr.c smgrtype.c 8 | -------------------------------------------------------------------------------- /src/backend/storage/spin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * spin.h -- synchronization routines 3 | * 4 | * Identification: 5 | * $Header$ 6 | */ 7 | 8 | #ifndef SPINIncluded /* Include this file only once */ 9 | #define SPINIncluded 1 10 | 11 | /* 12 | * two implementations of spin locks 13 | * 14 | * sequent, sparc, sun3: real spin locks. uses a TAS instruction; see 15 | * src/storage/ipc/s_lock.c for details. 16 | * 17 | * default: fake spin locks using semaphores. see spin.c 18 | * 19 | */ 20 | 21 | typedef int SPINLOCK; 22 | 23 | #define is_LOCKED(lock) Assert(SpinIsLocked(lock)) 24 | 25 | #endif /* !defined(SPINIncluded) */ 26 | -------------------------------------------------------------------------------- /src/backend/storage/taslock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * taslock.h -- 3 | * 4 | * Note: 5 | * Included by pladt.h. 6 | */ 7 | 8 | #ifndef TasLockIncluded /* Include this file only once */ 9 | #define TasLockIncluded 1 10 | 11 | /* 12 | * Identification: 13 | */ 14 | #define TASLOCK_H "$Header$" 15 | 16 | #include "port_taslock.h" /* from port* directory */ 17 | 18 | #define NUMPROCS 64 19 | 20 | typedef unsigned char ubyte; 21 | 22 | typedef struct { 23 | slock_t MasterLock; /* lock is in use for read or write */ 24 | slock_t MinorLock; /* spin-lock (monitor access) */ 25 | int NHeld; /* number of (read) locks held */ 26 | int NWait; /* number of processes waiting for lock */ 27 | } TasLock; 28 | 29 | typedef struct { 30 | TasLock Tas[NUMTASLOCKS]; /* normal Tas locks */ 31 | TasLock TasInit; /* spin lock for array allocation */ 32 | int NumProcs; /* this + Array_* gov't by TasInit*/ 33 | int Array_Pid[NUMPROCS]; 34 | int Array_Lck[NUMPROCS]; 35 | char Monitor[NUMPROCS]; 36 | } TASStructure; 37 | 38 | #endif /* !defined(TasLockIncluded) */ 39 | -------------------------------------------------------------------------------- /src/backend/tcop/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/tcop 6 | 7 | SRCS+= aclchk.c creatinh.c dest.c fastpath.c parsev.c pfrag.c postgres.c \ 8 | pquery.c slaves.c utility.c 9 | 10 | HEADERS+= creatinh.h dest.h parsev.h pfrag.h pquery.h \ 11 | slaves.h tcop.h tcopdebug.h tcopprot.h utility.h 12 | -------------------------------------------------------------------------------- /src/backend/tcop/creatinh.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * creatinh.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for creatinh.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef creatinhIncluded /* include this file only once */ 17 | #define creatinhIncluded 1 18 | 19 | /* 20 | * DefineRelation -- 21 | * Creates a new relation. 22 | */ 23 | 24 | /* 25 | * RemoveRelation -- 26 | * Deletes a new relation. 27 | * 28 | * Exceptions: 29 | * BadArg if name is invalid. 30 | * 31 | * Note: 32 | * If the relation has indices defined on it, then the index relations 33 | * themselves will be destroyed, too. 34 | */ 35 | extern void DefineRelation ARGS((char *relname, LispValue parameters, LispValue schema)); 36 | extern void RemoveRelation ARGS((Name name)); 37 | extern List lispCopyList ARGS((List list)); 38 | 39 | #endif /* creatinhIncluded */ 40 | -------------------------------------------------------------------------------- /src/backend/tcop/parsev.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * parsev.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for parsev.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef parsevIncluded /* include this file only once */ 17 | #define parsevIncluded 1 18 | 19 | extern void ValidateParse ARGS((List parse)); 20 | 21 | #endif /* parsevIncluded */ 22 | -------------------------------------------------------------------------------- /src/backend/tcop/pfrag.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * pfrag.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for pfrag.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef pfragIncluded /* include this file only once */ 17 | #define pfragIncluded 1 18 | 19 | extern Fragment InitialPlanFragments ARGS((List parsetree, Plan plan)); 20 | extern void OptimizeAndExecuteFragments ARGS((List fragmentlist, CommandDest destination)); 21 | 22 | #endif /* pfragIncluded */ 23 | -------------------------------------------------------------------------------- /src/backend/tcop/utility.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * utility.h 4 | * 5 | * DESCRIPTION 6 | * prototypes for utility.c. 7 | * 8 | * NOTES 9 | * Automatically generated using mkproto 10 | * 11 | * IDENTIFICATION 12 | * $Header$ 13 | * ---------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef utilityIncluded /* include this file only once */ 17 | #define utilityIncluded 1 18 | 19 | extern void ProcessUtility ARGS((int command, LispValue args, char *commandString, CommandDest dest)); 20 | 21 | #endif /* utilityIncluded */ 22 | -------------------------------------------------------------------------------- /src/backend/tmp/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/tmp 6 | HEADERS+= acl.h c.h daemon.h datum.h fastpath.h fstack.h hasht.h \ 7 | installinfo.h libpq-be.h libpq-fe.h libpq-fs.h libpq.h \ 8 | miscadmin.h nodeFuncs.h portal.h postgres.h pqcomm.h simplelists.h \ 9 | stringinfo.h utilities.h 10 | -------------------------------------------------------------------------------- /src/backend/tmp/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * daemon.h -- 3 | * Declarations for using POSTGRES system daemons. 4 | * 5 | * Identification: 6 | * $Header$ 7 | */ 8 | 9 | #ifndef DaemonIncluded 10 | #define DaemonIncluded 11 | 12 | #include 13 | 14 | #define SIGKILLDAEMON1 SIGINT 15 | #define SIGKILLDAEMON2 SIGTERM 16 | 17 | 18 | /* 19 | * DBNameStartVacuumDaemon -- 20 | * Start a daemon on the given database. 21 | * DBNameStopVacuumDaemon -- 22 | * Stop the daemon running on the given database. 23 | * DBNameCleanupVacuumDaemon -- 24 | * Clean up after a dead vacuum daemon. 25 | * DBNameGetVacuumDaemonProcessId -- 26 | * Find the pid of the daemon running on the given database, if any. 27 | */ 28 | extern 29 | void 30 | DBNameStartVacuumDaemon ARGS(( 31 | char *dbname 32 | )); 33 | 34 | extern 35 | void 36 | DBNameStopVacuumDaemon ARGS(( 37 | char *dbname 38 | )); 39 | 40 | extern 41 | void 42 | DBNameCleanupVacuumDaemon ARGS(( 43 | char *dbname 44 | )); 45 | 46 | extern 47 | short 48 | DBNameGetVacuumDaemonProcessId ARGS(( 49 | char *dbname 50 | )); 51 | 52 | #endif /* !DaemonIncluded */ 53 | -------------------------------------------------------------------------------- /src/backend/tmp/fastpath.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------- 2 | * FILE 3 | * fastpath.h 4 | * 5 | * DESCRIPTION 6 | * 7 | * NOTES 8 | * This information pulled out of tcop/fastpath.c and put 9 | * here so that the PQfn() in be-pqexec.c could access it. 10 | * -cim 2/26/91 11 | * 12 | * IDENTIFICATION 13 | * $Header$ 14 | * ---------------------------------------------------------------- 15 | */ 16 | 17 | #ifndef FastpathIncluded /* include this file only once. */ 18 | #define FastpathIncluded 1 19 | 20 | /* ---------------- 21 | * fastpath #defines 22 | * ---------------- 23 | */ 24 | #define VAR_LENGTH_RESULT (-1) 25 | #define VAR_LENGTH_ARG (-5) 26 | #define MAX_STRING_LENGTH 256 27 | #define PORTAL_RESULT (-2) 28 | 29 | #endif FastpathIncluded 30 | -------------------------------------------------------------------------------- /src/backend/tmp/hasht.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hasht.h-- 3 | * hash table related functions that are not directly supported 4 | * under utils/hash. 5 | * 6 | * Identification: 7 | * $Header$ 8 | * 9 | */ 10 | 11 | #ifndef HashTIncluded /* Include this file only once */ 12 | #define HashTIncluded 1 13 | 14 | #include "utils/hsearch.h" 15 | 16 | typedef void (*hasht_func)(); 17 | 18 | void HashTableWalk ARGS((HTAB *hashtable, hasht_func func, int arg)); 19 | 20 | #endif /* !defined(HashTIncluded) */ 21 | -------------------------------------------------------------------------------- /src/backend/tmp/installinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * XXX - Bogus copy till i figure out how i want to 3 | * locally configure postgres. - marc 4 | */ 5 | #ifndef INSTALLINFO_H 6 | #define INSTALLINFO_H 7 | 8 | #define DATAHOME "$TREE" /* loc of data/ dir */ 9 | #define AMIINT "$TREE/$OD/support/backend" /* for vacuumd */ 10 | #define SRCDIR "$TREE/src/support" /* source directory */ 11 | #define SCRDIR "$TREE/$OD/support" /* script directory */ 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/backend/tmp/nodeFuncs.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | 3 | extern bool single_node ARGS((Node node)); 4 | extern bool var_is_outer ARGS((Var var)); 5 | extern bool var_is_inner ARGS((Var var)); 6 | extern bool var_is_mat ARGS((Var var)); 7 | extern bool var_is_rel ARGS((Var var)); 8 | extern Oper replace_opid ARGS((Oper oper)); 9 | extern bool constant_p ARGS((Expr node)); 10 | extern bool non_null ARGS((Expr c)); 11 | extern bool is_null ARGS((Expr c)); 12 | extern bool join_p ARGS((Node node)); 13 | extern bool scan_p ARGS((Node node)); 14 | extern bool temp_p ARGS((Node node)); 15 | extern bool plan_p ARGS((Node node)); 16 | -------------------------------------------------------------------------------- /src/backend/tmp/utilities.h: -------------------------------------------------------------------------------- 1 | /* $Header$ */ 2 | extern LispValue vectori_long_to_list ARGS((int *vectori, int start, int n)); 3 | /* extern LispValue same ARGS((LispValue list1, LispValue list2)); */ 4 | extern LispValue last_element ARGS((LispValue list)); 5 | extern LispValue copy_seq_tree ARGS((LispValue seqtree)); 6 | extern base_log ARGS((double foo)); 7 | extern max ARGS((int foo, int bar)); 8 | -------------------------------------------------------------------------------- /src/backend/utils/adt/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/adt 6 | 7 | # 8 | # DEAD CODE: a copy of smgr.c was found here. live version: storage/smgr/... 9 | # 10 | 11 | SRCS+= acl.c arrayfuncs.c arrayutils.c bool.c char.c chunk.c date.c datum.c dt.c filename.c float.c ftype.c geo-ops.c geo-selfuncs.c int.c lo_regprocs.c misc.c nabstime.c name.c not_in.c numutils.c oid.c oidchar16.c oidint2.c oidint4.c regexp.c regproc.c selfuncs.c tid.c varlena.c sets.c 12 | 13 | -------------------------------------------------------------------------------- /src/backend/utils/adt/bool.c: -------------------------------------------------------------------------------- 1 | /* 2 | * bool.c -- 3 | * Functions for the built-in type "bool". 4 | */ 5 | 6 | #include "tmp/c.h" 7 | #include "utils/log.h" 8 | 9 | RcsId("$Header$"); 10 | 11 | #include "utils/palloc.h" 12 | 13 | /* ========== USER I/O ROUTINES ========== */ 14 | 15 | 16 | /* 17 | * boolin - converts "t" or "f" to 1 or 0 18 | */ 19 | int32 20 | boolin(b) 21 | char *b; 22 | { 23 | if (b == NULL) 24 | elog(WARN, "Bad input string for type bool"); 25 | return((int32) (*b == 't') || (*b == 'T')); 26 | } 27 | 28 | /* 29 | * boolout - converts 1 or 0 to "t" or "f" 30 | */ 31 | char * 32 | boolout(b) 33 | long b; 34 | { 35 | char *result = (char *) palloc(2); 36 | 37 | *result = (b) ? 't' : 'f'; 38 | result[1] = '\0'; 39 | return(result); 40 | } 41 | 42 | 43 | /* ========== PUBLIC ROUTINES ========== */ 44 | 45 | int32 booleq(arg1, arg2) int8 arg1, arg2; { return(arg1 == arg2); } 46 | int32 boolne(arg1, arg2) int8 arg1, arg2; { return(arg1 != arg2); } 47 | 48 | /* ========== PRIVATE ROUTINES ========== */ 49 | 50 | -------------------------------------------------------------------------------- /src/backend/utils/adt/dt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dt.c -- 3 | * Functions for the built-in type "dt". 4 | */ 5 | 6 | #include "tmp/c.h" 7 | 8 | RcsId("$Header$"); 9 | 10 | #include "utils/palloc.h" 11 | #include "utils/builtins.h" 12 | 13 | 14 | /* ========== USER I/O ROUTINES ========== */ 15 | 16 | /* 17 | * dtin - converts "nseconds" to internal representation 18 | * 19 | * XXX Currently, just creates an integer. 20 | */ 21 | int32 22 | dtin(datetime) 23 | char *datetime; 24 | { 25 | if (datetime == NULL) 26 | return((int32) 0); 27 | return((int32) atol(datetime)); 28 | } 29 | 30 | /* 31 | * dtout - converts internal form to "..." 32 | * 33 | * XXX assumes sign, 10 digits max, '\0' 34 | */ 35 | char * 36 | dtout(datetime) 37 | int32 datetime; 38 | { 39 | char *result; 40 | 41 | result = (char *) palloc(12); 42 | Assert(result); 43 | ltoa(datetime, result); 44 | return(result); 45 | } 46 | 47 | 48 | /* ========== PUBLIC ROUTINES ========== */ 49 | 50 | /* (see int.c for comparison/operation routines) */ 51 | 52 | 53 | /* ========== PRIVATE ROUTINES ========== */ 54 | 55 | /* (none) */ 56 | -------------------------------------------------------------------------------- /src/backend/utils/adt/lo_regprocs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * lo_regprocs.c - registered "in" and "out" functions for large object 3 | * ADT's. 4 | * 5 | * $Header$ 6 | */ 7 | 8 | #include 9 | #include "tmp/c.h" 10 | #include "tmp/libpq-fs.h" 11 | #include "access/relscan.h" 12 | #include "access/tupdesc.h" 13 | #include "catalog/pg_naming.h" 14 | #include "catalog/pg_lobj.h" 15 | #include "storage/itemptr.h" 16 | #include "utils/rel.h" 17 | #include "utils/large_object.h" 18 | #include "utils/log.h" 19 | 20 | /* 21 | * These routines allow the user to import and export Postgres PURE_FILE 22 | * large objects. 23 | */ 24 | 25 | extern LargeObject *NewLargeObject(); 26 | 27 | char * 28 | lo_filein(filename) 29 | 30 | char *filename; 31 | 32 | { 33 | return((char *) NewLargeObject(filename, EXTERNAL_FILE)); 34 | } 35 | 36 | char * 37 | lo_fileout(object) 38 | 39 | LargeObject *object; 40 | 41 | { 42 | char *retval; 43 | 44 | Assert(PointerIsValid(object)); 45 | 46 | retval = (char *) palloc(strlen(object->lo_ptr.filename) + 1); 47 | 48 | strcpy(retval, object->lo_ptr.filename); 49 | return(retval); 50 | } 51 | -------------------------------------------------------------------------------- /src/backend/utils/adt/misc.c: -------------------------------------------------------------------------------- 1 | /* RcsId("$Header$"); */ 2 | 3 | #include 4 | #include "tmp/c.h" 5 | #include "tmp/postgres.h" 6 | #include "tmp/datum.h" 7 | #include "catalog/pg_type.h" 8 | 9 | /*------------------------------------------------------------------------- 10 | * Check if data is Null 11 | */ 12 | 13 | 14 | bool NullValue(value, isNull) 15 | Datum value; 16 | Boolean *isNull; 17 | { 18 | if (*isNull) { 19 | *isNull = false; 20 | return(true); 21 | } 22 | return(false); 23 | 24 | } 25 | 26 | /*----------------------------------------------------------------------* 27 | * check if data is not Null * 28 | *--------------------------------------------------------------------- */ 29 | 30 | bool NonNullValue(value, isNull) 31 | Datum value; 32 | Boolean *isNull; 33 | { 34 | if (*isNull) { 35 | *isNull = false; 36 | return(false); 37 | } 38 | return(true); 39 | 40 | } 41 | 42 | int32 43 | userfntest(i) 44 | int i; 45 | { 46 | return (i); 47 | } 48 | -------------------------------------------------------------------------------- /src/backend/utils/cache/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .PATH: ${.CURDIR}/utils/cache 5 | 6 | SRCS+= catcache.c inval.c rel.c relcache.c syscache.c 7 | -------------------------------------------------------------------------------- /src/backend/utils/error/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/error 6 | 7 | SRCS+= assert.c elog.c exc.c excabort.c excid.c format.c 8 | -------------------------------------------------------------------------------- /src/backend/utils/error/excabort.c: -------------------------------------------------------------------------------- 1 | /* 2 | * excabort.c -- 3 | * Default exception abort code. 4 | */ 5 | 6 | #include "tmp/c.h" 7 | 8 | RcsId("$Header$"); 9 | 10 | #include "utils/exc.h" 11 | 12 | /*ARGSUSED*/ 13 | void 14 | ExcAbort(excP, detail, data, message) 15 | Exception *excP; 16 | ExcDetail detail; 17 | ExcData data; 18 | ExcMessage message; 19 | { 20 | #ifdef __SABER__ 21 | saber_stop(); 22 | #else 23 | /* dump core */ 24 | abort(); 25 | #endif 26 | } 27 | -------------------------------------------------------------------------------- /src/backend/utils/error/excid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * excid.c -- 3 | * POSTGRES known exception identifier code. 4 | */ 5 | 6 | #include "tmp/c.h" 7 | 8 | #include "utils/excid.h" 9 | 10 | RcsId("$Header$"); 11 | 12 | Exception FailedAssertion = { "Failed Assertion" }; 13 | Exception BadState = { "Bad State for Function Call" }; 14 | Exception BadArg = { "Bad Argument to Function Call" }; 15 | 16 | Exception BadAllocSize = { "Too Large Allocation Request" }; 17 | 18 | Exception ExhaustedMemory = { "Memory Allocation Failed" }; 19 | Exception Unimplemented = { "Unimplemented Functionality" }; 20 | 21 | Exception CatalogFailure = {"Catalog failure"}; /* XXX inconsistent */ 22 | Exception InternalError = {"Internal Error"}; /* XXX inconsistent */ 23 | Exception SemanticError = {"Semantic Error"}; /* XXX inconsistent */ 24 | Exception SystemError = {"System Error"}; /* XXX inconsistent */ 25 | -------------------------------------------------------------------------------- /src/backend/utils/fmgr/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .PATH: ${.CURDIR}/utils/fmgr 5 | 6 | SRCS+= dfmgr.c fmgr.c ufp.c 7 | 8 | -------------------------------------------------------------------------------- /src/backend/utils/fmgrtab.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------- 2 | * FILE 3 | * fmgrtab.h 4 | * 5 | * DESCRIPTION 6 | * 7 | * 8 | * NOTES 9 | * 10 | * IDENTIFICATION 11 | * $Header$ 12 | *---------------------------------------------------------------- 13 | */ 14 | 15 | #ifndef FmgrtabIncluded 16 | #define FmgrtabIncluded 1 /* Include this file only once */ 17 | 18 | #include "tmp/postgres.h" /* for ObjectId */ 19 | #include "fmgr.h" 20 | 21 | typedef struct { 22 | ObjectId proid; 23 | uint16 nargs; 24 | func_ptr func; 25 | } FmgrCall; 26 | 27 | extern FmgrCall *fmgr_isbuiltin ARGS((ObjectId id)); 28 | 29 | #endif /* FmgrtabIncluded */ 30 | -------------------------------------------------------------------------------- /src/backend/utils/hash/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/hash 6 | 7 | SRCS+= dynahash.c hashfn.c 8 | -------------------------------------------------------------------------------- /src/backend/utils/init/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/init 6 | 7 | SRCS+= enbl.c globals.c magic.c miscinit.c postinit.c 8 | -------------------------------------------------------------------------------- /src/backend/utils/init/enbl.c: -------------------------------------------------------------------------------- 1 | /* 2 | * enbl.c -- 3 | * POSTGRES module enable and disable support code. 4 | */ 5 | 6 | #include "tmp/c.h" 7 | 8 | RcsId("$Header$"); 9 | 10 | #include "utils/module.h" 11 | 12 | bool 13 | BypassEnable(enableCountInOutP, on) 14 | Count *enableCountInOutP; 15 | bool on; 16 | { 17 | AssertArg(PointerIsValid(enableCountInOutP)); 18 | AssertArg(BoolIsValid(on)); 19 | 20 | if (on) { 21 | *enableCountInOutP += 1; 22 | return ((bool)(*enableCountInOutP >= 2)); 23 | } 24 | 25 | AssertState(*enableCountInOutP >= 1); 26 | 27 | *enableCountInOutP -= 1; 28 | 29 | return ((bool)(*enableCountInOutP >= 1)); 30 | } 31 | -------------------------------------------------------------------------------- /src/backend/utils/init/globals.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * globals.c - global variable declarations 4 | * 5 | * Globals used all over the place should be declared here and not 6 | * in other modules. This reduces the number of modules included 7 | * from cinterface.a during linking. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | /* #include */ 18 | 19 | #include "tmp/postgres.h" 20 | 21 | RcsId("$Header$"); 22 | 23 | #include "access/heapam.h" 24 | #include "access/tqual.h" 25 | #include "storage/sinval.h" 26 | #include "storage/sinvaladt.h" 27 | #include "storage/lmgr.h" 28 | #include "utils/log.h" 29 | 30 | #include "catalog/catname.h" 31 | 32 | int Portfd; 33 | int Noversion = 0; 34 | 35 | char OutputFileName[MAXPGPATH] = ""; 36 | 37 | BackendId MyBackendId; 38 | BackendTag MyBackendTag; 39 | NameData MyDatabaseNameData; 40 | Name MyDatabaseName = &MyDatabaseNameData; 41 | bool MyDatabaseIdIsInitialized = false; 42 | ObjectId MyDatabaseId = InvalidObjectId; 43 | bool TransactionInitWasProcessed = false; 44 | 45 | bool IsUnderPostmaster = false; 46 | bool IsPostmaster = false; 47 | 48 | short DebugLvl = 0; 49 | -------------------------------------------------------------------------------- /src/backend/utils/mmgr/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/mmgr 6 | 7 | SRCS+= aset.c mcxt.c palloc.c pg_malloc.c portalmem.c 8 | -------------------------------------------------------------------------------- /src/backend/utils/sets.h: -------------------------------------------------------------------------------- 1 | /* sets.h 2 | * 3 | * $Header$ 4 | */ 5 | 6 | /* Temporary name of set, before SetDefine changes it. */ 7 | 8 | #ifndef SetsIncluded 9 | #define SetsIncluded 1 10 | 11 | #define GENERICSETNAME "zyxset" 12 | extern ObjectId SetDefine ARGS((char *querystr, Name typename)); 13 | extern int32 seteval ARGS(()); 14 | 15 | #endif SetsIncluded 16 | -------------------------------------------------------------------------------- /src/backend/utils/sort/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/sort 6 | 7 | SRCS+= lselect.c psort.c 8 | -------------------------------------------------------------------------------- /src/backend/utils/time/Makefile.inc: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .PATH: ${.CURDIR}/utils/time 6 | 7 | SRCS+= tqual.c 8 | -------------------------------------------------------------------------------- /src/bigTAGS: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | rm -f TAGS 6 | for i in backend libpq bin; do 7 | find $i \( -name '*.[chy]' -o -name '*.gen' -o -name '*.lex' \) \ 8 | -print | xargs etags -t -a 9 | done 10 | -------------------------------------------------------------------------------- /src/bin/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | # 8 | # C programs 9 | # 10 | SUBDIR= monitor pagedoc pg_id pg_ufp pg_version shmemdoc 11 | # 12 | # Shell scripts 13 | # 14 | SUBDIR+= cleardbdir createdb createuser destroydb destroyuser \ 15 | initdb newbki vacuum ipcclean reindexdb 16 | # 17 | # Subsystems 18 | # 19 | SUBDIR += fsutils s2kutils 20 | 21 | # 22 | # the postmaster had so many files in common with the backend (like 80%) 23 | # so i just made it a second target in the backend Makefile. 24 | # 25 | 26 | .if defined(OLD_MKDIR) 27 | beforeinstall: 28 | @-if test ! -d ${DESTDIR}${BINDIR}; \ 29 | then mkdir ${DESTDIR}${BINDIR}; fi 30 | .endif 31 | 32 | .include 33 | -------------------------------------------------------------------------------- /src/bin/cleardbdir/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= cleardbdir 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/cleardbdir/cleardbdir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ---------------------------------------------------------------- 4 | # FILE 5 | # cleardbdir completely clear out the database directory 6 | # 7 | # DESCRIPTION 8 | # this program clears out the database directory, but leaves the .bki 9 | # files so that initdb(1) can be run again. 10 | # 11 | # ---------------------------------------------------------------- 12 | [ -z "$PGDATA" ] && PGDATA=_fUnKy_DATADIR_sTuFf_ 13 | 14 | echo "This program completely destroys all the databases in the directory" 15 | echo "$PGDATA" 16 | echo _fUnKy_DASH_N_sTuFf_ "Are you sure you want to do this (y/n) [n]? "_fUnKy_BACKSLASH_C_sTuFf_ 17 | read resp || exit 18 | case $resp in 19 | y*) : ;; 20 | *) exit ;; 21 | esac 22 | 23 | cd $PGDATA || exit 24 | for i in * 25 | do 26 | if [ $i != "files" ] 27 | then 28 | /bin/rm -rf $i 29 | fi 30 | done 31 | -------------------------------------------------------------------------------- /src/bin/createdb/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= createdb 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/createuser/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= createuser 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/destroydb/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= destroydb 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/destroyuser/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= destroyuser 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/fsutils/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SUBDIR= icopy pcat pcd pls pmkdir pmv prm prmdir ppwd 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/fsutils/Makefile.global: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | CFLAGS+= -I${.CURDIR}/../../../backend 5 | 6 | # 7 | # Almost all (all?) the C programs in this directory 8 | # link with libpq, so we put it here. 9 | # 10 | .if exists(${.CURDIR}/../../../libpq/${MAKEOBJDIR}/libpq.a) 11 | LIBPQ= ${.CURDIR}/../../../libpq/${MAKEOBJDIR}/libpq.a 12 | .else exists(${LIBDIR}/libpq.a) 13 | LIBPQ= ${LIBDIR}/libpq.a 14 | .endif 15 | 16 | LDADD+= ${LIBPQ} 17 | DPADD+= ${LIBPQ} 18 | 19 | # 20 | # And all the shell scripts here get stuffed with the default 21 | # values for BINDIR, DATADIR, and POSTGRESDIR 22 | # 23 | SEDSCRIPT= -e "s^_fUnKy_BINDIR_sTuFf_^${BINDIR}^g" \ 24 | -e "s^_fUnKy_DATADIR_sTuFf_^${DATADIR}^g" \ 25 | -e "s^_fUnKy_POSTGRESDIR_sTuFf_^${POSTGRESDIR}^g" 26 | -------------------------------------------------------------------------------- /src/bin/fsutils/icopy/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= icopy 4 | 5 | SRCS= icopy.c 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/fsutils/pcat/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= pcat 4 | 5 | SRCS= pcat.c 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/fsutils/pcd/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= pcd 4 | 5 | SRCS= pcd.c 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/fsutils/pcd/aliases.csh: -------------------------------------------------------------------------------- 1 | alias pcd 'eval `\pcd \!:*`' 2 | -------------------------------------------------------------------------------- /src/bin/fsutils/pls/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | CFLAGS+= -I${.CURDIR} 4 | 5 | PROG= pls 6 | 7 | SRCS= ls.c fts.c cmp.c print.c util.c pwcache.c 8 | 9 | .include 10 | -------------------------------------------------------------------------------- /src/bin/fsutils/pmkdir/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= pmkdir 4 | 5 | SRCS= pmkdir.c 6 | 7 | .if ${PORTNAME} == "sparc" 8 | SRCS+= strerror.c 9 | .endif 10 | 11 | .include 12 | -------------------------------------------------------------------------------- /src/bin/fsutils/pmv/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= pmv 4 | 5 | SRCS= pmv.c 6 | 7 | # to pick up strerror(1) on sparc 8 | .if ${PORTNAME} == "sparc" 9 | .PATH: ${.CURDIR}/../pmkdir 10 | SRCS+= strerror.c 11 | .endif 12 | 13 | .include 14 | -------------------------------------------------------------------------------- /src/bin/fsutils/ppwd/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= ppwd 4 | 5 | MAN1= ppwd.1P 6 | 7 | SRCS= ppwd.c 8 | 9 | # need strerror on sparc 10 | .if ${PORTNAME} == "sparc" 11 | .PATH: ${.CURDIR}/../pmkdir 12 | SRCS+= strerror.c 13 | .endif 14 | 15 | .include 16 | -------------------------------------------------------------------------------- /src/bin/fsutils/prm/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= prm 4 | 5 | SRCS= prm.c 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/fsutils/prmdir/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= prmdir 4 | 5 | SRCS= prmdir.c 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/initdb/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= initdb 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/ipcclean/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | .PATH: ${.CURDIR}/${PORTNAME} 8 | 9 | .if (${PORTNAME} == "ultrix4" || ${PORTNAME} == "hpux") 10 | IPCCLEANPATH=/bin:/usr/bin:/usr/ucb 11 | .elif (${PORTNAME} == "sparc" || ${PORTNAME} == "sparc_solaris" || ${PORTNAME} == "alpha" || ${PORTNAME} == "aix") 12 | IPCCLEANPATH=/bin:/sbin:/usr/ucb 13 | .endif 14 | 15 | SEDSCRIPT= -e "s^_fUnKy_IPCCLEANPATH_sTuFf_^${IPCCLEANPATH}^g" 16 | 17 | SHPROG= ipcclean 18 | 19 | .include 20 | -------------------------------------------------------------------------------- /src/bin/ipcclean/aix/ipcclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | PATH=_fUnKy_IPCCLEANPATH_sTuFf_:$PATH 6 | export PATH 7 | ipcs | egrep '^m .*|^s .*' | egrep "`whoami`|postgres|picasso" | \ 8 | awk '{printf "ipcrm -%s %s\n", $1, $2}' '-' | sh 9 | -------------------------------------------------------------------------------- /src/bin/ipcclean/alpha/ipcclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | PATH=_fUnKy_IPCCLEANPATH_sTuFf_:$PATH 6 | export PATH 7 | ipcs | egrep '^m .*|^s .*' | egrep "`whoami`|postgres|picasso" | \ 8 | awk '{printf "ipcrm -%s %s\n", $1, $2}' '-' | sh 9 | -------------------------------------------------------------------------------- /src/bin/ipcclean/hpux/ipcclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | PATH=_fUnKy_IPCCLEANPATH_sTuFf_:$PATH 6 | export PATH 7 | ipcs | egrep '^m .*|^s .*' | egrep "`whoami`|postgres|picasso" | \ 8 | awk '{printf "ipcrm -%s %s\n", $1, $2}' '-' | sh 9 | -------------------------------------------------------------------------------- /src/bin/ipcclean/sparc/ipcclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | PATH=_fUnKy_IPCCLEANPATH_sTuFf_:$PATH 6 | export PATH 7 | ipcs | egrep '^m .*|^s .*' | egrep "`whoami`|postgres|picasso" | \ 8 | awk '{printf "ipcrm -%s %s\n", $1, $2}' '-' | sh 9 | -------------------------------------------------------------------------------- /src/bin/ipcclean/sparc_solaris/ipcclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | PATH=_fUnKy_IPCCLEANPATH_sTuFf_:$PATH 6 | export PATH 7 | ipcs | egrep '^m .*|^s .*' | egrep "`whoami`|postgres|picasso" | \ 8 | awk '{printf "ipcrm -%s %s\n", $1, $2}' '-' | sh 9 | -------------------------------------------------------------------------------- /src/bin/ipcclean/ultrix4/ipcclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | PATH=_fUnKy_IPCCLEANPATH_sTuFf_:$PATH 6 | export PATH 7 | ipcs | egrep '^m .*|^s .*' | egrep "`whoami`|postgres|picasso" | \ 8 | awk '{printf "ipcrm -%s %s\n", $1, $2}' '-' | sh 9 | -------------------------------------------------------------------------------- /src/bin/monitor/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | PROG= monitor 8 | 9 | SRCS= monitor.c 10 | 11 | .include 12 | -------------------------------------------------------------------------------- /src/bin/newbki/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= newbki 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/pagedoc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | PROG= pagedoc 8 | 9 | SRCS= pagedoc.c 10 | 11 | .include 12 | -------------------------------------------------------------------------------- /src/bin/pg_id/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= pg_id 4 | 5 | SRCS= pg_id.c 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/pg_id/pg_id.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | */ 4 | 5 | /* 6 | * Print the user ID for the login name passed as argument, 7 | * or the real user ID of the caller if no argument. If the 8 | * login name doesn't exist, print "NOUSER" and exit 1. 9 | */ 10 | #include 11 | #include 12 | #include 13 | 14 | main(argc, argv) 15 | char **argv; 16 | { 17 | struct passwd *pw; 18 | int ch; 19 | extern int optind; 20 | 21 | while ((ch = getopt(argc, argv, "")) != EOF) 22 | switch (ch) { 23 | case '?': 24 | default: 25 | fprintf(stderr, "usage: pg_id [login]\n"); 26 | exit(1); 27 | } 28 | argc -= optind; 29 | argv += optind; 30 | 31 | if (argc > 0) { 32 | if (argc > 1) { 33 | fprintf(stderr, "usage: pg_id [login]\n"); 34 | exit(1); 35 | } 36 | if ((pw = getpwnam(argv[0])) == NULL) { 37 | printf("NOUSER\n"); 38 | exit(1); 39 | } 40 | printf("%d\n", pw->pw_uid); 41 | } else { 42 | printf("%d\n", getuid()); 43 | } 44 | 45 | exit(0); 46 | } 47 | -------------------------------------------------------------------------------- /src/bin/pg_version/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= pg_version 4 | SRCS= pg_version.c magic.c 5 | .PATH: ${.CURDIR}/../../backend/utils/init 6 | 7 | CFLAGS+= -I${.CURDIR}/../../backend/port/${PORTNAME} 8 | 9 | .include 10 | -------------------------------------------------------------------------------- /src/bin/pg_version/pg_version.c: -------------------------------------------------------------------------------- 1 | 2 | /* $Header$ */ 3 | 4 | #include 5 | 6 | int Noversion = 0; 7 | char *DataDir = (char *) NULL; 8 | 9 | main(argc, argv) 10 | int argc; 11 | char *argv[]; 12 | { 13 | if (argc < 2) { 14 | fprintf(stderr, "pg_version: missing argument\n"); 15 | exit(1); 16 | } 17 | SetPgVersion(argv[1]); 18 | exit(0); 19 | } 20 | 21 | elog() {} 22 | 23 | GetDataHome() 24 | { 25 | return(NULL); 26 | } 27 | -------------------------------------------------------------------------------- /src/bin/reindexdb/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= reindexdb 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/bin/s2kutils/Makefile: -------------------------------------------------------------------------------- 1 | # $Header$ 2 | # 3 | .include 4 | 5 | SUBDIR= s2kdestroy s2kinit s2klist 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/s2kutils/Makefile.global: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .ifndef KRBVERS 5 | KRBVERS= 0 6 | .endif 7 | 8 | SEDSCRIPT+= -e "s^_fUnKy_KrBvErS_sTuFf_^${KRBVERS}^g" 9 | -------------------------------------------------------------------------------- /src/bin/s2kutils/s2kdestroy/Makefile: -------------------------------------------------------------------------------- 1 | # $Header$ 2 | # 3 | .include 4 | 5 | SHPROG= s2kdestroy 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/s2kutils/s2kdestroy/s2kdestroy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | CMDNAME=`basename $0` 6 | # 7 | if [ \! "$PGREALM" ]; then 8 | echo "$CMDNAME: PGREALM not set" 9 | exit 1 10 | fi 11 | 12 | MYUID=`pg_id` 13 | if [ \! "$KRBVERS" ]; then 14 | KRBVERS=_fUnKy_KrBvErS_sTuFf_ 15 | fi 16 | if [ "$KRBVERS" -eq 4 ]; then 17 | if [ "$KRBTKFILE" ]; then 18 | PG_TKT_FILE=$KRBTKFILE@$PGREALM 19 | else 20 | PG_TKT_FILE=/tmp/tkt$MYUID@$PGREALM 21 | fi 22 | KRBTKFILE=$PG_TKT_FILE; export KRBTKFILE 23 | elif [ "$KRBVERS" -eq 5 ]; then 24 | if [ "$KRB5CCNAME" ]; then 25 | PG_TKT_FILE=$KRB5CCNAME@$PGREALM 26 | else 27 | PG_TKT_FILE="FILE:/tmp/krb5cc_$MYUID@$PGREALM" 28 | fi 29 | KRB5CCNAME=$PG_TKT_FILE; export KRB5CCNAME 30 | else 31 | echo No Kerberos version selected 32 | exit 1 33 | fi 34 | echo "Ticket file: $PG_TKT_FILE" 35 | 36 | kdestroy $* 37 | -------------------------------------------------------------------------------- /src/bin/s2kutils/s2kinit/Makefile: -------------------------------------------------------------------------------- 1 | # $Header$ 2 | # 3 | .include 4 | 5 | SHPROG= s2kinit 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/s2kutils/s2kinit/s2kinit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | CMDNAME=`basename $0` 6 | 7 | if [ -z "$USER" ]; then 8 | if [ -z "$LOGNAME" ]; then 9 | if [ -z "`whoami`" ]; then 10 | echo "$CMDNAME: cannot determine user name" 11 | exit 1 12 | fi 13 | else 14 | USER=$LOGNAME 15 | export USER 16 | fi 17 | fi 18 | # 19 | if [ \! "$PGREALM" ]; then 20 | echo "$CMDNAME: PGREALM not set" 21 | exit 1 22 | fi 23 | 24 | MYUID=`pg_id` 25 | if [ \! "$KRBVERS" ]; then 26 | KRBVERS=_fUnKy_KrBvErS_sTuFf_ 27 | fi 28 | if [ "$KRBVERS" -eq 4 ]; then 29 | if [ "$KRBTKFILE" ]; then 30 | PG_TKT_FILE=$KRBTKFILE@$PGREALM 31 | else 32 | PG_TKT_FILE=/tmp/tkt$MYUID@$PGREALM 33 | fi 34 | KRBTKFILE=$PG_TKT_FILE; export KRBTKFILE 35 | elif [ "$KRBVERS" -eq 5 ]; then 36 | if [ "$KRB5CCNAME" ]; then 37 | PG_TKT_FILE=$KRB5CCNAME@$PGREALM 38 | else 39 | PG_TKT_FILE="FILE:/tmp/krb5cc_$MYUID@$PGREALM" 40 | fi 41 | KRB5CCNAME=$PG_TKT_FILE; export KRB5CCNAME 42 | else 43 | echo No Kerberos version selected 44 | exit 1 45 | fi 46 | echo "Ticket file: $PG_TKT_FILE" 47 | 48 | kinit $USER@$PGREALM 49 | -------------------------------------------------------------------------------- /src/bin/s2kutils/s2klist/Makefile: -------------------------------------------------------------------------------- 1 | # $Header$ 2 | # 3 | .include 4 | 5 | SHPROG= s2klist 6 | 7 | .include 8 | -------------------------------------------------------------------------------- /src/bin/s2kutils/s2klist/s2klist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | CMDNAME=`basename $0` 6 | # 7 | if [ \! "$PGREALM" ]; then 8 | echo "$CMDNAME: PGREALM not set" 9 | exit 1 10 | fi 11 | 12 | MYUID=`pg_id` 13 | if [ \! "$KRBVERS" ]; then 14 | KRBVERS=_fUnKy_KrBvErS_sTuFf_ 15 | fi 16 | if [ "$KRBVERS" -eq 4 ]; then 17 | if [ "$KRBTKFILE" ]; then 18 | PG_TKT_FILE=$KRBTKFILE@$PGREALM 19 | else 20 | PG_TKT_FILE=/tmp/tkt$MYUID@$PGREALM 21 | fi 22 | KRBTKFILE=$PG_TKT_FILE; export KRBTKFILE 23 | elif [ "$KRBVERS" -eq 5 ]; then 24 | if [ "$KRB5CCNAME" ]; then 25 | PG_TKT_FILE=$KRB5CCNAME@$PGREALM 26 | else 27 | PG_TKT_FILE="FILE:/tmp/krb5cc_$MYUID@$PGREALM" 28 | fi 29 | KRB5CCNAME=$PG_TKT_FILE; export KRB5CCNAME 30 | else 31 | echo No Kerberos version selected 32 | exit 1 33 | fi 34 | echo "Ticket file: $PG_TKT_FILE" 35 | 36 | klist $* 37 | -------------------------------------------------------------------------------- /src/bin/shmemdoc/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= shmemdoc 4 | 5 | SRCS= shmemdoc.c 6 | 7 | HEADERS= shmemipc.h shmemipci.h 8 | 9 | .include 10 | -------------------------------------------------------------------------------- /src/bin/shmemdoc/shmemipci.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ipci.h -- 3 | * POSTGRES inter-process communication initialization definitions. 4 | * 5 | * $Header$ 6 | */ 7 | 8 | typedef unsigned long IPCKey; 9 | 10 | #define DefaultIPCKey 17317 11 | 12 | #define SystemPortAddressGetIPCKey(address) (28597 * (address) + 17491) 13 | 14 | #define IPCKeyGetBufferMemoryKey(key) (1 + (key)) 15 | #define IPCKeyGetBufferSemaphoreKey(key) (2 + (key)) 16 | #define IPCKeyGetLockTableMemoryKey(key) (3 + (key)) 17 | #define IPCKeyGetLockTableSemaphoreKey(key) (4 + (key)) 18 | #define IPCKeyGetLockTableSemaphoreBlockKey(key) (5 + (key)) 19 | #define IPCKeyGetSIBufferMemorySemaphoreKey(key) (6 + (key)) 20 | #define IPCKeyGetSIBufferMemoryBlock(key) (7 + (key)) 21 | #define IPCKeyGetExecutorSemaphoreKey(key) (8 + (key)) 22 | #define IPCKeyGetExecutorSharedMemoryKey(key) (9 + (key)) 23 | #define IPCKeyGetSLockSharedMemoryKey(key) (10 + (key)) 24 | #define IPCKeyGetSpinLockSemaphoreKey(key) (11 + (key)) 25 | #define IPCKeyGetWaitIOSemaphoreKey(key) (12 + (key)) 26 | #ifdef SONY_JUKEBOX 27 | #define IPCKeyGetSJWaitSemaphoreKey(key) (13 + (key)) 28 | #endif /* SONY_JUKEBOX */ 29 | #define IPCGetProcessSemaphoreInitKey(key) (14 + (key)) 30 | -------------------------------------------------------------------------------- /src/bin/vacuum/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | SHPROG= vacuum 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/contrib/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | # 8 | # C programs 9 | # 10 | SUBDIR= pgperl spog relshow 11 | .if (${PORTNAME} == "sparc") 12 | SUBDIR+= xposthelp 13 | .endif 14 | 15 | # 16 | # Subsystems 17 | # 18 | SUBDIR += cplusplus 19 | 20 | .if defined(OLD_MKDIR) 21 | beforeinstall: 22 | @-if test ! -d ${DESTDIR}${BINDIR}; \ 23 | then mkdir ${DESTDIR}${BINDIR}; fi 24 | .endif 25 | 26 | .include 27 | -------------------------------------------------------------------------------- /src/contrib/Makefile.global: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | -------------------------------------------------------------------------------- /src/contrib/README: -------------------------------------------------------------------------------- 1 | $Header$ 2 | 3 | The software contained in the directories below was contributed to the 4 | project by people outside of UC Berkeley. We do not make any 5 | guarantees that they will compile on any given operating system, let 6 | alone work correctly. (In fact, some of these programs are 7 | *extremely* OS-dependent.) We will also not provide any help with 8 | this software should you have difficulties with it. It is provided 9 | here solely in the hope that you may find it useful in some way. You 10 | are totally on your own. 11 | 12 | Read the README file in each subdirectory to see what software we have 13 | succeeded in building on our own systems. 14 | -------------------------------------------------------------------------------- /src/contrib/cplusplus/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | # Makefile for Justin Smith's C++/POSTGRES interface package. 5 | # 6 | 7 | .include 8 | 9 | NOMAN= 10 | LDFLAGS= -g 11 | CFLAGS= -g 12 | CFLAGS+= -I${HEADERDIR} 13 | LDADD+= -L${LIBDIR} 14 | 15 | # 16 | # seems to work with both C++ compilers... 17 | # 18 | #CC= CC 19 | CC= g++ 20 | 21 | # 22 | # additional stuff required for C++ 23 | # 24 | 25 | # location of C++ library, if required 26 | #LDADD+= -L/usr/sww/lib 27 | 28 | # location of C++ include files, if required 29 | #CFLAGS+= -I/usr/sww/lib/g++-include 30 | 31 | # jsmith added these flags for CC (cfront). 32 | .if ${CC} == "CC" 33 | CFLAGS+= -DNO_ALLOCA -DNO_DMINUS -DMATH_H_EXTERNS 34 | .endif 35 | 36 | # CenterLine CC wouldn't work without this. don't know why. 37 | .if ${CC} == "CC" 38 | CFLAGS+= -D__STDLIB_H 39 | .endif 40 | 41 | SRCS= pgtest.c 42 | 43 | HEADERS= pg.h 44 | 45 | LDADD+= -lpq 46 | 47 | .MAIN: ${PROG} 48 | 49 | PROG= pgtest 50 | TESTOBJ = pgtest.out 51 | 52 | runtest: ${TESTOBJ} 53 | 54 | ${TESTOBJ}: 55 | ./${PROG} 2>&1 | tee ${TESTOBJ} 56 | 57 | CLEANFILES+= ${TESTOBJ} 58 | 59 | install:: 60 | 61 | .include 62 | -------------------------------------------------------------------------------- /src/contrib/pgperl/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include 5 | 6 | CFLAGS= -g 7 | 8 | # 9 | # PERLDIR is the perl distribution directory. 10 | # you must have already built all of perl (including mus) in order 11 | # to start building pgperl. 12 | # 13 | PERLDIR=/usr/local/devel/perl 14 | MUS= perl ${PERLDIR}/usub/mus 15 | 16 | # 17 | # Don't add uperl.o to OBJS or it will be removed when you do 18 | # "bmake clean"... :-( 19 | # 20 | LDADD+= ${PERLDIR}/uperl.o 21 | LDADD+= -L${LIBDIR} -lpq -lm 22 | 23 | CFLAGS+= -I${HEADERDIR} -I${PERLDIR} 24 | 25 | .SUFFIXES: .mus 26 | 27 | .mus.c: 28 | ${MUS} $< > ${.TARGET} 29 | 30 | SRCS= pg-libpq.mus usersub.c 31 | TESTOBJ= testlibpq.out 32 | PROG= pgperl 33 | 34 | .MAIN: ${PROG} 35 | 36 | ${PROG}: ${PERLDIR}/uperl.o 37 | 38 | ${TESTOBJ}: ${PROG} testlibpq.pl 39 | ./${PROG} ${.CURDIR}/testlibpq.pl 2>&1 | tee ${.TARGET} 40 | 41 | runtest: ${TESTOBJ} 42 | 43 | CLEANFILES+= ${TESTOBJ} pg-libpq.c 44 | 45 | .include 46 | -------------------------------------------------------------------------------- /src/contrib/pgperl/usersub.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Interface to Postgres 3 | * 4 | * Tue Aug 21 14:13:40 1990 Igor Metz 5 | * 6 | * $Header$ 7 | * $Log$ 8 | * Revision 1.2 1993/02/16 22:50:06 aoki 9 | * folded in RWW's changes and tested under ultrix 10 | * 11 | * Revision 1.1 1990/10/24 20:31:25 cimarron 12 | * Initial revision 13 | * 14 | * Revision 1.1 90/08/23 11:49:47 metz 15 | * Initial revision 16 | * 17 | */ 18 | 19 | #include "EXTERN.h" 20 | #include "perl.h" 21 | 22 | extern void init_postgres_stuff(); 23 | 24 | int 25 | userinit() 26 | { 27 | init_postgres_stuff(); 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/contrib/relshow/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include 5 | 6 | CFLAGS= -g 7 | 8 | .if (${PORTNAME} == "ultrix4") 9 | .PATH: ${.CURDIR}/../../tools/bmake 10 | SRCS+= strdup.c 11 | .endif 12 | 13 | LDADD+= -L${LIBDIR} -lpq 14 | 15 | CFLAGS+= -I${HEADERDIR} 16 | 17 | SRCS+= relshow.c 18 | PROG= relshow 19 | 20 | .MAIN: ${PROG} 21 | 22 | .include 23 | -------------------------------------------------------------------------------- /src/contrib/spog/pg_edit.1: -------------------------------------------------------------------------------- 1 | .TH pgedit 1L "Jan 91" "Homebrewed" 2 | .SH NAME 3 | pgedit \- edit a postgres relation 4 | .SH SYNOPSIS 5 | .B pgedit 6 | relation database 7 | .SH DESCRIPTION 8 | pgedit allows you to load the contents of a postgres relation in an editor. 9 | This might be useful after an addattr operation to fill up the new attribute. 10 | 11 | NOTE: THIS SHOULD NOT BE THE GENERAL TOOL FOR DATABASE UPDATES SINCE YOU CAN 12 | DESTROY THE INTEGRITY OF YOUR DATABASE. 13 | 14 | The format of the relation is given as follows: 15 | 16 | :::oid:::att1:::att2:::att3 ... 17 | 18 | To change the separator you can redefine the sep variable in the pgedit 19 | script. 20 | .SH SEE ALSO 21 | spog(1L) 22 | .SH BUGS 23 | Lots, I think. 24 | .SH AUTHORS 25 | Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de). 26 | -------------------------------------------------------------------------------- /src/contrib/spog/pg_info.1: -------------------------------------------------------------------------------- 1 | .TH pginfo 1L "Jan 91" "Homebrewed"name "formatstring" 2 | .SH NAME 3 | pginfo \- get info about a postgres database 4 | .SH SYNOPSIS 5 | .B pginfo 6 | database 7 | .SH DESCRIPTION 8 | pginfo tries to collect some useful information about a given database. 9 | .SH SEE ALSO 10 | spog(1L) 11 | .SH BUGS 12 | Lots, I think. 13 | .SH AUTHORS 14 | Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de). 15 | -------------------------------------------------------------------------------- /src/contrib/xposthelp/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | SRCS= posthelp.c PostgresRoutines.c 8 | 9 | # 10 | # Your favorite compiler 11 | # 12 | CC= cc 13 | 14 | # 15 | # Compiler flags 16 | # 17 | CFLAGS= -g 18 | 19 | # Postgres library 20 | CFLAGS+= -I${.CURDIR}/../../backend 21 | LDADD+= -L${LIBDIR} -lpq 22 | 23 | PROG=posthelp 24 | 25 | afterinstall: 26 | ${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 27 | xposthelp ${DESTDIR}${BINDIR}/xposthelp 28 | 29 | .include 30 | 31 | # 32 | # XView library calls and header files 33 | # 34 | OPENWINHOME=/usr/sww/X11 35 | CFLAGS+= -I$(OPENWINHOME)/include 36 | LDADD+= -L$(OPENWINHOME)/lib -lxview -lolgx -lX11 37 | 38 | xposthelp: xposthelp.o PostgresRoutines.o 39 | $(CC) ${LDFLAGS} -o ${.TARGET} xposthelp.o PostgresRoutines.o ${LDADD} 40 | 41 | all: xposthelp 42 | 43 | CLEANFILES+= xposthelp xposthelp.o 44 | -------------------------------------------------------------------------------- /src/doc/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | .MAIN: all 4 | 5 | PG_DOCDIR=${POSTDOCDIR} 6 | 7 | SRCS= postgres-setup.me release4.2.me 8 | DOCOBJS= ${SRCS:S/.me/.cat/g} ${SRCS:S/.me/.ps/g} 9 | 10 | SUBDIRS= implementation papers user_manual 11 | 12 | all: ${DOCOBJS} 13 | 14 | install: all 15 | @-if [ ! -d ${PG_DOCDIR} ]; then \ 16 | mkdir ${PG_DOCDIR}; \ 17 | fi 18 | for i in ${DOCOBJS}; do \ 19 | ${INSTALL} -m 444 $$i ${PG_DOCDIR}/$$i; \ 20 | done 21 | for i in ${SUBDIRS}; do \ 22 | (cd ${.CURDIR}/$$i; bmake all install); \ 23 | done 24 | 25 | .include 26 | -------------------------------------------------------------------------------- /src/doc/Makefile.global: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .SUFFIXES: .cat .ps .me .eps .fig 6 | 7 | NROFF=nroff 8 | 9 | GROFF=groff -set 10 | 11 | FIG2DEV=fig2dev 12 | 13 | .me.cat: 14 | ${GROFF} -me -Tascii ${.IMPSRC} > ${.TARGET} 15 | 16 | .me.ps: 17 | ${GROFF} -me -Tps ${.IMPSRC} > ${.TARGET} 18 | 19 | .fig.eps: 20 | ${FIG2DEV} -L ps < ${.IMPSRC} > ${.TARGET} 21 | -------------------------------------------------------------------------------- /src/doc/README: -------------------------------------------------------------------------------- 1 | Directories: 2 | 3 | implementation/ 4 | 5 | Implementation notes - as current as we can make them. 6 | 7 | papers/ 8 | 9 | Technical reports about POSTGRES. Some current, most not. 10 | 11 | postgres.faq 12 | 13 | Frequently asked questions about POSTGRES. 14 | 15 | postgres-setup.me 16 | 17 | Installation instructions. 18 | 19 | old_releasenotes/ 20 | 21 | Old release notes. For historical interest. 22 | (current release notes are in file release4.2.me) 23 | 24 | useful/ 25 | 26 | Useful documents from outside. 27 | 28 | user_manual 29 | 30 | File Name Conventions: 31 | 32 | .me - Standard TROFF file using -me macros. This is all we use. 33 | These files may include calls to deqn, dtbl, and ideal. 34 | 35 | .grn - Same as above, but with embedded GRN pictures. PostScript 36 | dumps are distributed for the convienence of those who do 37 | not have access to GRN (a GREMLIN preprocessor for TROFF). 38 | 39 | .doc - Flat ASCII files - just send directly to your line printer. 40 | 41 | .ps - PostScript files - these may be sent directly to your 42 | PostScript laser printer. 43 | -------------------------------------------------------------------------------- /src/doc/implementation/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | .MAIN: all 4 | 5 | .SUFFIXES: .cat .ps .me .ms 6 | 7 | DOCSRCS= am.me array.me smgr.me fmgr.me libpq.me fastpath.me parse-tree.me query-tree.me 8 | 9 | NROFF=nroff 10 | 11 | GROFF=groff -set 12 | 13 | DOCOBJS= ${DOCSRCS:S/.me/.ps/g} 14 | 15 | .me.cat: 16 | ${GROFF} -me -Tascii ${.IMPSRC} > ${.TARGET} 17 | 18 | .me.ps: 19 | ${GROFF} -me -Tps ${.IMPSRC} > ${.TARGET} 20 | 21 | all: ${DOCOBJS} 22 | 23 | install: all 24 | @-if [ ! -d ${POSTDOCDIR} ]; then \ 25 | mkdir ${POSTDOCDIR}; \ 26 | fi 27 | @-if [ ! -d ${POSTDOCDIR}/implementation ]; then \ 28 | mkdir ${POSTDOCDIR}/papers; \ 29 | fi 30 | for i in ${DOCOBJS}; do \ 31 | ${INSTALL} -m 444 $$i ${POSTDOCDIR}/implementation/$$i; \ 32 | done; \ 33 | ${INSTALL} -c -m 444 README ${POSTDOCDIR}/implementation/README 34 | 35 | .include 36 | -------------------------------------------------------------------------------- /src/doc/implementation/README: -------------------------------------------------------------------------------- 1 | $Header$ 2 | 3 | This directory contains detailed implementation notes that are still 4 | (more or less) current. Where they aren't current, we don't have a 5 | better description anywhere else. 6 | 7 | am.me Access method interface 8 | array.me Guide to working with arrays in C 9 | fastpath.me Fast-path interface [NOT COMPLETE] 10 | fmgr.me Function manager interface 11 | libpq.me LIBPQ internals documentation 12 | parse-tree.me Parser output format 13 | query-tree.me Optimizer input/output format [NOT CURRENT] 14 | smgr.me Storage manager interface 15 | -------------------------------------------------------------------------------- /src/doc/user_manual/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include 5 | 6 | SRCS= manual.me \ 7 | manual-arch.fig \ 8 | manual-er.fig \ 9 | manual-files.fig 10 | 11 | EPS= manual-arch.eps \ 12 | manual-er.eps \ 13 | manual-files.eps 14 | 15 | MANUAL=manual.ps 16 | 17 | all: ${MANUAL} 18 | 19 | install: ${MANUAL} 20 | ${INSTALL} -m 444 ${MANUAL} ${POSTDOCDIR}/${MANUAL} 21 | 22 | ${MANUAL}: ${SRCS} ${EPS} 23 | 24 | .include 25 | -------------------------------------------------------------------------------- /src/examples/README: -------------------------------------------------------------------------------- 1 | $Header$ 2 | 3 | These are examples from the User Manual, broken down by chapter. 4 | Feel free to cut-and-paste (or use the \i command in "monitor") 5 | instead of typing them in by hand. 6 | -------------------------------------------------------------------------------- /src/examples/chapter10: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a comment. 3 | * 4 | * $Header$ 5 | */ 6 | 7 | define operator ## (arg2 = int4, 8 | associativity = right, 9 | procedure = int4fac) 10 | \g 11 | 12 | define operator ## (arg1 = int4, 13 | associativity = left, 14 | procedure = int4um) 15 | \g 16 | 17 | define operator ## (arg1 = int4, 18 | arg2 = int4, 19 | procedure = int4pl, 20 | commutator = ## ) 21 | \g 22 | 23 | retrieve (four_factorial = ## 4, 24 | minus_five = ## 5::int2, 25 | minus_four = 4 ##, 26 | four_plus_four = 4 ## 4) 27 | \g 28 | -------------------------------------------------------------------------------- /src/examples/chapter11: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a comment. 3 | * 4 | * $Header$ 5 | */ 6 | 7 | define aggregate my_sum (sfunc1 = int4pl, /* addition */ 8 | basetype = int4, 9 | stype1 = int4, 10 | initcond1 = "0") 11 | \g 12 | 13 | retrieve (salary_sum = my_sum{EMP.salary}) 14 | \g 15 | 16 | define aggregate my_count (sfunc2 = int4inc, /* add one */ 17 | stype2 = int4, 18 | initcond2 = "0") 19 | \g 20 | 21 | retrieve (emp_count = my_count{EMP.oid}) 22 | \g 23 | 24 | define aggregate my_average (sfunc1 = int4pl, /* sum */ 25 | basetype = int4, 26 | stype1 = int4, 27 | sfunc2 = int4inc, /* count */ 28 | stype2 = int4, 29 | finalfunc = int4div, /* division */ 30 | initcond1 = "0", 31 | initcond2 = "0") 32 | \g 33 | 34 | retrieve (emp_average = my_average{EMP.salary}) 35 | \g 36 | -------------------------------------------------------------------------------- /src/examples/chapter9: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a comment. 3 | * 4 | * $Header$ 5 | */ 6 | 7 | define function manager 8 | (language = "postquel", returntype = EMP) 9 | arg is (EMP) 10 | as "retrieve (E.all) from E in EMP 11 | where E.name = DEPT.manager 12 | and DEPT.dname = $1.dept" 13 | \g 14 | 15 | retrieve (EMP.name) 16 | where name(manager(EMP)) = "Claire" 17 | \g 18 | 19 | 20 | retrieve (EMP.name) 21 | where EMP.manager.name = "Claire" 22 | \g 23 | 24 | define function same_dept 25 | (language = "postquel", returntype = setof EMP) 26 | arg is (EMP) 27 | as "retrieve (E.all) from E in EMP 28 | where $1.dept = E.dept" 29 | \g 30 | -------------------------------------------------------------------------------- /src/examples/int4_abs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * int4_abs.c -- absolute value comparison functions 3 | * for int4 data 4 | * 5 | * example from chapter 13 6 | * 7 | * $Header$ 8 | */ 9 | 10 | #include "tmp/c.h" 11 | 12 | #define ABS(a) ((a < 0) ? -a : a) 13 | 14 | /* routines to implement operators */ 15 | 16 | bool int4_abs_lt(a, b) int32 a, b; { return(ABS(a) < ABS(b)); } 17 | 18 | bool int4_abs_le(a, b) int32 a, b; { return(ABS(a) <= ABS(b)); } 19 | 20 | bool int4_abs_eq(a, b) int32 a, b; { return(ABS(a) == ABS(b)); } 21 | 22 | bool int4_abs_ge(a, b) int32 a, b; { return(ABS(a) >= ABS(b)); } 23 | 24 | bool int4_abs_gt(a, b) int32 a, b; { return(ABS(a) > ABS(b)); } 25 | 26 | /* support (signed comparison) routine */ 27 | 28 | int int4_abs_cmp(a, b) int32 a, b; { return(ABS(a) - ABS(b)); } 29 | -------------------------------------------------------------------------------- /src/examples/makefile.aix: -------------------------------------------------------------------------------- 1 | PG_INCLUDE=../backend 2 | 3 | all: int4_abs.so circle.so 4 | 5 | int4_abs.o: int4_abs.c 6 | cc -c -g -I$(PG_INCLUDE) int4_abs.c 7 | 8 | circle.o: circle.c 9 | cc -c -g -I$(PG_INCLUDE) circle.c 10 | 11 | int4_abs.so: int4_abs.o 12 | mkldexport int4_abs.o `pwd` > int4_abs.exp 13 | ld -H512 -T512 -o int4_abs.so -e _nostart \ 14 | -bI:../../lib/postgres.exp -bE:int4_abs.exp \ 15 | int4_abs.o -lm -lc 2>/dev/null 16 | 17 | circle.so: circle.o 18 | mkldexport circle.o `pwd` > circle.exp 19 | ld -H512 -T512 -o circle.so -e _nostart \ 20 | -bI:../../lib/postgres.exp -bE:circle.exp \ 21 | circle.o -lm -lc 2>/dev/null 22 | -------------------------------------------------------------------------------- /src/examples/makefile.hpux: -------------------------------------------------------------------------------- 1 | PG_INCLUDE=../backend 2 | 3 | all: int4_abs.sl circle.sl 4 | 5 | int4_abs.o: int4_abs.c 6 | cc -c -g +z -I$(PG_INCLUDE) int4_abs.c 7 | 8 | circle.o: circle.c 9 | cc -c -g +z -I$(PG_INCLUDE) circle.c 10 | 11 | int4_abs.sl: int4_abs.o 12 | ld -b -o int4_abs.sl int4_abs.o 13 | 14 | circle.sl: circle.o 15 | ld -b -o circle.sl circle.o 16 | -------------------------------------------------------------------------------- /src/examples/makefile.osf1: -------------------------------------------------------------------------------- 1 | PG_INCLUDE=../backend 2 | 3 | all: int4_abs.so circle.so 4 | 5 | int4_abs.o: int4_abs.c 6 | cc -c -g -I$(PG_INCLUDE) int4_abs.c 7 | 8 | circle.o: circle.c 9 | cc -c -g -I$(PG_INCLUDE) circle.c 10 | 11 | int4_abs.so: int4_abs.c 12 | ld -shared -expect_unresolved '*' -o int4_abs.so int4_abs.o 13 | 14 | circle.so: circle.o 15 | ld -shared -expect_unresolved '*' -o circle.so circle.o 16 | -------------------------------------------------------------------------------- /src/examples/makefile.solaris: -------------------------------------------------------------------------------- 1 | PG_INCLUDE=../backend 2 | 3 | all: int4_abs.so circle.so 4 | 5 | int4_abs.o: int4_abs.c 6 | # gcc -c -g -fPIC -I$(PG_INCLUDE) int4_abs.c 7 | cc -c -g -K PIC -I$(PG_INCLUDE) int4_abs.c 8 | 9 | circle.o: circle.c 10 | # gcc -c -g -fPIC -I$(PG_INCLUDE) circle.c 11 | cc -c -g -K PIC -I$(PG_INCLUDE) circle.c 12 | 13 | int4_abs.so: int4_abs.o 14 | ld -G -Bdynamic -o int4_abs.so int4_abs.o 15 | 16 | circle.so: circle.o 17 | ld -G -Bdynamic -o circle.so circle.o 18 | -------------------------------------------------------------------------------- /src/examples/makefile.sunos: -------------------------------------------------------------------------------- 1 | PG_INCLUDE=../backend 2 | 3 | all: int4_abs.so circle.so 4 | 5 | int4_abs.o: int4_abs.c 6 | cc -c -g -PIC -I$(PG_INCLUDE) int4_abs.c 7 | 8 | circle.o: circle.c 9 | cc -c -g -PIC -I$(PG_INCLUDE) circle.c 10 | 11 | int4_abs.so: int4_abs.o 12 | ld -dc -dp -Bdynamic -o int4_abs.so int4_abs.o 13 | 14 | circle.so: circle.o 15 | ld -dc -dp -Bdynamic -o circle.so circle.o 16 | -------------------------------------------------------------------------------- /src/examples/makefile.ultrix4: -------------------------------------------------------------------------------- 1 | PG_INCLUDE=../backend 2 | 3 | all: int4_abs.o circle.o 4 | 5 | int4_abs.o: int4_abs.c 6 | cc -c -g -G 0 -I$(PG_INCLUDE) int4_abs.c 7 | 8 | circle.o: circle.c 9 | cc -c -g -G 0 -I$(PG_INCLUDE) circle.c 10 | -------------------------------------------------------------------------------- /src/grepsrc: -------------------------------------------------------------------------------- 1 | case $# in 2 | 1) : ;; 3 | *) echo 'Specify pattern' 4 | exit 1 5 | ;; 6 | esac 7 | 8 | gfind . -name '*.[hclyg]*' -print | 9 | xargs egrep "$1" 10 | -------------------------------------------------------------------------------- /src/libpq/README: -------------------------------------------------------------------------------- 1 | This directory contains the C version of Libpq, the POSTGRES frontend library. 2 | -------------------------------------------------------------------------------- /src/ref/files/files.5src: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH INFORMATION FILES 01/23/93 5 | .XA 0 "Section 8 \(em Files" 6 | .BH "SECTION 8 \(em FILES" 7 | .XA 1 "General Information" 8 | .SH OVERVIEW 9 | This section describes 10 | some of the important files used by \*(PG. 11 | .SH NOTATION 12 | \*(lq.../\*(rq at the front of file names represents the path to the 13 | postgres user's home directory. Anything in square brackets 14 | .RB (\*(lq "[" \*(rq 15 | and 16 | .RB \*(lq "]" \*(rq) 17 | is optional. 18 | Anything in braces 19 | .RB (\*(lq "{" \*(rq 20 | and 21 | .RB \*(lq "}" \*(rq) 22 | can be repeated 0 or more times. Parentheses 23 | .BR (\*(lq "(" \*(rq 24 | and 25 | .BR \*(lq ")" \*(rq) 26 | are used to group boolean expressions. 27 | .BR | 28 | is the boolean operator 29 | .SM OR\c 30 | \&. 31 | .SH BUGS 32 | The descriptions of 33 | .(C 34 | .../data/PG_VERSION, 35 | .../data/base/*/PG_VERSION, 36 | .)C 37 | the temporary sort files, and the database debugging trace files are 38 | absent. 39 | -------------------------------------------------------------------------------- /src/ref/files/information.5src: -------------------------------------------------------------------------------- 1 | .\" XXX standard disclaimer belongs here.... 2 | .\" $Header$ 3 | .TH INFORMATION FILES 03/10/94 4 | .XA 0 "Section 8 \(em Files" 5 | .BH "SECTION 8 \(em FILES" 6 | .SH OVERVIEW 7 | This section describes 8 | some of the important files used by \*(PG. 9 | .SH NOTATION 10 | \*(lq.../\*(rq 11 | at the front of file names represents the path 12 | to the \*(lqpostgres\*(rq user's home directory. 13 | Anything in square brackets 14 | .RB ( \*(lq[\*(rq 15 | and 16 | .BR \*(lq]\*(rq ) 17 | is optional. 18 | Anything in braces 19 | .RB ( \*(lq{\*(rq 20 | and 21 | .BR \*(lq}\*(rq ) 22 | can be repeated 0 or more times. 23 | Parentheses 24 | .RB ( \*(lq(\*(rq 25 | and 26 | .BR \*(lq)\*(rq ) 27 | are used to group Boolean expressions. 28 | .BR | 29 | is the boolean 30 | operator 31 | .BR OR . 32 | .SH BUGS 33 | The descriptions of 34 | .(C 35 | .../.postgresrc, \c 36 | .../data/PG_VERSION, \c 37 | .../data/*/PG_VERSION, 38 | .)C 39 | the temporary sort files, 40 | and the database debugging trace 41 | files are absent. 42 | -------------------------------------------------------------------------------- /src/ref/index.me: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .nr _0 \n(c. 5 | .\" @(#)index.me 2.8 3/19/81 6 | .\" This version has had comments stripped; an unstripped version is available. 7 | .de (x 8 | .ds |X x 9 | .if \\n(.$>0 \ 10 | . ds |X \\$1 11 | .ie !"\\n(.z"" \ 12 | \{\ 13 | \!.(x \\*(|X 14 | .rm |X 15 | .\} 16 | .el \ 17 | \{\ 18 | . am %\\*(|X )x 19 | . sp \\n(xsu 20 | . ti -\\n(piu 21 | .\} 22 | .. 23 | .de )x 24 | .ie "\\n(.z"" \ 25 | \{\ 26 | . ds |x \\n% 27 | . if \\n(.$>0 \ 28 | . ds |x \\$1 29 | . if "\\*(|x"_" \ 30 | . ig .. 31 | . am %\\*(|X .. 32 | . if \w"\\$2">(\\n(.l-\\n(.i-\\n(.k) \ 33 | . ti +\\n(xuu 34 | \\\\a\\\\t\\$2\\*(|x 35 | ... 36 | . rm |x 37 | . rm |X 38 | .\} 39 | .el \ 40 | \{\ 41 | \!.)x \\$1 \\$2 42 | . br 43 | .\} 44 | .. 45 | .de xp 46 | .br 47 | .@C 2 48 | .ls 1 49 | .vs \\n(.su*\\n($Ru 50 | .fi 51 | .in +\\n(piu 52 | .ds |X x 53 | .if \\n(.$>0 \ 54 | . ds |X \\$1 55 | .xl -(\\n(xuu+\w'...'u) 56 | .di |x 57 | .%\\*(|X 58 | .br 59 | .di 60 | .rm %\\*(|X 61 | .xl \\n($lu 62 | .rm |X 63 | .nf 64 | .in 0 65 | .ta \\n(.lu-\\n(xuuR \\n(.luR 66 | .|x 67 | .fi 68 | .in 69 | .rm |x 70 | .. 71 | .if \n(xu<=0 \ 72 | . nr xu 0.5i 73 | .nr c. \n(_0 74 | -------------------------------------------------------------------------------- /src/ref/make_kwtab: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | # XXX column widths are hard-coded to 15 characters. 6 | # I could fix this using 2-pass system but it doesn't seem 7 | # worth it... 8 | # 9 | awk '/ScanKeywords\[\]/,/^};/ { print; }' $1 | \ 10 | egrep '^[ ]*{' | \ 11 | sed -e 's/^[^"]*"//' -e 's/".*$//' | \ 12 | sort -f | \ 13 | awk ' 14 | { 15 | ++n; 16 | save[n] = $0; 17 | } 18 | END { 19 | print ".ft B"; 20 | print ".nf"; 21 | print ".if n .ta 5 +15 +15 +15"; 22 | print ".if t .ta 0.5i +1.5i +1.5i +1.5i" 23 | ncol = 4; 24 | nrow = int(n / ncol); 25 | if (n % ncol > 0) { 26 | ++nrow; 27 | } 28 | for (i = 1; i <= nrow; ++i) { 29 | x1=i; x2=x1+nrow; x3=x2+nrow; x4=x3+nrow; 30 | print "\t" save[x1] "\t" save[x2] "\t" save[x3] "\t" save[x4]; 31 | } 32 | print ".fi"; 33 | print ".ft"; 34 | } 35 | -------------------------------------------------------------------------------- /src/ref/make_optab: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $Header$ 4 | # 5 | # XXX column widths are hard-coded based on hand-tuning. 6 | # I could fix this with a 2-pass system, but it doesn't seem 7 | # worth it... 8 | # 9 | awk ' 10 | BEGIN { 11 | print ".ta", "+11", "+10", "+39"; 12 | print ".na"; 13 | indt = 11 + 10 + 39; 14 | FS = "\t"; 15 | raw = 0; 16 | } 17 | raw == 1 { 18 | if ($1 != "T}") { 19 | print; 20 | } else { 21 | raw = 0; 22 | } 23 | next; 24 | } 25 | NF == 4 { 26 | print ".TP", indt; 27 | print $1 "\t" $2 "\t" $3; 28 | if ($4 == "T{") { 29 | raw = 1; 30 | } else { 31 | print $4; 32 | } 33 | } 34 | END { 35 | print ".ad b"; 36 | }' $1 37 | -------------------------------------------------------------------------------- /src/ref/postquel/abort.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH ABORT COMMANDS 01/23/93 5 | .\" XXX This .XA has to go after the .TH so that the index page number goes 6 | .\" in the right place... 7 | .XA 1 Commands 8 | .XA 2 Abort 9 | .SH NAME 10 | abort \(em abort the current transaction 11 | .SH SYNOPSIS 12 | .(l M 13 | \fBabort\fP 14 | .)l 15 | .SH DESCRIPTION 16 | This command aborts the current transaction and causes all the 17 | updates made by the transaction to be discarded. 18 | .SH "SEE ALSO" 19 | begin(commands), 20 | end(commands). 21 | -------------------------------------------------------------------------------- /src/ref/postquel/attachas.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH ATTACHAS COMMANDS 01/23/93 5 | .XA 2 Attachas 6 | .SH NAME 7 | attachas \(em reestablish communication using an exising portal 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBattachas\fP name 11 | .)l 12 | .SH DESCRIPTION 13 | This command allows application programs to use a logical name, 14 | .IR name , 15 | in interactions with \*(PG. Suppose the user of an application 16 | program specifies a collection of rules that retrieve data and that 17 | the program fails for some reason. Then, under ordinary 18 | circumstances, all the rules would need to be reentered when the 19 | program is restored. Alternatively, the 20 | .BR attachas 21 | command may be used before defining the rules the first time. Then, 22 | upon restoring the program, the 23 | .BR attachas 24 | command will reattach the user to the active rules. 25 | .SH BUGS 26 | .BR Attachas 27 | is not implemented in Version \*(PV. 28 | -------------------------------------------------------------------------------- /src/ref/postquel/begin.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH BEGIN COMMANDS 01/23/93 5 | .XA 2 Begin 6 | .SH NAME 7 | begin \(em begins a transaction 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBbegin\fP 11 | .)l 12 | .SH DESCRIPTION 13 | This command begins a user transaction which \*(PG will guarantee is 14 | serializable with respect to all concurrently executing transactions. 15 | \*(PG uses two-phase locking to perform this task. If the transaction 16 | is committed, \*(PG will ensure that all updates are done or none of 17 | them are done. Transactions have the standard ACID (atomic, 18 | consistent, isolatable, and durable) property. 19 | .SH "SEE ALSO" 20 | abort(commands), 21 | end(commands). 22 | -------------------------------------------------------------------------------- /src/ref/postquel/close.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH CLOSE COMMANDS 01/23/93 5 | .XA 2 Close 6 | .SH NAME 7 | close \(em close a portal 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBclose\fP [ portal_name ] 11 | .)l 12 | .SH DESCRIPTION 13 | .BR Close 14 | frees the resources associated with a portal, 15 | .IR portal_name. 16 | After this portal is closed, no subsequent operations are allowed on 17 | it. A portal should be closed when it is no longer needed. If 18 | .IR portal_name 19 | is not specified, then the blank portal is closed. 20 | .SH EXAMPLE 21 | .(C 22 | /* 23 | * close the portal FOO 24 | */ 25 | close FOO 26 | .)C 27 | .SH "SEE ALSO" 28 | fetch(commands), 29 | move(commands), 30 | retrieve(commands). 31 | -------------------------------------------------------------------------------- /src/ref/postquel/createdb.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH CREATEDB COMMANDS 01/23/93 5 | .XA 2 Createdb 6 | .SH NAME 7 | createdb \(em create a new database 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBcreatedb\fP dbname 11 | .)l 12 | .SH DESCRIPTION 13 | .BR Createdb 14 | creates a new \*(PG database. The creator becomes the administrator 15 | of the new database. 16 | .SH "SEE ALSO" 17 | createdb(unix), 18 | destroydb(commands), 19 | destroydb(unix), 20 | initdb(unix). 21 | .SH BUGS 22 | This command should 23 | .BR NOT 24 | be executed interactively. The 25 | .IR createdb (unix) 26 | script should be used instead. 27 | -------------------------------------------------------------------------------- /src/ref/postquel/delete.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH DELETE COMMANDS 01/23/93 5 | .XA 2 Delete 6 | .SH NAME 7 | delete \(em delete instances from a class 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBdelete\fR instance_variable [ \fBfrom\fR from_list ] [ \fBwhere\fR qual ] 11 | .)l 12 | .SH DESCRIPTION 13 | .BR Delete 14 | removes instances which satisfy the qualification, 15 | .IR qual , 16 | from the class specified by 17 | .IR instance_variable . 18 | .IR Instance_variable 19 | is either a class name or a variable assigned by 20 | .IR from_list . 21 | If the qualification is absent, the effect is to delete all instances 22 | in the class. The result is a valid, but empty class. 23 | .PP 24 | You must have write access to the class in order to modify it, as well 25 | as read access to any class whose values are read in the qualification 26 | (see 27 | .IR "change acl" (commands). 28 | .SH EXAMPLE 29 | .(C 30 | /* 31 | * Remove all employees who make over $30,000 32 | */ 33 | delete emp where emp.sal > 30000 34 | .)C 35 | .(C 36 | /* 37 | * Clear the hobbies class 38 | */ 39 | delete hobbies 40 | .)C 41 | .SH "SEE ALSO" 42 | destroy(commands). 43 | -------------------------------------------------------------------------------- /src/ref/postquel/destroydb.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH DESTROYDB COMMANDS 01/23/93 5 | .XA 2 Destroydb 6 | .SH NAME 7 | destroydb \(em destroy an existing database 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBdestroydb\fR dbname 11 | .)l 12 | .SH DESCRIPTION 13 | .BR Destroydb 14 | removes the catalog entries for an existing database and deletes the 15 | directory containing the data. It can only be executed by the 16 | database administrator (see 17 | .IR createdb (commands) 18 | for details). 19 | .SH "SEE ALSO" 20 | createdb(commands), 21 | destroydb(unix). 22 | .SH BUGS 23 | This query should 24 | .BR NOT 25 | be executed interactively. The 26 | .IR destroydb (unix) 27 | script should be used instead. 28 | -------------------------------------------------------------------------------- /src/ref/postquel/end.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH END COMMANDS 01/23/93 5 | .XA 2 End 6 | .SH NAME 7 | end \(em commit the current transaction 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBend\fR 11 | .)l 12 | .SH DESCRIPTION 13 | This commands commits the current transaction. All changes made by 14 | the transaction become visible to others and are guaranteed to be 15 | durable if a crash occurs. 16 | .SH "SEE ALSO" 17 | abort(commands), 18 | begin(commands). 19 | -------------------------------------------------------------------------------- /src/ref/postquel/extend_index.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "EXTEND INDEX" COMMANDS 02/13/94 5 | .XA 2 "Extend Index" 6 | .SH NAME 7 | extend index \(em extend a partial secondary index 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBextend\fR \fBindex\fR index-name [\fBwhere\fR qual] 11 | .)l 12 | .SH DESCRIPTION 13 | This command extends the existing partial index called 14 | .IR index-name. 15 | .PP 16 | If a 17 | .IR qual 18 | is given, the index will be extended to cover all instances that satisfy 19 | the predicate specified by 20 | .IR qual 21 | (in addition to the instances the index already covers). If no 22 | .IR qual 23 | is given, the index will be extended to be a complete index. 24 | Note that the predicate may only refer to attributes 25 | of the class on which the specified partial index was defined 26 | (see 27 | .IR "define index" (commands)). 28 | .SH EXAMPLE 29 | .(C 30 | /* 31 | * Extend a partial index on employee salaries to include 32 | * all employees over 40 33 | */ 34 | extend index empsal where emp.age > 39 35 | .)C 36 | .SH "SEE ALSO" 37 | define index(commands), 38 | remove index(commands). 39 | -------------------------------------------------------------------------------- /src/ref/postquel/left_unary.tbl: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .TS 3 | center expand; 4 | l l c l 5 | c l l lw(2i). 6 | \fBType\fP \fBOperator\fP \fBPOSTGRES Function Prototype\fP \fBOperation\fP 7 | _ 8 | box @@ point box_center(box) center of box 9 | _ 10 | float4 @ float4 float4abs(float4) absolute value 11 | _ 12 | float8 @ float8 float8abs(float8) absolute value 13 | % float8 dtrunc(float8) truncate to integer 14 | |/ float8 dsqrt(float8) square root 15 | ||/ float8 dcbrt(float8) cube root 16 | : float8 dexp(float8) exponential function 17 | ; float8 dlog1(float8) natural logarithm 18 | _ 19 | tinterval | abstime intervalstart(tinterval) start of interval 20 | .TE 21 | -------------------------------------------------------------------------------- /src/ref/postquel/remove_aggregate.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "REMOVE AGGREGATE" COMMANDS 01/23/93 5 | .XA 2 "Remove Aggregate" 6 | .SH NAME 7 | remove aggregate \(em remove the definition of an aggregate 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBremove aggregate\fR aggname 11 | .)l 12 | .SH DESCRIPTION 13 | .BR "Remove aggregate" 14 | will remove all reference to an existing aggregate definition. To 15 | execute this command the current user must be the the owner of the 16 | aggregate. 17 | .SH EXAMPLE 18 | .(C 19 | /* 20 | * Remove the average aggregate 21 | */ 22 | remove aggregate avg 23 | .)C 24 | .SH "SEE ALSO" 25 | define aggregate(commands). 26 | -------------------------------------------------------------------------------- /src/ref/postquel/remove_function.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "REMOVE FUNCTION" COMMANDS 03/12/94 5 | .XA 2 "Remove Function" 6 | .SH NAME 7 | remove function \(em remove a user-defined C function 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBremove function \fRfunction_name ( \fP[ type-1 { \fB,\fP type-n } ] \fB) 11 | .)l 12 | .SH DESCRIPTION 13 | .BR "Remove function" 14 | will remove references to an existing C function. To execute this 15 | command the user must be the owner of the function. The input 16 | argument types to the function must be specified, as only the 17 | function with the given name and argument types will be removed. 18 | .SH EXAMPLE 19 | .(C 20 | /* 21 | * this command removes the square root function 22 | */ 23 | remove function sqrt(int4) 24 | .)C 25 | .SH "SEE ALSO" 26 | define function(commands). 27 | .SH BUGS 28 | No checks are made to ensure that types, operators or access methods 29 | that rely on the function have been removed first. 30 | -------------------------------------------------------------------------------- /src/ref/postquel/remove_index.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "REMOVE INDEX" COMMANDS 03/12/94 5 | .XA 2 "Remove Index" 6 | .SH NAME 7 | remove index \(em removes an index from \*(PG 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBremove index\fR index_name 11 | .)l 12 | .SH DESCRIPTION 13 | This command drops an existing index from the \*(PG system. To 14 | execute this command you must be the owner of the index. 15 | .SH EXAMPLE 16 | .(C 17 | /* 18 | * this command will remove the "emp_index" index 19 | */ 20 | remove index emp_index 21 | .)C 22 | .SH "SEE ALSO" 23 | define index(commands). 24 | -------------------------------------------------------------------------------- /src/ref/postquel/remove_rule.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "REMOVE RULE" COMMANDS 01/23/93 5 | .XA 2 "Remove Rule" 6 | .SH NAME 7 | remove rule \- removes a current rule from \*(PG 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBremove\fR [ \fBinstance\fR | \fBrewrite\fR ] \fBrule\fR rule_name 11 | .)l 12 | .SH DESCRIPTION 13 | This command drops the rule named rule_name from the specified \*(PG 14 | rule system. \*(PG will immediately cease enforcing it and will purge 15 | its definition from the system catalogs. 16 | .SH EXAMPLE 17 | .(C 18 | /* 19 | * This example drops the rewrite rule example_1 20 | */ 21 | remove rewrite rule example_1 22 | .)C 23 | .SH "SEE ALSO" 24 | define rule(commands), 25 | remove view(commands). 26 | .SH BUGS 27 | Once a rule is dropped, access to historical information the rule has 28 | written may disappear. 29 | -------------------------------------------------------------------------------- /src/ref/postquel/remove_type.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "REMOVE TYPE" COMMANDS 01/23/93 5 | .XA 2 "Remove Type" 6 | .SH NAME 7 | remove type \(em remove a user-defined type from the system catalogs 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBremove type\fR typename 11 | .)l 12 | .SH DESCRIPTION 13 | This command removes a user type from the system catalogs. Only the 14 | owner of a type can remove it. 15 | .PP 16 | It is the user's responsibility to remove any operators, functions, 17 | aggregates, access methods, sub-types, classes, etc. that use a 18 | deleted type. 19 | .SH EXAMPLE 20 | .(C 21 | /* 22 | * remove the box type 23 | */ 24 | remove type box 25 | .)C 26 | .SH "SEE ALSO" 27 | introduction(commands), 28 | define type(commands), 29 | remove operator(commands). 30 | .SH "BUGS" 31 | It is still possible to remove built-in types. 32 | -------------------------------------------------------------------------------- /src/ref/postquel/remove_view.cmdsrc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH "REMOVE VIEW" COMMANDS 04/25/94 5 | .XA 2 "Remove View" 6 | .SH NAME 7 | remove view \(em removes a view from \*(PG 8 | .SH SYNOPSIS 9 | .(l M 10 | \fBremove view\fR view_name 11 | .)l 12 | .SH DESCRIPTION 13 | This command drops an existing view from the \*(PG system. To 14 | execute this command you must be the owner of the view. 15 | .SH EXAMPLE 16 | .(C 17 | /* 18 | * this command will remove the "myview" view 19 | */ 20 | remove view myview 21 | .)C 22 | .SH "SEE ALSO" 23 | define view(commands), 24 | remove rule(commands), 25 | -------------------------------------------------------------------------------- /src/ref/postquel/right_unary.tbl: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .TS 3 | center expand; 4 | l l c l 5 | c l l lw(2i). 6 | \fBType\fP \fBOperator\fP \fBPOSTGRES Function Prototype\fP \fBOperation\fP 7 | _ 8 | float8 % float8 dround(float8) round to nearest integer 9 | .TE 10 | -------------------------------------------------------------------------------- /src/ref/tmac.an.nr: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .ds II INGRES 5 | .ds PG POSTGRES 6 | .ds UU UNIX 7 | .ds PQ POSTQUEL 8 | .ds LI LIBPQ 9 | .ds PV 4.2 10 | .de (l \" fake "-me"-style lists 11 | .nf 12 | .ie '\\$1'M' .in +0n 13 | .el .in +5n 14 | .. 15 | .de )l 16 | .fi 17 | .in 18 | .. 19 | .de (C \" constant-width font blocks 20 | .(l \\$1 21 | .sp 22 | .. 23 | .de )C 24 | .sp 25 | .)l 26 | .. 27 | .de BH \" reference manual "big header" for sections 28 | .SH NAME 29 | \&\\$1 30 | .. 31 | .de SB \" section/index stuff 32 | .. \" no-op 33 | .de SE 34 | .. \" no-op 35 | .de XA 36 | .. \" no-op 37 | .de XP 38 | .. \" no-op 39 | .de SP 40 | .. 41 | .ds lq "" 42 | .ds rq "" 43 | -------------------------------------------------------------------------------- /src/ref/toc: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .if e .bp 5 | .bp 0 6 | .SE 7 | .TH CONTENTS MANUAL 03/11/94 8 | .af % i 9 | .BH "Table of Contents" 10 | .XP 11 | -------------------------------------------------------------------------------- /src/ref/unix/ppwd.1src: -------------------------------------------------------------------------------- 1 | .\" This is -*-nroff-*- 2 | .\" XXX standard disclaimer belongs here.... 3 | .\" $Header$ 4 | .TH PPWD UNIX 01/23/93 5 | .XA 1 "Ppwd" 6 | .SH NAME 7 | ppwd \- return Inversion file system working directory name 8 | .SH SYNOPSIS 9 | .B ppwd 10 | .SH DESCRIPTION 11 | .B Ppwd 12 | writes the absolute pathname of the current working directory to the 13 | standard output. 14 | .PP 15 | .B Ppwd 16 | exits with status 0 on success, and >0 if an error occurs. 17 | .SH ENVIRONMENT 18 | The environment variable 19 | .SM PFCWD 20 | stores the current Inversion working directory. 21 | .SH SEE ALSO 22 | pcd(unix), 23 | p_getwd(large_objects). 24 | -------------------------------------------------------------------------------- /src/regress/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | .include 5 | 6 | SUBDIR= bench demo regress video 7 | 8 | # 9 | # override default target 10 | #.MAIN: runtest 11 | 12 | runtest: 13 | @for entry in demo regress video; do \ 14 | echo running $$entry...; \ 15 | cd ${.CURDIR}/$$entry; \ 16 | bmake runtest; \ 17 | done 18 | @echo To run the Wisconsin benchmark, you must kill the postmaster, 19 | @echo cd into "bench" and "make runtest". 20 | 21 | install:: 22 | 23 | .include 24 | 25 | # 26 | # and pass runtest to all subdirectories 27 | # 28 | #runtest: _SUBDIRUSE 29 | -------------------------------------------------------------------------------- /src/regress/data/dept.data: -------------------------------------------------------------------------------- 1 | toy sharon 2 | shoe bob 3 | -------------------------------------------------------------------------------- /src/regress/data/emp.data: -------------------------------------------------------------------------------- 1 | (15,12) 25 sharon 1000 sam 2 | (10,5) 30 sam 2000 bill 3 | (11,10) 20 bill 1000 sharon 4 | -------------------------------------------------------------------------------- /src/regress/data/person.data: -------------------------------------------------------------------------------- 1 | mike 40 (3.1,6.2) 2 | joe 20 (5.5,2.5) 3 | sally 34 (3.8,45.8) 4 | sandra 19 (9.345,09.6) 5 | alex 30 (1.352,8.2) 6 | sue 50 (8.34,7.375) 7 | denise 24 (3.78,87.90) 8 | sarah 88 (8.4,2.3) 9 | teresa 38 (7.7,1.8) 10 | nan 28 (6.35,0.43) 11 | leah 68 (0.6,3.37) 12 | wendy 78 (2.62,03.3) 13 | melissa 28 (3.089,087.23) 14 | joan 18 (9.4,47.04) 15 | mary 08 (3.7,39.20) 16 | jane 58 (1.34,0.44) 17 | liza 38 (9.76,6.90) 18 | jean 28 (8.561,7.3) 19 | jenifer 38 (6.6,23.3) 20 | juanita 58 (4.57,35.8) 21 | susan 78 (6.579,3) 22 | zena 98 (0.35,0) 23 | martie 88 (8.358,.93) 24 | chris 78 (9.78,2) 25 | pat 18 (1.19,0.6) 26 | zola 58 (2.56,4.3) 27 | louise 98 (5.0,8.7) 28 | edna 18 (1.53,3.5) 29 | bertha 88 (2.75,9.4) 30 | sumi 38 (1.15,0.6) 31 | koko 88 (1.7,5.5) 32 | gina 18 (9.82,7.5) 33 | rean 48 (8.5,5.0) 34 | sharon 78 (9.237,8.8) 35 | paula 68 (0.5,0.5) 36 | julie 68 (3.6,7.2) 37 | belinda 38 (8.9,1.7) 38 | karen 48 (8.73,0.0) 39 | carina 58 (4.27,8.8) 40 | diane 18 (5.912,5.3) 41 | esther 98 (5.36,7.6) 42 | trudy 88 (6.01,0.5) 43 | fanny 08 (1.2,0.9) 44 | carmen 78 (3.8,8.2) 45 | lita 25 (1.3,8.7) 46 | pamela 48 (8.21,9.3) 47 | sandy 38 (3.8,0.2) 48 | trisha 88 (1.29,2.2) 49 | vera 78 (9.73,6.4) 50 | velma 68 (8.8,8.9) 51 | -------------------------------------------------------------------------------- /src/regress/data/real_city.data: -------------------------------------------------------------------------------- 1 | 0 Oakland (1, 4 ,-122.0,37.9, -121.7,37.9, -121.7,37.4, -122.0,37.4) 2 | 0 Oakland (1, 6 ,-121.7,37.4, -121.7,37.0, -122.1,37.0, -122.1,37.3, -122.0,37.3, -122.0,37.4) 3 | 0 Oakland (1, 3, -122.1,37.3, -122.2,37.5, -122.0,37.5) 4 | 0 Berkeley (1, 4, -122.3,37.9, -122.0,37.9, -122.0,37.6, -122.3,37.6) 5 | 0 Lafayette (1, 4, -122.3,37.4, -122.2,37.4, -122.2,37.0, -122.3,37.0) 6 | -------------------------------------------------------------------------------- /src/regress/data/stud_emp.data: -------------------------------------------------------------------------------- 1 | 3.50000000000000000e+00 sharon 600 jeff 23 (8,7.7) 2 | 3.39999999999999990e+00 400 cim 30 (10.5,4.7) 3 | 2.89999999999999990e+00 100 linda 19 (0.9,6.1) 4 | -------------------------------------------------------------------------------- /src/regress/data/student.data: -------------------------------------------------------------------------------- 1 | (3.1,-1.5) 28 fred 3.70000000000000020e+00 2 | (21.8,4.9) 60 larry 3.10000000000000010e+00 3 | -------------------------------------------------------------------------------- /src/regress/multi/lookcook.awk: -------------------------------------------------------------------------------- 1 | # 2 | # lookcook.awk 3 | # 4 | # cat each monitor file from pgcook into this script: 5 | # % cat pgcook12345.[0-9]* | awk -f lookcook.awk 6 | # 7 | # $Header$ 8 | # 9 | BEGIN { 10 | append = 0; 11 | replace = 0; 12 | retrieve = 0; 13 | last = ""; 14 | } 15 | { 16 | if ($0 ~ /deadlock/) { 17 | if (last ~ /append/) { 18 | append += 1; 19 | } else if (last ~ /retrieve/) { 20 | retrieve += 1; 21 | } else if (last ~ /replace/) { 22 | replace += 1; 23 | } 24 | } 25 | last = $0; 26 | } 27 | END { 28 | print "appends=" append; 29 | print "replaces=" replace; 30 | print "retrieve=" retrieve; 31 | } 32 | -------------------------------------------------------------------------------- /src/regress/regress/aportalappend.source: -------------------------------------------------------------------------------- 1 | /* 2 | * aportalappend.source 3 | * 4 | * $Header$ 5 | */ 6 | 7 | retrieve (r.prs2name, c.relname, r.prs2text) 8 | from r in pg_prs2rule, c in pg_class 9 | where r.prs2name = "r1" 10 | and r.prs2eventrel = c.oid 11 | \g 12 | 13 | /* 14 | * asynctest1 and asynctest1a are created in the regular create.pq 15 | * script. 16 | */ 17 | append asynctest1 (i = 10) 18 | \g 19 | 20 | /* 21 | * should try 22 | * several in one transaction 23 | * multiple backends 24 | */ 25 | -------------------------------------------------------------------------------- /src/regress/regress/aportalcreate.source: -------------------------------------------------------------------------------- 1 | /* 2 | * aportalcreate.source 3 | * 4 | * $Header$ 5 | */ 6 | 7 | create asynctest1 (i = int4) 8 | \g 9 | create asynctest1a (i = int4) 10 | \g 11 | 12 | define rule r1 is on append to asynctest1 do 13 | [append asynctest1a (i = new.i) 14 | notify asynctest1a] 15 | \g 16 | -------------------------------------------------------------------------------- /src/regress/regress/aportaltest.source: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | destroydb aportaldb 3 | createdb aportaldb 4 | if [ $? -ne 0 ]; then 5 | exit 1 6 | fi 7 | monitor aportaldb < aportalcreate.pq 8 | if [ $? -ne 0 ]; then 9 | exit 1 10 | fi 11 | ./aportal > aportal.out 2>&1 & 12 | APORTALPID=$! 13 | # 14 | # wait for startup - need to have this process listening 15 | # 16 | sleep 5 17 | monitor aportaldb < aportalappend.pq 18 | if [ $? -ne 0 ]; then 19 | exit 1 20 | fi 21 | # 22 | # make sure message got out 23 | # 24 | sleep 5 25 | kill $APORTALPID 26 | cat aportal.out 27 | destroydb aportaldb 28 | exit 0 29 | -------------------------------------------------------------------------------- /src/regress/regress/sample.regress.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kelvich/postgres_pre95/d32873e47f7293e9f0523e1644e8c81f29a948e2/src/regress/regress/sample.regress.out -------------------------------------------------------------------------------- /src/regress/regress/ufp1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | * tests: 4 | * - 0 arguments 5 | * - 1 argument 6 | * - pass-by-value arguments and return-values 7 | * - multiple functions per file 8 | */ 9 | 10 | ufp0() 11 | { 12 | return(42); 13 | } 14 | 15 | ufp1(a) 16 | int a; 17 | { 18 | return(a + 1); 19 | } 20 | -------------------------------------------------------------------------------- /src/regress/regress/ufp2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header 3 | * tests: 4 | * - pass-by-reference fixed-size arguments and return-values 5 | * - linking to C library 6 | */ 7 | 8 | #include "tmp/postgres.h" 9 | 10 | Name 11 | ufp2(n1, n2) 12 | Name n1, n2; 13 | { 14 | Name newn = (Name) palloc(sizeof(NameData)); 15 | 16 | if (!newn || !n1 || !n2) 17 | return((Name) NULL); 18 | 19 | (void) sprintf(newn->data, "%s%s", n1->data, n2->data); 20 | return(newn); 21 | } 22 | -------------------------------------------------------------------------------- /src/regress/regress/ufp3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | * tests: 4 | * - pass-by-reference variable-length arguments and return-values 5 | * - linking to non-library functions (e.g., palloc) 6 | */ 7 | 8 | #include "tmp/postgres.h" 9 | 10 | text * 11 | ufp3(t, c) 12 | text *t; 13 | int c; 14 | { 15 | text *newt; 16 | unsigned i, size; 17 | char *p; 18 | 19 | if (!t) 20 | return((text *) NULL); 21 | for (i = 0, p = VARDATA(t); i < VARSIZE(t) - sizeof(VARSIZE(t)); ++i) 22 | if (p[i] == c) 23 | break; 24 | size = i + sizeof(VARSIZE(t)); 25 | newt = (text *) palloc(size); 26 | if (!newt) 27 | return((text *) NULL); 28 | VARSIZE(newt) = size; 29 | (void) strncpy(VARDATA(newt), VARDATA(t), i); 30 | return(newt); 31 | } 32 | -------------------------------------------------------------------------------- /src/tools/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | SUBDIR= bmake bmkdir mkdep 8 | .if (${PORTNAME} == "ultrix4") 9 | SUBDIR+= libdl 10 | .endif 11 | .if (${PORTNAME} == "hpux") 12 | SUBDIR+= bsdinst 13 | .endif 14 | .if (${PORTNAME} == "aix") 15 | SUBDIR+= mkldexport 16 | .endif 17 | 18 | .include 19 | -------------------------------------------------------------------------------- /src/tools/Makefile.global: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | BINDIR= ${TOOLSBINDIR} 6 | LIBDIR= ${TOOLSLIBDIR} 7 | 8 | CFLAGS= -O 9 | LDFLAGS= 10 | STRIP= -s 11 | # 12 | # Normally MACHINE gets set by a parent Makefile.global, but if the 13 | # tools subtree is detached to bootstrap, we'll dummy it up here. 14 | # Nothing here really needs it. 15 | # 16 | MACHINE?= unknown 17 | -------------------------------------------------------------------------------- /src/tools/bmake/doc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Build and install postgres. 3 | # 4 | # You have to cd into doc/ and ref/ by hand to make them. They are 5 | # not done automatically because they depend on groff, which you may not 6 | # have installed. 7 | # Formatted copies of the documents are already made in ../{doc,ref} 8 | # for you. 9 | # 10 | 11 | SUBDIR= backend libpq bin regress 12 | 13 | .include 14 | -------------------------------------------------------------------------------- /src/tools/bmake/mk-proto/postgres.sub.mk: -------------------------------------------------------------------------------- 1 | _SUBDIRUSE: .USE 2 | @for entry in ${SUBDIR}; do \ 3 | (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ 4 | echo "===> $${entry}.${MACHINE}"; \ 5 | cd ${.CURDIR}/$${entry}.${MACHINE}; \ 6 | else \ 7 | echo "===> $$entry"; \ 8 | cd ${.CURDIR}/$${entry}; \ 9 | fi; \ 10 | ${MAKE} ${.TARGET:realinstall=install:S/.depend/depend/}); \ 11 | done 12 | -------------------------------------------------------------------------------- /src/tools/bmake/strdup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | char * 6 | strdup(str) 7 | const char *str; 8 | { 9 | int len; 10 | char *copy; 11 | 12 | len = strlen(str) + 1; 13 | if (!(copy = (char *)malloc((unsigned int)len))) 14 | return((char *)NULL); 15 | bcopy(str, copy, len); 16 | return(copy); 17 | } 18 | -------------------------------------------------------------------------------- /src/tools/bmkdir/Makefile: -------------------------------------------------------------------------------- 1 | .include 2 | 3 | PROG= bmkdir 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /src/tools/bsdinst/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | depend lint tags: 8 | 9 | SHPROG=bsdinst 10 | 11 | .include 12 | -------------------------------------------------------------------------------- /src/tools/bsdinst/README: -------------------------------------------------------------------------------- 1 | $Header$ 2 | 3 | This is just a copy of the bsdinst script from the MIT X11R5 4 | distribution. It works acceptably as a substitute for the BSD 5 | install(1) program. 6 | -------------------------------------------------------------------------------- /src/tools/libdl/COPYRIGHT: -------------------------------------------------------------------------------- 1 | /* 2 | * Ultrix 4.x Dynamic Loader Library Version 1.0 3 | * 4 | * Copyright (c) 1993 Andrew K. Yu, University of California at Berkeley 5 | * All rights reserved. 6 | * 7 | * Permission to use, copy, modify, and distribute this software and its 8 | * documentation for educational, research, and non-profit purposes and 9 | * without fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright notice and 11 | * this permission notice appear in supporting documentation. Permission 12 | * to incorporate this software into commercial products can be obtained 13 | * from the author. The University of California and the author make 14 | * no representations about the suitability of this software for any 15 | * purpose. It is provided "as is" without express or implied warranty. 16 | * 17 | */ 18 | -------------------------------------------------------------------------------- /src/tools/libdl/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Ultrix 4.x Dynamic Loader Library Version 1.0 3 | # 4 | # Copyright (c) 1993 Andrew K. Yu, University of California at Berkeley 5 | # All rights reserved. 6 | # 7 | # Permission to use, copy, modify, and distribute this software and its 8 | # documentation for educational, research, and non-profit purposes and 9 | # without fee is hereby granted, provided that the above copyright 10 | # notice appear in all copies and that both that copyright notice and 11 | # this permission notice appear in supporting documentation. Permission 12 | # to incorporate this software into commercial products can be obtained 13 | # from the author. The University of California and the author make 14 | # no representations about the suitability of this software for any 15 | # purpose. It is provided "as is" without express or implied warranty. 16 | # 17 | 18 | .include 19 | 20 | # 21 | # this package should also compile under gcc with no problem. 22 | # 23 | CFLAGS+= -G 0 24 | 25 | SRCS= dlRef.c dlReloc.c dlInterf.c dlArch.c 26 | 27 | LIB=dl 28 | 29 | .include 30 | -------------------------------------------------------------------------------- /src/tools/libdl/README: -------------------------------------------------------------------------------- 1 | 2 | Ultrix 4.x Dynamic Loader Library Version 1.0 3 | ============================================= 4 | 5 | Copyright (c) 1993 Andrew K. Yu, University of California at Berkeley 6 | All rights reserved. 7 | 8 | 9 | The Dynamic Loader Library implements a simple dlopen/dlsym/dlclose 10 | interface similar to those on other platforms for shared libraries. Since 11 | there is no such thing as shared libraries on Ultrix, it works with 12 | object files and libraries. 13 | 14 | The dynamic loader has been compiled and tested on a DECstation/5000 under 15 | Ultrix 4.2. 16 | 17 | A brief summary of the features are listed below: 18 | 19 | o can load in object files as well as libraries 20 | o has an automatic library search mechanism by which you can specify 21 | libraries like libc_G0.a to be searched for undefined symbols 22 | o the dynamically loaded text section has the proper memory protection 23 | so that you cannot accidentally overwrite the code in memory 24 | 25 | For more information, there are two brief man pages in the man directory. 26 | The test directory contains sample test suites. 27 | 28 | Andrew (andrew@CS.Berkeley.edu) 29 | July 93 30 | 31 | -------------------------------------------------------------------------------- /src/tools/libdl/man/dl_misc.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Ultrix 4.x Dynamic Loader Library Version 1.0 3 | .\" 4 | .\" Copyright (c) 1993 Andrew K. Yu, University of California at Berkeley 5 | .\" All rights reserved. 6 | .\" 7 | .TH dl_misc 3 8 | .SH Name 9 | dl_undefinedSymbols, dl_setLibraries \- miscellaneous functions 10 | .SH Syntax 11 | #include "dl.h" 12 | .PP 13 | char **dl_undefinedSymbols(\fIcount\fP) 14 | .br 15 | int *\fIcount\fP; 16 | .PP 17 | void dl_setLibraries(\fIlibs\fP) 18 | .br 19 | char *\fIlibs\fP; 20 | .SH Description 21 | The 22 | .PN dl_undefinedSymbols 23 | function returns the number of undefined symbols in \fIcount\fR and an 24 | array of strings containing the names of the undefined symbols. The last 25 | element of the array is set to NULL. 26 | .PP 27 | The 28 | .PN dl_setLibraries 29 | takes a string specifying the libraries to be searched automatically 30 | when there are undefined symbols. The string can contain multiple 31 | pathnames, separated by a colon. 32 | .SH Example 33 | .IP 34 | dl_setLibraries("/usr/lib/libc_G0.a:/usr/lib/libm_G0.a"); 35 | .PP 36 | specifies that libc_G0.a and libm_G0.a are to be searched for undefined 37 | symbols during symbol resolution. 38 | .SH See Also 39 | ld(1), dl_open(3) 40 | 41 | -------------------------------------------------------------------------------- /src/tools/libdl/test/README: -------------------------------------------------------------------------------- 1 | This directory contains test suites for the Ultrix 4.x Dynamic Loader Library 2 | Package. 3 | 4 | The tests are: 5 | 6 | (1) main 7 | uses foo.o, bar.o and baz.o. Tests lazy symbol resolution. 8 | 9 | (2) call_mf 10 | uses mathfunc.o and /usr/lib/libm_G0.a. Tests searching of the math 11 | library. 12 | 13 | (3) abc 14 | uses libabc.a (containing a.o, b.o and c.o). Tests loading in of a 15 | library. 16 | 17 | (4) jumbo 18 | uses jumboobj.o. Miscellaneous tests. 19 | 20 | Expected results of the four tests are in *.OUT. 21 | 22 | Good Luck! 23 | 24 | -------------------------------------------------------------------------------- /src/tools/libdl/test/a.c: -------------------------------------------------------------------------------- 1 | char *astr= "a's string"; 2 | 3 | a( x ) 4 | { 5 | if (x) { 6 | printf("A> a references b; x = %d\n", x); 7 | b(133); 8 | }else { 9 | printf("A> x = %d\n", x); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/tools/libdl/test/abc.OUT: -------------------------------------------------------------------------------- 1 | A> a references b; x = 4321 2 | B> b references c; x = 133 3 | C> c references a; x = 12 4 | A> x = 0 5 | C> from a: a's string 6 | -------------------------------------------------------------------------------- /src/tools/libdl/test/abc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "dl.h" 3 | 4 | main( argc, argv ) 5 | int argc; char **argv; 6 | { 7 | void *handle; 8 | void (*func)(); 9 | 10 | if (!dl_init(argv[0])) { 11 | fprintf(stderr, "dl: %s\n", dl_error()); 12 | exit(1); 13 | } 14 | 15 | if ((handle= (void *)dl_open("libabc.a", DL_NOW))==NULL) { 16 | fprintf(stderr, "dl: %s\n", dl_error()); 17 | exit(1); 18 | } 19 | 20 | func= (void(*)()) dl_sym(handle, "a"); 21 | #if DEBUG 22 | printf("func 0x%x\n", func); 23 | print_undef(); 24 | #endif 25 | if(func) { 26 | (*func)(4321); 27 | }else { 28 | printf("dl: %s\n", dl_error()); 29 | } 30 | 31 | #if DEBUG 32 | dl_printAllSymbols(handle); 33 | #endif 34 | dl_close(handle); 35 | #if DEBUG 36 | dl_printAllSymbols(handle); 37 | #endif 38 | 39 | return 0; 40 | } 41 | 42 | print_undef() 43 | { 44 | int count; 45 | char **symbols; 46 | 47 | symbols=dl_undefinedSymbols(&count); 48 | if (symbols) { 49 | printf("undefined symbols: \n"); 50 | while(*symbols) { 51 | printf(" %s\n", *symbols); 52 | symbols++; 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/tools/libdl/test/b.c: -------------------------------------------------------------------------------- 1 | b( x ) 2 | { 3 | if (x) { 4 | printf("B> b references c; x = %d\n", x); 5 | c(12); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/tools/libdl/test/bar.c: -------------------------------------------------------------------------------- 1 | extern int x; 2 | 3 | bar() 4 | { 5 | printf("hi from bar\n"); 6 | baz(x); 7 | } 8 | -------------------------------------------------------------------------------- /src/tools/libdl/test/baz.c: -------------------------------------------------------------------------------- 1 | int x=123; 2 | 3 | baz(y) 4 | { 5 | printf("hi from baz %d\n", y); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/tools/libdl/test/c.c: -------------------------------------------------------------------------------- 1 | extern char *astr; 2 | 3 | c ( x ) 4 | { 5 | if (x) { 6 | printf("C> c references a; x = %d\n", x); 7 | a(0); 8 | printf("C> from a: %s\n", astr); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/tools/libdl/test/call_mf.OUT: -------------------------------------------------------------------------------- 1 | sin(1.570796)= 1.000000 2 | sin(1.047198)= 0.866026 3 | -------------------------------------------------------------------------------- /src/tools/libdl/test/foo.c: -------------------------------------------------------------------------------- 1 | foo() 2 | { 3 | printf("hello world!\n"); 4 | bar(); 5 | printf("hello world!\n"); 6 | } 7 | -------------------------------------------------------------------------------- /src/tools/libdl/test/jumbo.OUT: -------------------------------------------------------------------------------- 1 | *** TRIGO *** 2 | Hello 3 | Alpha = 2.094395 4 | sin = 0.866025 cos = -0.500000 tan = -1.732051 5 | Goodbye 6 | *** TESTANOTHERBUG *** 7 | about to copy array 8 | the string is now This is a test.. 9 | *** TESTSTATICBUG *** 10 | about to reference ptrtyp 11 | ptrtyp[0] = "" 12 | ptrtyp[1] = "!" 13 | ptrtyp[2] = "@" 14 | ptrtyp[3] = "~" 15 | ptrtyp[4] = "*" 16 | ptrtyp[5] = "&" 17 | ptrtyp[6] = "#m" 18 | ptrtyp[7] = "#s" 19 | ptrtyp[8] = "#p" 20 | ptrtyp[9] = "%m" 21 | ptrtyp[10] = "%s" 22 | ptrtyp[11] = "%p" 23 | ptrtyp[12] = "%" 24 | ptrtyp[13] = "#" 25 | ptrtyp[14] = ">" 26 | ptrtyp[15] = "" 27 | ptrtyp[16] = "^" 28 | ptrtyp[17] = "\" 29 | ptrtyp[18] = "" 30 | ptrtyp[19] = "" 31 | ptrtyp[20] = "+" 32 | ptrtyp[21] = "" 33 | ptrtyp[22] = "" 34 | ptrtyp[23] = "" 35 | ptrtyp[24] = "" 36 | *** TESTSWITCHBUG *** 37 | about to reference ptrtyp 38 | ptrtyp[3] = "~" 39 | about to reference ptrtyp 40 | ptrtyp[2] = "@" 41 | about to reference ptrtyp 42 | ptrtyp[1] = "!" 43 | about to reference ptrtyp 44 | ptrtyp[0] = "" 45 | *** DBL *** 46 | 2.0/3: 0.666667 47 | -------------------------------------------------------------------------------- /src/tools/libdl/test/main.OUT: -------------------------------------------------------------------------------- 1 | loading foo.o 2 | dl: "foo.o" has undefined symbols 3 | loading bar.o 4 | dl: "foo.o" has undefined symbols 5 | dl: "foo.o" has undefined symbols 6 | loading baz.o 7 | hello world! 8 | hi from bar 9 | hi from baz 123 10 | hello world! 11 | -------------------------------------------------------------------------------- /src/tools/libdl/test/makefile: -------------------------------------------------------------------------------- 1 | CC= cc 2 | CFLAGS = -G 0 -g -I.. 3 | 4 | LIBDL = ../libdl.a 5 | 6 | SUITES= main call_mf abc 7 | 8 | OBJS= foo.o bar.o baz.o \ 9 | mathfunc.o \ 10 | a.o b.o c.o libabc.a jumboobj.o 11 | 12 | ALLOBJS= $(OBJS) $(SUITES) jumbo 13 | 14 | all: $(ALLOBJS) 15 | 16 | $(SUITES): $(LIBDL) 17 | $(CC) $(CFLAGS) $@.c $(LIBDL) -o $@ 18 | 19 | jumbo: jumbo.c $(LIBDL) 20 | $(CC) $(CFLAGS) jumbo.c $(LIBDL) -lm_G0 -o $@ 21 | 22 | $(LIBDL): 23 | cd ..; make 24 | 25 | libabc.a: a.o b.o c.o 26 | rm -f libabc.a 27 | ar q libabc.a a.o b.o c.o 28 | ranlib libabc.a 29 | 30 | clean: 31 | rm -f $(ALLOBJS) 32 | 33 | -------------------------------------------------------------------------------- /src/tools/libdl/test/mathfunc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | mathfunc( x ) 4 | double x; 5 | { 6 | printf("sin(%lf)= %lf\n", x, sin(x)); 7 | } 8 | -------------------------------------------------------------------------------- /src/tools/mkdep/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | depend lint tags: 8 | 9 | SHPROG=mkdep 10 | 11 | .if (${PORTNAME} == "hpux") 12 | SEDSCRIPT= -e 's/^cc /gcc -traditional /' 13 | .endif 14 | 15 | .if (${PORTNAME} == "sparc_solaris") 16 | SEDSCRIPT= -e 's/^cc /solcc /' 17 | .endif 18 | 19 | .if (${PORTNAME} == "aix") 20 | SEDSCRIPT= -e 's/^cc /cc -c /' -e 's/^.AIX//' 21 | .endif 22 | 23 | .include 24 | -------------------------------------------------------------------------------- /src/tools/mkdep/README: -------------------------------------------------------------------------------- 1 | need to handle different compilers. 2 | basically, steal BSD's three diffent ones: 3 | Ultrix 4 | No CC switch 5 | Everyone else 6 | -------------------------------------------------------------------------------- /src/tools/mkldexport/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Header$ 3 | # 4 | 5 | .include 6 | 7 | depend lint tags: 8 | 9 | SHPROG=mkldexport 10 | 11 | .include 12 | -------------------------------------------------------------------------------- /src/tools/mkldexport/mkldexport.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # mkldexport 4 | # create an AIX exports file from an object file 5 | # 6 | # Usage: 7 | # mkldexport objectfile [location] 8 | # where 9 | # objectfile is the current location of the object file. 10 | # location is the eventual (installed) location of the 11 | # object file (if different from the current 12 | # working directory). 13 | # 14 | # $Header$ 15 | # 16 | CMDNAME=`basename $0` 17 | if [ -z "$1" ]; then 18 | echo "Usage: $CMDNAME object [location]" 19 | exit 1 20 | fi 21 | OBJNAME=`basename $1` 22 | if [ "`basename $OBJNAME`" != "`basename $OBJNAME .o`" ]; then 23 | OBJNAME=`basename $OBJNAME .o`.so 24 | fi 25 | if [ -z "$2" ]; then 26 | echo '#!' 27 | else 28 | echo '#!' $2/$OBJNAME 29 | fi 30 | /usr/ucb/nm -g $1 | \ 31 | egrep ' [TD] ' | \ 32 | sed -e 's/.* //' | \ 33 | egrep -v '\$' | \ 34 | sed -e 's/^[.]//' | \ 35 | sort | \ 36 | uniq 37 | --------------------------------------------------------------------------------