From 3fa2bb316c92b2c332d18072799d585ab795f131 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 21 Nov 1997 18:12:58 +0000 Subject: [PATCH] Remove archive stuff. --- src/backend/commands/cluster.c | 8 +- src/backend/commands/creatinh.c | 114 +----------------------- src/backend/commands/recipe.c | 11 +-- src/backend/commands/sequence.c | 2 - src/backend/commands/vacuum.c | 136 +++-------------------------- src/backend/commands/view.c | 5 +- src/backend/executor/execMain.c | 15 +--- src/backend/executor/nodeTee.c | 8 +- src/backend/libpq/pqcomm.c | 3 +- src/backend/optimizer/plan/planner.c | 13 +-- src/backend/optimizer/prep/Makefile | 4 +- src/backend/optimizer/prep/prepunion.c | 31 ++----- src/backend/parser/gram.y | 120 +++++-------------------- src/backend/parser/keywords.c | 10 +-- src/backend/parser/parse_query.c | 6 +- src/backend/storage/buffer/bufmgr.c | 25 +++--- src/backend/storage/buffer/localbuf.c | 8 +- src/backend/storage/large_object/inv_api.c | 11 +-- src/backend/tcop/utility.c | 16 +--- src/backend/tcop/variable.c | 3 +- src/backend/utils/cache/relcache.c | 15 ++-- src/bin/pg_dump/pg_dump.c | 51 +---------- src/bin/pg_dump/pg_dump.h | 4 +- src/bin/psql/psqlHelp.h | 7 +- src/include/catalog/heap.h | 9 +- src/include/catalog/pg_attribute.h | 58 ++++++------ src/include/catalog/pg_class.h | 59 +++++-------- src/include/catalog/pg_index.h | 14 ++- src/include/commands/creatinh.h | 3 +- src/include/commands/purge.h | 21 ----- src/include/config.h.in | 1 - src/include/nodes/nodes.h | 3 +- src/include/nodes/parsenodes.h | 23 +---- src/include/optimizer/prep.h | 4 +- src/include/storage/buf_internals.h | 4 +- src/man/create_table.l | 52 +---------- src/man/purge.l | 61 ------------- src/man/vacuum.l | 10 +-- 38 files changed, 158 insertions(+), 790 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index 3bfdb96154..139a1b2ff6 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.16 1997/11/20 23:20:58 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.17 1997/11/21 18:09:46 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -215,11 +215,7 @@ copy_heap(Oid OIDOldHeap) tupdesc = CreateTupleDescCopy(OldHeapDesc); - OIDNewHeap = heap_create(NewName, - NULL, - OldHeap->rd_rel->relarch, - OldHeap->rd_rel->relsmgr, - tupdesc); + OIDNewHeap = heap_create(NewName, tupdesc); if (!OidIsValid(OIDNewHeap)) elog(WARN, "clusterheap: cannot create temporary heap relation\n"); diff --git a/src/backend/commands/creatinh.c b/src/backend/commands/creatinh.c index ef92b30071..07c6f9ad7d 100644 --- a/src/backend/commands/creatinh.c +++ b/src/backend/commands/creatinh.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.18 1997/10/25 01:08:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.19 1997/11/21 18:09:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -51,16 +51,9 @@ DefineRelation(CreateStmt *stmt) List *schema = stmt->tableElts; int numberOfAttributes; Oid relationId; - char archChar; List *inheritList = NULL; - char *archiveName = NULL; TupleDesc descriptor; List *constraints; - int heaploc, - archloc; - - char *typename = NULL;/* the typename of this relation. not - * useod for now */ if (strlen(stmt->relname) >= NAMEDATALEN) elog(WARN, "the relation name %s is >= %d characters long", stmt->relname, @@ -76,53 +69,6 @@ DefineRelation(CreateStmt *stmt) inheritList = stmt->inhRelnames; /* ---------------- - * determine archive mode - * XXX use symbolic constants... - * ---------------- - */ - archChar = 'n'; - - switch (stmt->archiveType) - { - case ARCH_NONE: - archChar = 'n'; - break; - case ARCH_LIGHT: - archChar = 'l'; - break; - case ARCH_HEAVY: - archChar = 'h'; - break; - default: - elog(WARN, "Botched archive mode %d, ignoring", - stmt->archiveType); - break; - } - - if (stmt->location == -1) - heaploc = 0; - else - heaploc = stmt->location; - - /* - * For now, any user-defined relation defaults to the magnetic disk - * storgage manager. --mao 2 july 91 - */ - if (stmt->archiveLoc == -1) - { - archloc = 0; - } - else - { - if (archChar == 'n') - { - elog(WARN, "Set archive location, but not mode, for %s", - relname); - } - archloc = stmt->archiveLoc; - } - - /* ---------------- * generate relation schema, including inherited attributes. * ---------------- */ @@ -191,42 +137,9 @@ DefineRelation(CreateStmt *stmt) } } - relationId = heap_create(relname, - typename, - archChar, - heaploc, - descriptor); + relationId = heap_create(relname, descriptor); StoreCatalogInheritance(relationId, inheritList); - - /* - * create an archive relation if necessary - */ - if (archChar != 'n') - { - TupleDesc tupdesc; - - /* - * Need to create an archive relation for this heap relation. We - * cobble up the command by hand, and increment the command - * counter ourselves. - */ - - CommandCounterIncrement(); - archiveName = MakeArchiveName(relationId); - - tupdesc = CreateTupleDescCopy(descriptor); /* get rid of - * constraints */ - (void) heap_create(archiveName, - typename, - 'n', /* archive isn't archived */ - archloc, - tupdesc); - - FreeTupleDesc(tupdesc); - FreeTupleDesc(descriptor); - pfree(archiveName); - } } /* @@ -664,26 +577,3 @@ checkAttrExists(char *attributeName, char *attributeType, List *schema) } return 0; } - -/* - * MakeArchiveName - * make an archive rel name out of a regular rel name - * -* the CALLER is responsible for freeing the memory allocated - */ - -char * -MakeArchiveName(Oid relationId) -{ - char *arch; - - /* - * Archive relations are named a,XXXXX where XXXXX == the OID of the - * relation they archive. Create a string containing this name and - * find the reldesc for the archive relation. - */ - arch = palloc(NAMEDATALEN); - sprintf(arch, "a,%d", relationId); - - return arch; -} diff --git a/src/backend/commands/recipe.c b/src/backend/commands/recipe.c index 43d84c5a01..9e5d2819e0 100644 --- a/src/backend/commands/recipe.c +++ b/src/backend/commands/recipe.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.11 1997/11/20 23:21:10 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.12 1997/11/21 18:09:51 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1047,11 +1047,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo) len = length(q->qtrees[0]->targetList); tupdesc = rel->rd_att; - relid = heap_create(child->nodeElem->outTypes->val[0], - NULL, /* XXX */ - 'n', - DEFAULT_SMGR, - tupdesc); + relid = heap_create(child->nodeElem->outTypes->val[0], tupdesc); } else { @@ -1076,9 +1072,6 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo) else { relid = heap_create(child->nodeElem->outTypes->val[0], - NULL, /* XXX */ - 'n', - DEFAULT_SMGR, tupdesc); } } diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 1f63b9e96e..25e5ef2c06 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -151,8 +151,6 @@ DefineSequence(CreateSeqStmt *seq) } stmt->relname = seq->seqname; - stmt->archiveLoc = -1; /* default */ - stmt->archiveType = ARCH_NONE; stmt->inhRelnames = NIL; stmt->constraints = NIL; diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 2ecc827b44..a38bcdcbf9 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.50 1997/11/20 23:21:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.51 1997/11/21 18:09:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -82,7 +82,7 @@ static void vc_vacone(Oid relid, bool analyze, List *va_cols); static void vc_scanheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl); static void vc_rpfheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl, int nindices, Relation *Irel); static void vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vpl); -static void vc_vacpage(Page page, VPageDescr vpd, Relation archrel); +static void vc_vacpage(Page page, VPageDescr vpd); static void vc_vaconeind(VPageList vpl, Relation indrel, int nhtups); static void vc_scanoneind(Relation indrel, int nhtups); static void vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup); @@ -96,9 +96,6 @@ static void vc_vpinsert(VPageList vpl, VPageDescr vpnew); static void vc_free(VRelList vrl); static void vc_getindices(Oid relid, int *nindices, Relation **Irel); static void vc_clsindices(int nindices, Relation *Irel); -static Relation vc_getarchrel(Relation heaprel); -static void vc_archive(Relation archrel, HeapTuple htup); -static bool vc_isarchrel(char *rname); static void vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc); static char *vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *)); static int vc_cmp_blk(char *left, char *right); @@ -271,7 +268,6 @@ vc_getrels(NameData *VacRelP) Datum d; char *rname; char rkind; - int16 smgrno; bool n; ScanKeyData pgckey; bool found = false; @@ -303,23 +299,9 @@ vc_getrels(NameData *VacRelP) found = true; - /* - * We have to be careful not to vacuum the archive (since it - * already contains vacuumed tuples), and not to vacuum relations - * on write-once storage managers like the Sony jukebox at - * Berkeley. - */ - d = heap_getattr(pgctup, buf, Anum_pg_class_relname, pgcdesc, &n); rname = (char *) d; - /* skip archive relations */ - if (vc_isarchrel(rname)) - { - ReleaseBuffer(buf); - continue; - } - /* * don't vacuum large objects for now - something breaks when we * do @@ -335,16 +317,6 @@ vc_getrels(NameData *VacRelP) continue; } - d = heap_getattr(pgctup, buf, Anum_pg_class_relsmgr, pgcdesc, &n); - smgrno = DatumGetInt16(d); - - /* skip write-once storage managers */ - if (smgriswo(smgrno)) - { - ReleaseBuffer(buf); - continue; - } - d = heap_getattr(pgctup, buf, Anum_pg_class_relkind, pgcdesc, &n); rkind = DatumGetChar(d); @@ -1005,7 +977,6 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel, ntups; bool isempty, dowrite; - Relation archrel; struct rusage ru0, ru1; @@ -1022,27 +993,6 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel, inulls = (char *) palloc(INDEX_MAX_KEYS * sizeof(*inulls)); } - /* if the relation has an archive, open it */ - if (onerel->rd_rel->relarch != 'n') - { - archrel = vc_getarchrel(onerel); - /* Archive tuples from "empty" end-pages */ - for (vpp = Vvpl->vpl_pgdesc + Vvpl->vpl_npages - 1, - i = Vvpl->vpl_nemend; i > 0; i--, vpp--) - { - if ((*vpp)->vpd_noff > 0) - { - buf = ReadBuffer(onerel, (*vpp)->vpd_blkno); - page = BufferGetPage(buf); - Assert(!PageIsEmpty(page)); - vc_vacpage(page, *vpp, archrel); - WriteBuffer(buf); - } - } - } - else - archrel = (Relation) NULL; - Nvpl.vpl_npages = 0; Fnpages = Fvpl->vpl_npages; Fvplast = Fvpl->vpl_pgdesc[Fnpages - 1]; @@ -1078,7 +1028,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel, if (Vvplast->vpd_noff > 0) /* there are dead tuples */ { /* on this page - clean */ Assert(!isempty); - vc_vacpage(page, Vvplast, archrel); + vc_vacpage(page, Vvplast); dowrite = true; } else @@ -1169,7 +1119,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel, ToPage = BufferGetPage(ToBuf); /* if this page was not used before - clean it */ if (!PageIsEmpty(ToPage) && ToVpd->vpd_nusd == 0) - vc_vacpage(ToPage, ToVpd, archrel); + vc_vacpage(ToPage, ToVpd); } /* copy tuple */ @@ -1292,7 +1242,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)", * re-used */ Assert((*vpp)->vpd_noff > 0); - vc_vacpage(page, *vpp, archrel); + vc_vacpage(page, *vpp); } else /* this page was used */ @@ -1392,14 +1342,11 @@ Elapsed %u/%u sec.", i = BlowawayRelationBuffers(onerel, blkno); if (i < 0) elog (FATAL, "VACUUM (vc_rpfheap): BlowawayRelationBuffers returned %d", i); - blkno = smgrtruncate(onerel->rd_rel->relsmgr, onerel, blkno); + blkno = smgrtruncate(DEFAULT_SMGR, onerel, blkno); Assert(blkno >= 0); vacrelstats->npages = blkno; /* set new number of blocks */ } - if (archrel != (Relation) NULL) - heap_close(archrel); - if (Irel != (Relation *) NULL) /* pfree index' allocations */ { pfree(Idesc); @@ -1424,19 +1371,11 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl) Buffer buf; Page page; VPageDescr *vpp; - Relation archrel; int nblocks; int i; nblocks = Vvpl->vpl_npages; - /* if the relation has an archive, open it */ - if (onerel->rd_rel->relarch != 'n') - archrel = vc_getarchrel(onerel); - else - { - archrel = (Relation) NULL; - nblocks -= Vvpl->vpl_nemend; /* nothing to do with them */ - } + nblocks -= Vvpl->vpl_nemend; /* nothing to do with them */ for (i = 0, vpp = Vvpl->vpl_pgdesc; i < nblocks; i++, vpp++) { @@ -1444,7 +1383,7 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl) { buf = ReadBuffer(onerel, (*vpp)->vpd_blkno); page = BufferGetPage(buf); - vc_vacpage(page, *vpp, archrel); + vc_vacpage(page, *vpp); WriteBuffer(buf); } } @@ -1468,22 +1407,19 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl) if (i < 0) elog (FATAL, "VACUUM (vc_vacheap): BlowawayRelationBuffers returned %d", i); - nblocks = smgrtruncate(onerel->rd_rel->relsmgr, onerel, nblocks); + nblocks = smgrtruncate(DEFAULT_SMGR, onerel, nblocks); Assert(nblocks >= 0); vacrelstats->npages = nblocks; /* set new number of blocks */ } - if (archrel != (Relation) NULL) - heap_close(archrel); - } /* vc_vacheap */ /* - * vc_vacpage() -- free (and archive if needed) dead tuples on a page + * vc_vacpage() -- free dead tuples on a page * and repaire its fragmentation. */ static void -vc_vacpage(Page page, VPageDescr vpd, Relation archrel) +vc_vacpage(Page page, VPageDescr vpd) { ItemId itemid; HeapTuple htup; @@ -1493,11 +1429,6 @@ vc_vacpage(Page page, VPageDescr vpd, Relation archrel) for (i = 0; i < vpd->vpd_noff; i++) { itemid = &(((PageHeader) page)->pd_linp[vpd->vpd_voff[i] - 1]); - if (archrel != (Relation) NULL && ItemIdIsUsed(itemid)) - { - htup = (HeapTuple) PageGetItem(page, itemid); - vc_archive(archrel, htup); - } itemid->lp_flags &= ~LP_USED; } PageRepairFragmentation(page); @@ -2128,51 +2059,6 @@ vc_free(VRelList vrl) MemoryContextSwitchTo(old); } -/* - * vc_getarchrel() -- open the archive relation for a heap relation - * - * The archive relation is named 'a,XXXXX' for the heap relation - * whose relid is XXXXX. - */ - -#define ARCHIVE_PREFIX "a," - -static Relation -vc_getarchrel(Relation heaprel) -{ - Relation archrel; - char *archrelname; - - archrelname = palloc(sizeof(ARCHIVE_PREFIX) + NAMEDATALEN); /* bogus */ - sprintf(archrelname, "%s%d", ARCHIVE_PREFIX, heaprel->rd_id); - - archrel = heap_openr(archrelname); - - pfree(archrelname); - return (archrel); -} - -/* - * vc_archive() -- write a tuple to an archive relation - * - * In the future, this will invoke the archived accessd method. For - * now, archive relations are on mag disk. - */ -static void -vc_archive(Relation archrel, HeapTuple htup) -{ - doinsert(archrel, htup); -} - -static bool -vc_isarchrel(char *rname) -{ - if (strncmp(ARCHIVE_PREFIX, rname, strlen(ARCHIVE_PREFIX)) == 0) - return (true); - - return (false); -} - static char * vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *)) { diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index 72d6159b2a..64b4de2ef4 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.14 1997/11/20 23:21:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.15 1997/11/21 18:09:58 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -100,9 +100,6 @@ DefineVirtualRelation(char *relname, List *tlist) createStmt.tableElts = attrList; /* createStmt.tableType = NULL;*/ createStmt.inhRelnames = NIL; - createStmt.archiveType = ARCH_NONE; - createStmt.location = -1; - createStmt.archiveLoc = -1; createStmt.constraints = NIL; /* diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 45ad2efba6..d99e5abf63 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,7 +26,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.31 1997/11/20 23:21:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.32 1997/11/21 18:10:06 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -546,7 +546,6 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate) if (operation == CMD_SELECT) { char *intoName; - char archiveMode; Oid intoRelationId; TupleDesc tupdesc; @@ -560,14 +559,9 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate) { /* ---------------- * create the "into" relation - * - * note: there is currently no way for the user to - * specify the desired archive mode of the - * "into" relation... * ---------------- */ intoName = parseTree->into; - archiveMode = 'n'; /* * have to copy tupType to get rid of constraints @@ -577,11 +571,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate) /* fixup to prevent zero-length columns in create */ setVarAttrLenForCreateTable(tupdesc, targetList, rangeTable); - intoRelationId = heap_create(intoName, - intoName, /* not used */ - archiveMode, - DEFAULT_SMGR, - tupdesc); + intoRelationId = heap_create(intoName, tupdesc); #ifdef NOT_USED /* it's copy ... */ resetVarAttrLenForCreateTable(tupdesc); #endif @@ -1334,7 +1324,6 @@ ExecRelCheck(Relation rel, HeapTuple tuple) rte->refname = rte->relname; rte->relid = rel->rd_id; rte->inh = false; - rte->archive = false; rte->inFromCl = true; rtlist = lcons(rte, NIL); econtext->ecxt_scantuple = slot; /* scan tuple slot */ diff --git a/src/backend/executor/nodeTee.c b/src/backend/executor/nodeTee.c index 149885e9dc..90dfc18951 100644 --- a/src/backend/executor/nodeTee.c +++ b/src/backend/executor/nodeTee.c @@ -15,7 +15,7 @@ * ExecEndTee * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.10 1997/11/20 23:21:35 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.11 1997/11/21 18:10:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -168,9 +168,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent) bufferRel = heap_openr(teeState->tee_bufferRelname); else bufferRel = heap_open(heap_create(teeState->tee_bufferRelname, - /* FIX */ NULL, - 'n', - DEFAULT_SMGR, tupType)); } else @@ -180,9 +177,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent) newoid()); /* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */ bufferRel = heap_open(heap_create(teeState->tee_bufferRelname, - NULL, /* XXX */ - 'n', - DEFAULT_SMGR, tupType)); } diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index ae4125c315..96a8aabefe 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.29 1997/11/19 18:28:59 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.30 1997/11/21 18:10:15 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -41,6 +41,7 @@ #include #include /* for ttyname() */ #include +#include #include #include #include diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 3fbc28cb88..e10e36bdcd 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.9 1997/09/08 21:45:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.10 1997/11/21 18:10:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -92,17 +92,6 @@ planner(Query *parse) INHERITS_FLAG); } - /* - * plan archive queries - */ - rt_index = first_matching_rt_entry(rangetable, ARCHIVE_FLAG); - if (rt_index != -1) - { - special_plans = (Plan *) plan_union_queries((Index) rt_index, - parse, - ARCHIVE_FLAG); - } - if (special_plans) result_plan = special_plans; else diff --git a/src/backend/optimizer/prep/Makefile b/src/backend/optimizer/prep/Makefile index eb8ef61a68..9c72133918 100644 --- a/src/backend/optimizer/prep/Makefile +++ b/src/backend/optimizer/prep/Makefile @@ -4,7 +4,7 @@ # Makefile for optimizer/prep # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.3 1996/11/09 06:18:23 momjian Exp $ +# $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.4 1997/11/21 18:10:39 momjian Exp $ # #------------------------------------------------------------------------- @@ -17,7 +17,7 @@ INCLUDE_OPT = -I../.. \ CFLAGS+=$(INCLUDE_OPT) -OBJS = archive.o prepqual.o preptlist.o prepunion.o +OBJS = prepqual.o preptlist.o prepunion.o # not ready yet: predmig.o xfunc.o diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 47036a22d7..a686f94e01 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -1,13 +1,13 @@ /*------------------------------------------------------------------------- * * prepunion.c-- - * Routines to plan archive, inheritance, union, and version queries + * Routines to plan inheritance, union, and version queries * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.7 1997/11/20 23:21:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.8 1997/11/21 18:10:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -118,10 +118,6 @@ first_matching_rt_entry(List *rangetable, UnionFlag flag) if (rt_entry->inh) return count + 1; break; - case ARCHIVE_FLAG: - if (rt_entry->archive) - return count + 1; - break; default: break; } @@ -192,9 +188,6 @@ plan_union_queries(Index rt_index, case INHERITS_FLAG: rt_fetch(rt_index, rangetable)->inh = false; break; - case ARCHIVE_FLAG: - rt_fetch(rt_index, rangetable)->archive = false; - break; default: break; } @@ -249,22 +242,10 @@ plan_union_query(List *relids, /* new_root->uniqueFlag = false; */ new_root->uniqueFlag = NULL; new_root->sortClause = NULL; - if (flag == ARCHIVE_FLAG) - { - - /* - * the entire union query uses the same (most recent) schema. - * to do otherwise would require either ragged tuples or - * careful archiving and interpretation of pg_attribute... - */ - } - else - { - fix_parsetree_attnums(rt_index, - rt_entry->relid, - relid, - new_root); - } + fix_parsetree_attnums(rt_index, + rt_entry->relid, + relid, + new_root); union_plans = lappend(union_plans, planner(new_root)); union_rtentries = lappend(union_rtentries, new_rt_entry); diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 915fca62c4..fda9b07dbe 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.69 1997/11/20 23:22:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.70 1997/11/21 18:10:49 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -41,7 +41,6 @@ #include "parser/gramparse.h" #include "parser/catalog_utils.h" #include "parser/parse_query.h" -#include "storage/smgr.h" #include "utils/acl.h" #include "catalog/catname.h" #include "utils/elog.h" @@ -101,7 +100,6 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr); VersionStmt *vstmt; DefineStmt *dstmt; - PurgeStmt *pstmt; RuleStmt *rstmt; AppendStmt *astmt; } @@ -112,8 +110,8 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr); ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt, CreatePLangStmt, DropPLangStmt, IndexStmt, ListenStmt, OptimizableStmt, - ProcedureStmt, PurgeStmt, - RecipeStmt, RemoveAggrStmt, RemoveOperStmt, RemoveFuncStmt, RemoveStmt, + ProcedureStmt, RecipeStmt, RemoveAggrStmt, RemoveOperStmt, + RemoveFuncStmt, RemoveStmt, RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt, CreatedbStmt, DestroydbStmt, VacuumStmt, RetrieveStmt, CursorStmt, ReplaceStmt, AppendStmt, NotifyStmt, DeleteStmt, ClusterStmt, @@ -132,7 +130,7 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr); class, index_name, name, file_name, recipe_name, aggr_argtype %type opt_id, opt_portal_name, - before_clause, after_clause, all_Op, MathOp, opt_name, opt_unique, + all_Op, MathOp, opt_name, opt_unique, result, OptUseOp, opt_class, SpecialRuleRelation %type privileges, operation_commalist, grantee @@ -163,16 +161,15 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr); %type opt_inh_star, opt_binary, opt_instead, opt_with_copy, index_opt_unique, opt_verbose, opt_analyze -%type copy_dirn, archive_type, OptArchiveType, OptArchiveLocation, - def_type, opt_direction, remove_type, opt_column, event +%type copy_dirn, def_type, opt_direction, remove_type, + opt_column, event -%type OptLocation, fetch_how_many +%type fetch_how_many %type OptSeqList %type OptSeqElem %type def_rest -%type purge_quals %type insert_rest %type columnDef, alter_clause @@ -257,15 +254,14 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr); /* Keywords for Postgres support (not in SQL92 reserved words) */ %token ABORT_TRANS, ACL, AFTER, AGGREGATE, ANALYZE, - APPEND, ARCHIVE, ARCH_STORE, - BACKWARD, BEFORE, BINARY, CHANGE, CLUSTER, COPY, + APPEND, BACKWARD, BEFORE, BINARY, CHANGE, CLUSTER, COPY, DATABASE, DELIMITERS, DO, EXPLAIN, EXTEND, - FORWARD, FUNCTION, HANDLER, HEAVY, + FORWARD, FUNCTION, HANDLER, INDEX, INHERITS, INSTEAD, ISNULL, - LANCOMPILER, LIGHT, LISTEN, LOAD, LOCATION, MERGE, MOVE, - NEW, NONE, NOTHING, OIDS, OPERATOR, PROCEDURAL, PURGE, + LANCOMPILER, LISTEN, LOAD, LOCATION, MERGE, MOVE, + NEW, NONE, NOTHING, OIDS, OPERATOR, PROCEDURAL, RECIPE, RENAME, REPLACE, RESET, RETRIEVE, RETURNS, RULE, - SEQUENCE, SETOF, SHOW, STDIN, STDOUT, STORE, TRUSTED, + SEQUENCE, SETOF, SHOW, STDIN, STDOUT, TRUSTED, VACUUM, VERBOSE, VERSION /* Special keywords, not in the query language - see the "lex" file */ @@ -336,7 +332,6 @@ stmt : AddAttrStmt | IndexStmt | ListenStmt | ProcedureStmt - | PurgeStmt | RecipeStmt | RemoveAggrStmt | RemoveOperStmt @@ -664,17 +659,13 @@ copy_delimiter: USING DELIMITERS Sconst { $$ = $3;} *****************************************************************************/ CreateStmt: CREATE TABLE relation_name '(' OptTableElementList ')' - OptInherit OptConstraint OptArchiveType OptLocation - OptArchiveLocation + OptInherit OptConstraint OptArchiveType { CreateStmt *n = makeNode(CreateStmt); n->relname = $3; n->tableElts = $5; n->inhRelnames = $7; n->constraints = $8; - n->archiveType = $9; - n->location = $10; - n->archiveLoc = $11; $$ = (Node *)n; } ; @@ -690,26 +681,12 @@ tableElementList : { $$ = lcons($1, NIL); } ; - -OptArchiveType: ARCHIVE '=' archive_type { $$ = $3; } - | /*EMPTY*/ { $$ = ARCH_NONE; } - ; - -archive_type: HEAVY { $$ = ARCH_HEAVY; } - | LIGHT { $$ = ARCH_LIGHT; } - | NONE { $$ = ARCH_NONE; } - ; - -OptLocation: STORE '=' Sconst - { $$ = smgrin($3); } - | /*EMPTY*/ - { $$ = -1; } - ; - -OptArchiveLocation: ARCH_STORE '=' Sconst - { $$ = smgrin($3); } - | /*EMPTY*/ - { $$ = -1; } +/* + * This was removed in 6.3, but we keep it so people can upgrade + * with old pg_dump scripts. + */ +OptArchiveType: ARCHIVE '=' NONE { } + | /*EMPTY*/ { } ; OptInherit: INHERITS '(' relation_name_list ')' { $$ = $3; } @@ -1254,7 +1231,7 @@ RevokeStmt: REVOKE privileges ON relation_name_list FROM grantee /***************************************************************************** * * QUERY: - * define [archive] index on + * create index on * using "(" ( with )+ ")" [with * ] * @@ -1407,59 +1384,6 @@ def_args: '(' def_name_list ')' { $$ = $2; } def_name_list: name_list; - -/***************************************************************************** - * - * QUERY: - * purge [before ] [after ] - * or - * purge [after ] [before ] - * - *****************************************************************************/ - -PurgeStmt: PURGE relation_name purge_quals - { - $3->relname = $2; - $$ = (Node *)$3; - } - ; - -purge_quals: before_clause - { - $$ = makeNode(PurgeStmt); - $$->beforeDate = $1; - $$->afterDate = NULL; - } - | after_clause - { - $$ = makeNode(PurgeStmt); - $$->beforeDate = NULL; - $$->afterDate = $1; - } - | before_clause after_clause - { - $$ = makeNode(PurgeStmt); - $$->beforeDate = $1; - $$->afterDate = $2; - } - | after_clause before_clause - { - $$ = makeNode(PurgeStmt); - $$->beforeDate = $2; - $$->afterDate = $1; - } - | /*EMPTY*/ - { - $$ = makeNode(PurgeStmt); - $$->beforeDate = NULL; - $$->afterDate = NULL; - } - ; - -before_clause: BEFORE date { $$ = $2; } -after_clause: AFTER date { $$ = $2; } - - /***************************************************************************** * * QUERY: @@ -2122,7 +2046,7 @@ SubSelect: SELECT opt_unique res_target_list2 ; result: INTO TABLE relation_name - { $$= $3; /* should check for archive level */ } + { $$= $3; } | /*EMPTY*/ { $$ = NULL; } ; @@ -3446,7 +3370,6 @@ ColId: Id { $$ = $1; } | INDEX { $$ = "index"; } | KEY { $$ = "key"; } | LANGUAGE { $$ = "language"; } - | LIGHT { $$ = "light"; } | LOCATION { $$ = "location"; } | MATCH { $$ = "match"; } | OPERATOR { $$ = "operator"; } @@ -3481,7 +3404,6 @@ ColLabel: ColId { $$ = $1; } | ORDER { $$ = "order"; } | POSITION { $$ = "position"; } | PRECISION { $$ = "precision"; } - | STORE { $$ = "store"; } | TABLE { $$ = "table"; } | TRANSACTION { $$ = "transaction"; } | TRUE_P { $$ = "true"; } diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c index a5d7564804..5b6274cf6f 100644 --- a/src/backend/parser/keywords.c +++ b/src/backend/parser/keywords.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.22 1997/11/07 07:02:10 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.23 1997/11/21 18:10:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -42,9 +42,7 @@ static ScanKeyword ScanKeywords[] = { {"analyze", ANALYZE}, {"and", AND}, {"append", APPEND}, - {"archIve", ARCHIVE}, /* XXX crooked: I < _ */ - {"arch_store", ARCH_STORE}, - {"archive", ARCHIVE}, /* XXX crooked: i > _ */ + {"archive", ARCHIVE}, {"as", AS}, {"asc", ASC}, {"backward", BACKWARD}, @@ -106,7 +104,6 @@ static ScanKeyword ScanKeywords[] = { {"group", GROUP}, {"handler", HANDLER}, {"having", HAVING}, - {"heavy", HEAVY}, {"hour", HOUR_P}, {"in", IN}, {"index", INDEX}, @@ -124,7 +121,6 @@ static ScanKeyword ScanKeywords[] = { {"language", LANGUAGE}, {"leading", LEADING}, {"left", LEFT}, - {"light", LIGHT}, {"like", LIKE}, {"listen", LISTEN}, {"load", LOAD}, @@ -162,7 +158,6 @@ static ScanKeyword ScanKeywords[] = { {"procedural", PROCEDURAL}, {"procedure", PROCEDURE}, {"public", PUBLIC}, - {"purge", PURGE}, {"recipe", RECIPE}, {"references", REFERENCES}, {"rename", RENAME}, @@ -182,7 +177,6 @@ static ScanKeyword ScanKeywords[] = { {"show", SHOW}, {"stdin", STDIN}, {"stdout", STDOUT}, - {"store", STORE}, {"substring", SUBSTRING}, {"table", TABLE}, {"time", TIME}, diff --git a/src/backend/parser/parse_query.c b/src/backend/parser/parse_query.c index f23e0cff74..1230ecf7e2 100644 --- a/src/backend/parser/parse_query.c +++ b/src/backend/parser/parse_query.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.23 1997/11/20 23:22:22 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.24 1997/11/21 18:10:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -148,7 +148,7 @@ addRangeTableEntry(ParseState *pstate, } /* - * Flags - zero or more from archive,inheritance,union,version or + * Flags - zero or more from inheritance,union,version or * recursive (transitive closure) [we don't support them all -- ay * 9/94 ] */ @@ -157,8 +157,6 @@ addRangeTableEntry(ParseState *pstate, /* RelOID */ rte->relid = RelationGetRelationId(relation); - rte->archive = false; - rte->inFromCl = inFromCl; /* diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index f6fc503d4b..e81a8d1dff 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.28 1997/10/22 19:04:43 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.29 1997/11/21 18:11:04 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -275,7 +275,7 @@ ReadBufferWithBufferLock(Relation reln, { /* new buffers are zero-filled */ MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ); - smgrextend(bufHdr->bufsmgr, reln, + smgrextend(DEFAULT_SMGR, reln, (char *) MAKE_PTR(bufHdr->data)); } return (BufferDescriptorGetBuffer(bufHdr)); @@ -290,12 +290,12 @@ ReadBufferWithBufferLock(Relation reln, { /* new buffers are zero-filled */ MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ); - status = smgrextend(bufHdr->bufsmgr, reln, + status = smgrextend(DEFAULT_SMGR, reln, (char *) MAKE_PTR(bufHdr->data)); } else { - status = smgrread(bufHdr->bufsmgr, reln, blockNum, + status = smgrread(DEFAULT_SMGR, reln, blockNum, (char *) MAKE_PTR(bufHdr->data)); } @@ -372,7 +372,7 @@ BufferAlloc(Relation reln, if (blockNum == P_NEW) { newblock = TRUE; - blockNum = smgrnblocks(reln->rd_rel->relsmgr, reln); + blockNum = smgrnblocks(DEFAULT_SMGR, reln); } INIT_BUFFERTAG(&newTag, reln, blockNum); @@ -645,9 +645,6 @@ BufferAlloc(Relation reln, strcpy(buf->sb_relname, reln->rd_rel->relname.data); strcpy(buf->sb_dbname, GetDatabaseName()); - /* remember which storage manager is responsible for it */ - buf->bufsmgr = reln->rd_rel->relsmgr; - INIT_BUFFERTAG(&(buf->tag), reln, blockNum); if (!BufTableInsert(buf)) { @@ -830,7 +827,7 @@ FlushBuffer(Buffer buffer, bool release) bufHdr->flags &= ~BM_JUST_DIRTIED; SpinRelease(BufMgrLock); - status = smgrflush(bufHdr->bufsmgr, bufrel, bufHdr->tag.blockNum, + status = smgrflush(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); RelationDecrementReferenceCount(bufrel); @@ -1038,14 +1035,14 @@ BufferSync() #endif /* OPTIMIZE_SINGLE */ if (reln == (Relation) NULL) { - status = smgrblindwrt(bufHdr->bufsmgr, bufHdr->sb_dbname, + status = smgrblindwrt(DEFAULT_SMGR, bufHdr->sb_dbname, bufHdr->sb_relname, bufdb, bufrel, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); } else { - status = smgrwrite(bufHdr->bufsmgr, reln, + status = smgrwrite(DEFAULT_SMGR, reln, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); } @@ -1375,14 +1372,14 @@ BufferReplace(BufferDesc *bufHdr, bool bufferLockHeld) if (reln != (Relation) NULL) { - status = smgrflush(bufHdr->bufsmgr, reln, bufHdr->tag.blockNum, + status = smgrflush(DEFAULT_SMGR, reln, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); } else { /* blind write always flushes */ - status = smgrblindwrt(bufHdr->bufsmgr, bufHdr->sb_dbname, + status = smgrblindwrt(DEFAULT_SMGR, bufHdr->sb_dbname, bufHdr->sb_relname, bufdb, bufrel, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); @@ -1413,7 +1410,7 @@ RelationGetNumberOfBlocks(Relation relation) { return ((relation->rd_islocal) ? relation->rd_nblocks : - smgrnblocks(relation->rd_rel->relsmgr, relation)); + smgrnblocks(DEFAULT_SMGR, relation)); } /* diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 9b335ae584..b7a8bba37a 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.13 1997/10/12 07:12:03 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.14 1997/11/21 18:11:07 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -124,7 +124,7 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr) Assert(bufrel != NULL); /* flush this page */ - smgrwrite(bufrel->rd_rel->relsmgr, bufrel, bufHdr->tag.blockNum, + smgrwrite(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); LocalBufferFlushCount++; RelationDecrementReferenceCount(bufrel); @@ -202,7 +202,7 @@ FlushLocalBuffer(Buffer buffer, bool release) bufrel = RelationIdCacheGetRelation(bufHdr->tag.relId.relId); Assert(bufrel != NULL); - smgrflush(bufrel->rd_rel->relsmgr, bufrel, bufHdr->tag.blockNum, + smgrflush(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum, (char *) MAKE_PTR(bufHdr->data)); LocalBufferFlushCount++; RelationDecrementReferenceCount(bufrel); @@ -276,7 +276,7 @@ LocalBufferSync(void) Assert(bufrel != NULL); - smgrwrite(bufrel->rd_rel->relsmgr, bufrel, buf->tag.blockNum, + smgrwrite(DEFAULT_SMGR, bufrel, buf->tag.blockNum, (char *) MAKE_PTR(buf->data)); LocalBufferFlushCount++; RelationDecrementReferenceCount(bufrel); diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c index 7c3c7c5e3f..6483843e71 100644 --- a/src/backend/storage/large_object/inv_api.c +++ b/src/backend/storage/large_object/inv_api.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.20 1997/11/20 23:22:46 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.21 1997/11/21 18:11:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -148,10 +148,7 @@ inv_create(int flags) * be located on whatever storage manager the user requested. */ - heap_create(objname, - objname, - (int) archchar, smgr, - tupdesc); + heap_create(objname, tupdesc); /* make the relation visible in this transaction */ CommandCounterIncrement(); @@ -160,7 +157,7 @@ inv_create(int flags) if (!RelationIsValid(r)) { elog(WARN, "cannot create large object on %s under inversion", - smgrout(smgr)); + smgrout(DEFAULT_SMGR)); } /* @@ -185,7 +182,7 @@ inv_create(int flags) if (!RelationIsValid(indr)) { elog(WARN, "cannot create index for large obj on %s under inversion", - smgrout(smgr)); + smgrout(DEFAULT_SMGR)); } retval = (LargeObjectDesc *) palloc(sizeof(LargeObjectDesc)); diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 9ffcf151d5..ffb17b39b1 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.28 1997/11/07 06:38:51 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.29 1997/11/21 18:11:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -27,7 +27,6 @@ #include "commands/creatinh.h" #include "commands/sequence.h" #include "commands/defrem.h" -#include "commands/purge.h" #include "commands/rename.h" #include "commands/view.h" #include "commands/version.h" @@ -210,19 +209,6 @@ ProcessUtility(Node * parsetree, } break; - case T_PurgeStmt: - { - PurgeStmt *stmt = (PurgeStmt *) parsetree; - - commandTag = "PURGE"; - CHECK_IF_ABORTED(); - - RelationPurge(stmt->relname, - stmt->beforeDate, /* absolute time string */ - stmt->afterDate); /* relative time string */ - } - break; - case T_CopyStmt: { CopyStmt *stmt = (CopyStmt *) parsetree; diff --git a/src/backend/tcop/variable.c b/src/backend/tcop/variable.c index dfae3f7657..4872cfcd65 100644 --- a/src/backend/tcop/variable.c +++ b/src/backend/tcop/variable.c @@ -2,13 +2,14 @@ * Routines for handling of 'SET var TO', * 'SHOW var' and 'RESET var' statements. * - * $Id: variable.c,v 1.22 1997/11/14 15:34:09 thomas Exp $ + * $Id: variable.c,v 1.23 1997/11/21 18:11:20 momjian Exp $ * */ #include #include #include +#include #include "postgres.h" #include "miscadmin.h" #include "tcop/variable.h" diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 98a2a8484a..90c560bbcd 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.29 1997/11/20 23:23:11 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.30 1997/11/21 18:11:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -952,7 +952,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo) * by the storage manager code to rd_fd. * ---------------- */ - fd = smgropen(relp->relsmgr, relation); + fd = smgropen(DEFAULT_SMGR, relation); Assert(fd >= -1); if (fd == -1) @@ -1091,7 +1091,6 @@ formrdesc(char *relationName, relation->rd_rel->relpages = 1; /* XXX */ relation->rd_rel->reltuples = 1; /* XXX */ relation->rd_rel->relkind = RELKIND_RELATION; - relation->rd_rel->relarch = 'n'; relation->rd_rel->relnatts = (uint16) natts; relation->rd_isnailed = true; @@ -1157,7 +1156,7 @@ RelationIdCacheGetRelation(Oid relationId) { if (rd->rd_fd == -1) { - rd->rd_fd = smgropen(rd->rd_rel->relsmgr, rd); + rd->rd_fd = smgropen(DEFAULT_SMGR, rd); Assert(rd->rd_fd != -1); } @@ -1190,7 +1189,7 @@ RelationNameCacheGetRelation(char *relationName) { if (rd->rd_fd == -1) { - rd->rd_fd = smgropen(rd->rd_rel->relsmgr, rd); + rd->rd_fd = smgropen(DEFAULT_SMGR, rd); Assert(rd->rd_fd != -1); } @@ -1594,13 +1593,13 @@ RelationPurgeLocalRelation(bool xactCommitted) { if (!(reln->rd_tmpunlinked)) { - smgrunlink(reln->rd_rel->relsmgr, reln); + smgrunlink(DEFAULT_SMGR, reln); reln->rd_tmpunlinked = TRUE; } } else { - smgrunlink(reln->rd_rel->relsmgr, reln); + smgrunlink(DEFAULT_SMGR, reln); } } else if (!IsBootstrapProcessingMode() && !(reln->rd_istemp)) @@ -1613,7 +1612,7 @@ RelationPurgeLocalRelation(bool xactCommitted) * heap_destroyr and we skip smgrclose for them. - * vadim 05/22/97 */ - smgrclose(reln->rd_rel->relsmgr, reln); + smgrclose(DEFAULT_SMGR, reln); reln->rd_islocal = FALSE; diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index f6f6813522..8a40d82fe1 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -21,7 +21,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.52 1997/10/30 16:47:59 thomas Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.53 1997/11/21 18:11:37 momjian Exp $ * * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * @@ -444,10 +444,6 @@ dumpClasses(const TableInfo tblinfo[], const int numTables, FILE *fout, fprintf(stderr, "%s dumping out the contents of Table %s %s\n", g_comment_start, classname, g_comment_end); - /* skip archive names */ - if (isArchiveName(classname)) - continue; - if (!dumpData) dumpClasses_nodumpData(fout, classname, oids); else @@ -907,20 +903,11 @@ clearTableInfo(TableInfo *tblinfo, int numTables) if (tblinfo[i].oid) free(tblinfo[i].oid); - if (tblinfo[i].relarch) - free(tblinfo[i].relarch); if (tblinfo[i].relacl) free(tblinfo[i].relacl); if (tblinfo[i].usename) free(tblinfo[i].usename); - /* skip archive tables */ - if (isArchiveName(tblinfo[i].relname)) - { - if (tblinfo[i].relname) - free(tblinfo[i].relname); - continue; - } if (tblinfo[i].relname) free(tblinfo[i].relname); @@ -1288,7 +1275,6 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) int i_oid; int i_relname; - int i_relarch; int i_relkind; int i_relacl; int i_usename; @@ -1313,7 +1299,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) PQclear(res); sprintf(query, - "SELECT pg_class.oid, relname, relarch, relkind, relacl, usename, " + "SELECT pg_class.oid, relname, relkind, relacl, usename, " "relchecks, reltriggers " "from pg_class, pg_user " "where relowner = usesysid and " @@ -1336,7 +1322,6 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) i_oid = PQfnumber(res, "oid"); i_relname = PQfnumber(res, "relname"); - i_relarch = PQfnumber(res, "relarch"); i_relkind = PQfnumber(res, "relkind"); i_relacl = PQfnumber(res, "relacl"); i_usename = PQfnumber(res, "usename"); @@ -1347,7 +1332,6 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) { tblinfo[i].oid = strdup(PQgetvalue(res, i, i_oid)); tblinfo[i].relname = strdup(PQgetvalue(res, i, i_relname)); - tblinfo[i].relarch = strdup(PQgetvalue(res, i, i_relarch)); tblinfo[i].relacl = strdup(PQgetvalue(res, i, i_relacl)); tblinfo[i].sequence = (strcmp(PQgetvalue(res, i, i_relkind), "S") == 0); tblinfo[i].usename = strdup(PQgetvalue(res, i, i_usename)); @@ -1636,10 +1620,6 @@ getTableAttrs(TableInfo *tblinfo, int numTables) for (i = 0; i < numTables; i++) { - /* skip archive tables */ - if (isArchiveName(tblinfo[i].relname)) - continue; - if (tblinfo[i].sequence) continue; @@ -2178,7 +2158,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables, char **parentRels; /* list of names of parent relations */ int numParents; int actual_atts; /* number of attrs in this CREATE statment */ - const char *archiveMode; /* First - dump SEQUENCEs */ for (i = 0; i < numTables; i++) @@ -2204,10 +2183,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables, if (isViewRule(tblinfo[i].relname)) continue; - /* skip archive names */ - if (isArchiveName(tblinfo[i].relname)) - continue; - parentRels = tblinfo[i].parentRels; numParents = tblinfo[i].numParents; @@ -2292,28 +2267,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables, } } - switch (tblinfo[i].relarch[0]) - { - case 'n': - archiveMode = "none"; - break; - case 'h': - archiveMode = "heavy"; - break; - case 'l': - archiveMode = "light"; - break; - default: - fprintf(stderr, "unknown archive mode\n"); - archiveMode = "none"; - break; - } - - sprintf(q, "%s archive = %s;\n", - q, - archiveMode); - fputs(q, fout); - if (acls) fprintf(fout, "UPDATE pg_class SET relacl='%s' where relname='%s';\n", diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 995f195c46..7d42eb0388 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_dump.h,v 1.26 1997/10/30 16:48:03 thomas Exp $ + * $Id: pg_dump.h,v 1.27 1997/11/21 18:11:41 momjian Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -66,7 +66,6 @@ typedef struct _tableInfo { char *oid; char *relname; - char *relarch; char *relacl; bool sequence; int numatts; /* number of attributes */ @@ -191,7 +190,6 @@ extern int findTableByName(TableInfo *tbinfo, int numTables, const char *relname extern void check_conn_and_db(void); extern void parseArgTypes(char **argtypes, const char *str); -extern int isArchiveName(const char *); /* * version specific routines diff --git a/src/bin/psql/psqlHelp.h b/src/bin/psql/psqlHelp.h index 952757bb07..a91272e929 100644 --- a/src/bin/psql/psqlHelp.h +++ b/src/bin/psql/psqlHelp.h @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: psqlHelp.h,v 1.32 1997/11/07 06:27:55 thomas Exp $ + * $Id: psqlHelp.h,v 1.33 1997/11/21 18:11:46 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -77,7 +77,7 @@ static struct _helpStruct QL_HELP[] = { "create sequence \n\t[increment ]\n\t[start ]\n\t[minvalue ]\n\t[maxvalue ]\n\t[cache ]\n\t[cycle];"}, {"create table", "create a new table", - "create table \n\t( [default ] [not null] [,...])\n\t[inherits (,...)\n\t[[constraint ] check [,...] ]\n\tarchive=\n\tstore=\n\tarch_store=];"}, + "create table \n\t( [default ] [not null] [,...])\n\t[inherits (,...)\n\t[[constraint ] check [,...] ]\n;"}, {"create trigger", "create a new trigger", "create trigger after|before event1 [or event2 [or event3] ]\n\ton for each row|statement\n\texecute procedure ([arguments]);\n\n\teventX is one of INSERT, DELETE, UPDATE"}, @@ -159,9 +159,6 @@ static struct _helpStruct QL_HELP[] = { {"notify", "signal all frontends and backends listening on a relation", "notify "}, - {"purge", - "purge historical data", - "purge [before ] [after ];"}, {"reset", "set run-time environment back to default", "reset {DateStyle | GEQO | R_PLANS}"}, diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h index d96a75a0e6..ac13ab6d75 100644 --- a/src/include/catalog/heap.h +++ b/src/include/catalog/heap.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: heap.h,v 1.7 1997/09/08 21:51:15 momjian Exp $ + * $Id: heap.h,v 1.8 1997/11/21 18:11:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,13 +15,10 @@ #include -extern Relation heap_creatr(char *relname, unsigned smgr, TupleDesc att); +extern Relation heap_creatr(char *relname, TupleDesc att); extern Oid -heap_create(char relname[], - char *typename, - int arch, - unsigned smgr, TupleDesc tupdesc); +heap_create(char relname[], TupleDesc tupdesc); extern void heap_destroy(char relname[]); extern void heap_destroyr(Relation r); diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index b5249adbd3..cb69640964 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_attribute.h,v 1.19 1997/11/16 04:36:32 momjian Exp $ + * $Id: pg_attribute.h,v 1.20 1997/11/21 18:12:01 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -348,41 +348,33 @@ DATA(insert OID = 0 ( 1249 cmax 29 0 4 -6 0 -1 t f i f f)); #define Schema_pg_class \ { 1259l, {"relname"}, 19l, 0l, NAMEDATALEN, 1, 0l, -1l, '\0', '\0', 'i', '\0', '\0' }, \ { 1259l, {"reltype"}, 26l, 0l, 4, 2, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"relowner"}, 26l, 0l, 4, 2, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"relam"}, 26l, 0l, 4, 3, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"relpages"}, 23, 0l, 4, 4, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"reltuples"}, 23, 0l, 4, 5, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"relexpires"}, 702, 0l, 4, 6, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"relpreserved"}, 703, 0l, 4, 7, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ -{ 1259l, {"relhasindex"}, 16, 0l, 1, 8, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ -{ 1259l, {"relisshared"}, 16, 0l, 1, 9, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ -{ 1259l, {"relkind"}, 18, 0l, 1, 10, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ -{ 1259l, {"relarch"}, 18, 0l, 1, 11, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ -{ 1259l, {"relnatts"}, 21, 0l, 2, 12, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ -{ 1259l, {"relsmgr"}, 210l, 0l, 2, 13, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ -{ 1259l, {"relchecks"}, 21l, 0l, 2, 14, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ -{ 1259l, {"reltriggers"}, 21l, 0l, 2, 15, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ -{ 1259l, {"relhasrules"}, 16, 0l, 1, 16, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ -{ 1259l, {"relacl"}, 1034l, 0l, -1, 17, 0l, -1l, '\0', '\0', 'i', '\0', '\0' } +{ 1259l, {"relowner"}, 26l, 0l, 4, 3, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ +{ 1259l, {"relam"}, 26l, 0l, 4, 4, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ +{ 1259l, {"relpages"}, 23, 0l, 4, 5, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ +{ 1259l, {"reltuples"}, 23, 0l, 4, 6, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \ +{ 1259l, {"relhasindex"}, 16, 0l, 1, 7, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ +{ 1259l, {"relisshared"}, 16, 0l, 1, 8, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ +{ 1259l, {"relkind"}, 18, 0l, 1, 9, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ +{ 1259l, {"relnatts"}, 21, 0l, 2, 10, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ +{ 1259l, {"relchecks"}, 21l, 0l, 2, 11, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ +{ 1259l, {"reltriggers"}, 21l, 0l, 2, 12, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \ +{ 1259l, {"relhasrules"}, 16, 0l, 1, 13, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \ +{ 1259l, {"relacl"}, 1034l, 0l, -1, 14, 0l, -1l, '\0', '\0', 'i', '\0', '\0' } DATA(insert OID = 0 ( 1259 relname 19 0 NAMEDATALEN 1 0 -1 f f i f f)); DATA(insert OID = 0 ( 1259 reltype 26 0 4 2 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 relowner 26 0 4 2 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 relam 26 0 4 3 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 relpages 23 0 4 4 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 reltuples 23 0 4 5 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 relexpires 702 0 4 6 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 relpreserved 702 0 4 7 0 -1 t f i f f)); -DATA(insert OID = 0 ( 1259 relhasindex 16 0 1 8 0 -1 t f c f f)); -DATA(insert OID = 0 ( 1259 relisshared 16 0 1 9 0 -1 t f c f f)); -DATA(insert OID = 0 ( 1259 relkind 18 0 1 10 0 -1 t f c f f)); -DATA(insert OID = 0 ( 1259 relarch 18 0 1 11 0 -1 t f c f f)); -DATA(insert OID = 0 ( 1259 relnatts 21 0 2 12 0 -1 t f s f f)); -DATA(insert OID = 0 ( 1259 relsmgr 210 0 2 13 0 -1 t f s f f)); -DATA(insert OID = 0 ( 1259 relchecks 21 0 2 14 0 -1 t f s f f)); -DATA(insert OID = 0 ( 1259 reltriggers 21 0 2 15 0 -1 t f s f f)); -DATA(insert OID = 0 ( 1259 relhasrules 16 0 1 16 0 -1 t f c f f)); -DATA(insert OID = 0 ( 1259 relacl 1034 0 -1 17 0 -1 f f i f f)); +DATA(insert OID = 0 ( 1259 relowner 26 0 4 3 0 -1 t f i f f)); +DATA(insert OID = 0 ( 1259 relam 26 0 4 4 0 -1 t f i f f)); +DATA(insert OID = 0 ( 1259 relpages 23 0 4 5 0 -1 t f i f f)); +DATA(insert OID = 0 ( 1259 reltuples 23 0 4 6 0 -1 t f i f f)); +DATA(insert OID = 0 ( 1259 relhasindex 16 0 1 7 0 -1 t f c f f)); +DATA(insert OID = 0 ( 1259 relisshared 16 0 1 8 0 -1 t f c f f)); +DATA(insert OID = 0 ( 1259 relkind 18 0 1 9 0 -1 t f c f f)); +DATA(insert OID = 0 ( 1259 relnatts 21 0 2 10 0 -1 t f s f f)); +DATA(insert OID = 0 ( 1259 relchecks 21 0 2 11 0 -1 t f s f f)); +DATA(insert OID = 0 ( 1259 reltriggers 21 0 2 12 0 -1 t f s f f)); +DATA(insert OID = 0 ( 1259 relhasrules 16 0 1 13 0 -1 t f c f f)); +DATA(insert OID = 0 ( 1259 relacl 1034 0 -1 14 0 -1 f f i f f)); DATA(insert OID = 0 ( 1259 ctid 27 0 6 -1 0 -1 f f i f f)); DATA(insert OID = 0 ( 1259 oid 26 0 4 -2 0 -1 t f i f f)); DATA(insert OID = 0 ( 1259 xmin 28 0 4 -3 0 -1 f f i f f)); diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index bcc8b86d4d..1240e8ac4f 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_class.h,v 1.15 1997/11/16 04:36:38 momjian Exp $ + * $Id: pg_class.h,v 1.16 1997/11/21 18:12:07 momjian Exp $ * * NOTES * ``pg_relation'' is being replaced by ``pg_class''. currently @@ -58,15 +58,9 @@ CATALOG(pg_class) BOOTSTRAP Oid relam; int4 relpages; int4 reltuples; - int4 relexpires; /* really used as a abstime, but fudge it - * for now */ - int4 relpreserved; /* really used as a reltime, but fudge it - * for now */ bool relhasindex; bool relisshared; char relkind; - char relarch; /* 'h' = heavy, 'l' = light, 'n' = no - * archival */ int2 relnatts; /* @@ -74,8 +68,7 @@ CATALOG(pg_class) BOOTSTRAP * must be exactly this many instances in Class pg_attribute for this * class which have attnum > 0 (= user attribute). */ - int2 relsmgr; - int2 relchecks; /* # of CHECK constraints */ + int2 relchecks; /* # of CHECK constraints, not stored in db? */ int2 reltriggers; /* # of TRIGGERs */ bool relhasrules; aclitem relacl[1]; /* this is here for the catalog */ @@ -102,55 +95,51 @@ typedef FormData_pg_class *Form_pg_class; * relacl field. * ---------------- */ -#define Natts_pg_class_fixed 17 -#define Natts_pg_class 18 +#define Natts_pg_class_fixed 13 +#define Natts_pg_class 14 #define Anum_pg_class_relname 1 #define Anum_pg_class_reltype 2 #define Anum_pg_class_relowner 3 #define Anum_pg_class_relam 4 #define Anum_pg_class_relpages 5 #define Anum_pg_class_reltuples 6 -#define Anum_pg_class_relexpires 7 -#define Anum_pg_class_relpreserved 8 -#define Anum_pg_class_relhasindex 9 -#define Anum_pg_class_relisshared 10 -#define Anum_pg_class_relkind 11 -#define Anum_pg_class_relarch 12 -#define Anum_pg_class_relnatts 13 -#define Anum_pg_class_relsmgr 14 -#define Anum_pg_class_relchecks 15 -#define Anum_pg_class_reltriggers 16 -#define Anum_pg_class_relhasrules 17 -#define Anum_pg_class_relacl 18 +#define Anum_pg_class_relhasindex 7 +#define Anum_pg_class_relisshared 8 +#define Anum_pg_class_relkind 9 +#define Anum_pg_class_relnatts 10 +#define Anum_pg_class_relchecks 11 +#define Anum_pg_class_reltriggers 12 +#define Anum_pg_class_relhasrules 13 +#define Anum_pg_class_relacl 14 /* ---------------- * initial contents of pg_class * ---------------- */ -DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ )); +DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 f f r 16 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ )); +DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 f f r 16 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ )); +DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 f f r 16 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 0 0 f f r n 18 0 0 0 f _null_ )); +DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 f f r 18 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1260 ( pg_user 86 PGUID 0 0 0 0 0 f t r n 6 0 0 0 f _null_ )); +DATA(insert OID = 1260 ( pg_user 86 PGUID 0 0 0 f t r 6 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ )); +DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 f t s 3 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ )); +DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 f t r 3 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 0 0 f t s n 2 0 0 0 f _null_ )); +DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 f t s 2 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 0 0 f t s n 1 0 0 0 f _null_ )); +DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 f t s 1 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ )); +DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 0 0 t t r 4 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ )); +DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 0 0 t t r 4 0 0 f _null_ )); DESCR(""); -DATA(insert OID = 1219 ( pg_trigger 111 PGUID 0 0 0 0 0 t t r n 7 0 0 0 f _null_ )); +DATA(insert OID = 1219 ( pg_trigger 111 PGUID 0 0 0 t t r 7 0 0 f _null_ )); DESCR(""); #define RelOid_pg_type 1247 diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h index a466d4dfd0..e849289eef 100644 --- a/src/include/catalog/pg_index.h +++ b/src/include/catalog/pg_index.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_index.h,v 1.5 1997/09/08 02:35:12 momjian Exp $ + * $Id: pg_index.h,v 1.6 1997/11/21 18:12:09 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -48,7 +48,6 @@ CATALOG(pg_index) int28 indkey; oid8 indclass; bool indisclustered; - bool indisarchived; bool indislossy; /* do we fetch false tuples (lossy * compression)? */ bool indhaskeytype; /* does key type != attribute type? */ @@ -70,17 +69,16 @@ typedef FormData_pg_index *IndexTupleForm; * compiler constants for pg_index * ---------------- */ -#define Natts_pg_index 11 +#define Natts_pg_index 10 #define Anum_pg_index_indexrelid 1 #define Anum_pg_index_indrelid 2 #define Anum_pg_index_indproc 3 #define Anum_pg_index_indkey 4 #define Anum_pg_index_indclass 5 #define Anum_pg_index_indisclustered 6 -#define Anum_pg_index_indisarchived 7 -#define Anum_pg_index_indislossy 8 -#define Anum_pg_index_indhaskeytype 9 -#define Anum_pg_index_indisunique 10 -#define Anum_pg_index_indpred 11 +#define Anum_pg_index_indislossy 7 +#define Anum_pg_index_indhaskeytype 8 +#define Anum_pg_index_indisunique 8 +#define Anum_pg_index_indpred 10 #endif /* PG_INDEX_H */ diff --git a/src/include/commands/creatinh.h b/src/include/commands/creatinh.h index 7d57290019..5ba47f8a03 100644 --- a/src/include/commands/creatinh.h +++ b/src/include/commands/creatinh.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: creatinh.h,v 1.4 1997/09/08 21:51:35 momjian Exp $ + * $Id: creatinh.h,v 1.5 1997/11/21 18:12:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,5 @@ extern void DefineRelation(CreateStmt *stmt); extern void RemoveRelation(char *name); -extern char *MakeArchiveName(Oid relid); #endif /* CREATINH_H */ diff --git a/src/include/commands/purge.h b/src/include/commands/purge.h index aa63313c9e..e69de29bb2 100644 --- a/src/include/commands/purge.h +++ b/src/include/commands/purge.h @@ -1,21 +0,0 @@ -/*------------------------------------------------------------------------- - * - * purge.h-- - * - * - * - * Copyright (c) 1994, Regents of the University of California - * - * $Id: purge.h,v 1.4 1997/09/08 21:51:39 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef PURGE_H -#define PURGE_H - -extern int32 -RelationPurge(char *relationName, - char *absoluteTimeString, - char *relativeTimeString); - -#endif /* PURGE_H */ diff --git a/src/include/config.h.in b/src/include/config.h.in index dd57432c87..957114b73b 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -259,7 +259,6 @@ /* #define FASTBUILD_DEBUG */ #define RTDEBUG #define GISTDEBUG -/* #define PURGEDEBUG */ /* #define DEBUG_RECIPE */ /* #define ASYNC_DEBUG */ /* #define COPY_DEBUG */ diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 152a1cdd28..7239818bd9 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nodes.h,v 1.16 1997/10/28 15:10:37 vadim Exp $ + * $Id: nodes.h,v 1.17 1997/11/21 18:12:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -162,7 +162,6 @@ typedef enum NodeTag T_FetchStmt, T_IndexStmt, T_ProcedureStmt, - T_PurgeStmt, T_RecipeStmt, T_RemoveAggrStmt, T_RemoveFuncStmt, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 30625da1da..b2f70de1b4 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.31 1997/11/20 23:23:44 momjian Exp $ + * $Id: parsenodes.h,v 1.32 1997/11/21 18:12:28 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -129,11 +129,6 @@ typedef struct CopyStmt * Create Table Statement * ---------------------- */ -typedef enum ArchType -{ - ARCH_NONE, ARCH_LIGHT, ARCH_HEAVY /* archive mode */ -} ArchType; - typedef struct CreateStmt { NodeTag type; @@ -141,9 +136,6 @@ typedef struct CreateStmt List *tableElts; /* column definitions list of ColumnDef */ List *inhRelnames; /* relations to inherit from list of Value * (string) */ - ArchType archiveType; /* archive mode (ARCH_NONE if none */ - int location; /* smgrid (-1 if none) */ - int archiveLoc; /* smgrid (-1 if none) */ List *constraints; /* list of constraints (ConstaintDef) */ } CreateStmt; @@ -329,18 +321,6 @@ typedef struct ProcedureStmt } ProcedureStmt; /* ---------------------- - * Purge Statement - * ---------------------- - */ -typedef struct PurgeStmt -{ - NodeTag type; - char *relname; /* relation to purge */ - char *beforeDate; /* purge before this date */ - char *afterDate; /* purge after this date */ -} PurgeStmt; - -/* ---------------------- * Drop Aggregate Statement * ---------------------- */ @@ -880,7 +860,6 @@ typedef struct RangeTblEntry * from clause) */ Oid relid; bool inh; /* inheritance? */ - bool archive; /* filled in by plan_archive */ bool inFromCl; /* comes from From Clause */ } RangeTblEntry; diff --git a/src/include/optimizer/prep.h b/src/include/optimizer/prep.h index ca42b88dff..6ef82dfdeb 100644 --- a/src/include/optimizer/prep.h +++ b/src/include/optimizer/prep.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: prep.h,v 1.6 1997/11/20 23:23:48 momjian Exp $ + * $Id: prep.h,v 1.7 1997/11/21 18:12:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -36,7 +36,7 @@ preprocess_targetlist(List *tlist, int command_type, */ typedef enum UnionFlag { - INHERITS_FLAG, ARCHIVE_FLAG, VERSION_FLAG + INHERITS_FLAG, VERSION_FLAG } UnionFlag; extern List * diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index b0d268be08..09f555f9a8 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: buf_internals.h,v 1.18 1997/09/08 21:54:14 momjian Exp $ + * $Id: buf_internals.h,v 1.19 1997/11/21 18:12:43 momjian Exp $ * * NOTE * If BUFFERPAGE0 is defined, then 0 will be used as a @@ -116,7 +116,6 @@ struct sbufdesc_unpadded BufferTag tag; int buf_id; BufFlags flags; - int16 bufsmgr; unsigned refcount; #ifdef HAS_TEST_AND_SET slock_t io_in_progress_lock; @@ -139,7 +138,6 @@ struct sbufdesc int buf_id; /* maps global desc to local desc */ BufFlags flags; /* described below */ - int16 bufsmgr; /* storage manager id for buffer */ unsigned refcount; /* # of times buffer is pinned */ #ifdef HAS_TEST_AND_SET diff --git a/src/man/create_table.l b/src/man/create_table.l index 4f0dfad170..757db8bf0c 100644 --- a/src/man/create_table.l +++ b/src/man/create_table.l @@ -1,6 +1,6 @@ .\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... -.\" $Header: /cvsroot/pgsql/src/man/Attic/create_table.l,v 1.12 1997/10/17 11:35:33 vadim Exp $ +.\" $Header: /cvsroot/pgsql/src/man/Attic/create_table.l,v 1.13 1997/11/21 18:12:54 momjian Exp $ .TH "CREATE TABLE" SQL 09/25/97 PostgreSQL .SH NAME create table \(em create a new class @@ -10,9 +10,6 @@ create table \(em create a new class [\fB,\fP attname type [\fBdefault\fP value] [\fBnot null\fP] [, ...] ]\fB )\fP [\fBinherits\fR \fB(\fR classname [\fB,\fR classname] \fB)\fR] [\fBconstraint\fR cname \fBcheck\fR \fB(\fR test \fB)\fR [, \fBcheck\fR \fB(\fR test \fB)\fR ] ] - [\fBarchive\fR \fB=\fR archive_mode] - [\fBstore\fR \fB=\fR \*(lqsmgr_name\*(rq] - [\fBarch_store\fR \fB=\fR \*(lqsmgr_name\*(rq] .fi .SH DESCRIPTION .BR "Create Table" @@ -70,52 +67,12 @@ must satisfy for an insert or update operation to succeed. Each constraint must evaluate to a boolean expression. Multiple attributes may be referenced within a single constraint. .PP -The optional -.BR store -and -.BR arch_store -keywords may be used to specify a storage manager to use for the new -class. The released version of Postgres supports only \*(lqmagnetic -disk\*(rq as a storage manager name; the research system at UC Berkeley -provides additional storage managers. -.BR Store -controls the location of current data, -and -.BR arch_store -controls the location of historical data. -.BR Arch_store -may only be specified if -.BR archive -is also specified. If either -.BR store -or -.BR arch_store -is not declared, it defaults to \*(lqmagnetic disk\*(rq. -.PP The new class is created as a heap with no initial data. A class can have no more than 1600 attributes (realistically, this is limited by the fact that tuple sizes must be less than 8192 bytes), but this limit may be configured lower at some sites. A class cannot have the same name as a system catalog class. .PP -The -.BR archive -keyword specifies whether historical data is to be saved or discarded. -.IR Arch_mode -may be one of: -.TP 10n -.IR none -No historical access is supported. -.TP 10n -.IR light -Historical access is allowed and optimized for light update activity. -.TP 10n -.IR heavy -Historical access is allowed and optimized for heavy update activity. -.PP -.IR Arch_mode -defaults to \*(lqnone\*(rq. Once the archive status is set, there is -no way to change it. For details of the optimization, see [STON87]. .SH EXAMPLES .nf -- @@ -140,13 +97,6 @@ constraint empcon check (wage > 5.30 and wage <= 30.00), check (name <> '') .fi .nf -- ---Create class foo on magnetic disk and archive historical data --- -create table foo (bar int4) archive = heavy - store = "magnetic disk" -.fi -.nf --- --Create class tictactoe to store noughts-and-crosses --boards as a 2-dimensional array -- diff --git a/src/man/purge.l b/src/man/purge.l index 29d8dc6246..e69de29bb2 100644 --- a/src/man/purge.l +++ b/src/man/purge.l @@ -1,61 +0,0 @@ -.\" This is -*-nroff-*- -.\" XXX standard disclaimer belongs here.... -.TH PURGE SQL 11/05/95 PostgreSQL PostgreSQL -.SH NAME -purge \(em discard historical data -.SH SYNOPSIS -.nf -\fBpurge\fR classname [ \fBbefore\fR abstime ] [ \fBafter\fR reltime ] -.fi -.SH DESCRIPTION -.BR Purge -allows a user to specify the historical retention properties of a -class. If the date specified is an absolute time such as \*(lqJan 1 -1987\*(rq, Postgres will discard tuples whose validity expired before -the indicated time. -.BR Purge -with no -.IR before -clause is equivalent to \*(lqpurge before now\*(rq. Until specified -with a purge command, instance preservation defaults to -\*(lqforever\*(rq. -.PP -The user may purge a class at any time as long as the purge date never -decreases. Postgres will enforce this restriction, silently. -.PP -Note that the -.BR purge -command does not do anything except set a parameter for system -operation. Use -.IR vacuum (l) -to enforce this parameter. -.SH EXAMPLE -.nf --- ---Always discard data in the EMP class ---prior to January 1, 1989 --- -purge EMP before "Jan 1 1989" -.fi -.nf --- ---Retain only the current data in EMP --- -purge EMP -.fi -.SH "SEE ALSO" -vacuum(l). -.SH "BUGS AND CAVEATS" -Error messages are quite unhelpful. A complaint about -\*(lqinconsistent times\*(rq followed by several nine-digit numbers -indicates an attempt to \*(lqback up\*(rq a purge date on a relation. -.PP -You cannot purge certain system catalogs (namely, \*(lqpg_class\*(rq, -\*(lqpg_attribute\*(rq, \*(lqpg_am\*(rq, and \*(lqpg_amop\*(rq) due -to circularities in the system catalog code. -.PP -This definition of the -.BR purge -command is really only useful for non-archived relations, since -tuples will not be discarded from archive relations (they are -never vacuumed). diff --git a/src/man/vacuum.l b/src/man/vacuum.l index 5557060e85..46d980540a 100644 --- a/src/man/vacuum.l +++ b/src/man/vacuum.l @@ -1,6 +1,6 @@ .\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... -.\" $Header: /cvsroot/pgsql/src/man/Attic/vacuum.l,v 1.5 1997/09/08 17:49:43 momjian Exp $ +.\" $Header: /cvsroot/pgsql/src/man/Attic/vacuum.l,v 1.6 1997/11/21 18:12:58 momjian Exp $ .TH VACUUM SQL 11/05/95 PostgreSQL PostgreSQL .SH NAME vacuum \(em vacuum a database @@ -11,8 +11,7 @@ vacuum \(em vacuum a database .SH DESCRIPTION .BR Vacuum is the Postgres vacuum cleaner. It opens every class in the database, -moves deleted records to the archive for archived relations, cleans -out records from aborted transactions, and updates statistics in the +cleans out records from aborted transactions, and updates statistics in the system catalogs. The statistics maintained include the number of tuples and number of pages stored in all classes. Running .BR vacuum @@ -38,13 +37,8 @@ query. This will update the system catalogs with the results of all recent changes, and allow the Postgres query optimizer to make better choices in planning user queries. .PP -The purge(l) command can be used to control the archive retention -characteristics of a given table. -.PP If the server crashes during a vacuum command, chances are it will leave a lock file hanging around. Attempts to re-run the vacuum command result in an error message about the creation of a lock file. If you are sure vacuum is not running, remove the pg_vlock file in your database directory(i.e. data/base/dbname/pg_vlock). -.SH "SEE ALSO" -purge(l). -- 2.11.0