mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Remove archive stuff.
This commit is contained in:
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
tupdesc = CreateTupleDescCopy(OldHeapDesc);
|
||||||
|
|
||||||
OIDNewHeap = heap_create(NewName,
|
OIDNewHeap = heap_create(NewName, tupdesc);
|
||||||
NULL,
|
|
||||||
OldHeap->rd_rel->relarch,
|
|
||||||
OldHeap->rd_rel->relsmgr,
|
|
||||||
tupdesc);
|
|
||||||
|
|
||||||
if (!OidIsValid(OIDNewHeap))
|
if (!OidIsValid(OIDNewHeap))
|
||||||
elog(WARN, "clusterheap: cannot create temporary heap relation\n");
|
elog(WARN, "clusterheap: cannot create temporary heap relation\n");
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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;
|
List *schema = stmt->tableElts;
|
||||||
int numberOfAttributes;
|
int numberOfAttributes;
|
||||||
Oid relationId;
|
Oid relationId;
|
||||||
char archChar;
|
|
||||||
List *inheritList = NULL;
|
List *inheritList = NULL;
|
||||||
char *archiveName = NULL;
|
|
||||||
TupleDesc descriptor;
|
TupleDesc descriptor;
|
||||||
List *constraints;
|
List *constraints;
|
||||||
int heaploc,
|
|
||||||
archloc;
|
|
||||||
|
|
||||||
char *typename = NULL;/* the typename of this relation. not
|
|
||||||
* useod for now */
|
|
||||||
|
|
||||||
if (strlen(stmt->relname) >= NAMEDATALEN)
|
if (strlen(stmt->relname) >= NAMEDATALEN)
|
||||||
elog(WARN, "the relation name %s is >= %d characters long", stmt->relname,
|
elog(WARN, "the relation name %s is >= %d characters long", stmt->relname,
|
||||||
@ -75,53 +68,6 @@ DefineRelation(CreateStmt *stmt)
|
|||||||
*/
|
*/
|
||||||
inheritList = stmt->inhRelnames;
|
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.
|
* generate relation schema, including inherited attributes.
|
||||||
* ----------------
|
* ----------------
|
||||||
@ -191,42 +137,9 @@ DefineRelation(CreateStmt *stmt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
relationId = heap_create(relname,
|
relationId = heap_create(relname, descriptor);
|
||||||
typename,
|
|
||||||
archChar,
|
|
||||||
heaploc,
|
|
||||||
descriptor);
|
|
||||||
|
|
||||||
StoreCatalogInheritance(relationId, inheritList);
|
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;
|
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;
|
|
||||||
}
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
len = length(q->qtrees[0]->targetList);
|
||||||
tupdesc = rel->rd_att;
|
tupdesc = rel->rd_att;
|
||||||
|
|
||||||
relid = heap_create(child->nodeElem->outTypes->val[0],
|
relid = heap_create(child->nodeElem->outTypes->val[0], tupdesc);
|
||||||
NULL, /* XXX */
|
|
||||||
'n',
|
|
||||||
DEFAULT_SMGR,
|
|
||||||
tupdesc);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1076,9 +1072,6 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
relid = heap_create(child->nodeElem->outTypes->val[0],
|
relid = heap_create(child->nodeElem->outTypes->val[0],
|
||||||
NULL, /* XXX */
|
|
||||||
'n',
|
|
||||||
DEFAULT_SMGR,
|
|
||||||
tupdesc);
|
tupdesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,8 +151,6 @@ DefineSequence(CreateSeqStmt *seq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
stmt->relname = seq->seqname;
|
stmt->relname = seq->seqname;
|
||||||
stmt->archiveLoc = -1; /* default */
|
|
||||||
stmt->archiveType = ARCH_NONE;
|
|
||||||
stmt->inhRelnames = NIL;
|
stmt->inhRelnames = NIL;
|
||||||
stmt->constraints = NIL;
|
stmt->constraints = NIL;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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_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_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_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_vaconeind(VPageList vpl, Relation indrel, int nhtups);
|
||||||
static void vc_scanoneind(Relation indrel, int nhtups);
|
static void vc_scanoneind(Relation indrel, int nhtups);
|
||||||
static void vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup);
|
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_free(VRelList vrl);
|
||||||
static void vc_getindices(Oid relid, int *nindices, Relation **Irel);
|
static void vc_getindices(Oid relid, int *nindices, Relation **Irel);
|
||||||
static void vc_clsindices(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 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 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);
|
static int vc_cmp_blk(char *left, char *right);
|
||||||
@ -271,7 +268,6 @@ vc_getrels(NameData *VacRelP)
|
|||||||
Datum d;
|
Datum d;
|
||||||
char *rname;
|
char *rname;
|
||||||
char rkind;
|
char rkind;
|
||||||
int16 smgrno;
|
|
||||||
bool n;
|
bool n;
|
||||||
ScanKeyData pgckey;
|
ScanKeyData pgckey;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -303,23 +299,9 @@ vc_getrels(NameData *VacRelP)
|
|||||||
|
|
||||||
found = true;
|
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);
|
d = heap_getattr(pgctup, buf, Anum_pg_class_relname, pgcdesc, &n);
|
||||||
rname = (char *) d;
|
rname = (char *) d;
|
||||||
|
|
||||||
/* skip archive relations */
|
|
||||||
if (vc_isarchrel(rname))
|
|
||||||
{
|
|
||||||
ReleaseBuffer(buf);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* don't vacuum large objects for now - something breaks when we
|
* don't vacuum large objects for now - something breaks when we
|
||||||
* do
|
* do
|
||||||
@ -335,16 +317,6 @@ vc_getrels(NameData *VacRelP)
|
|||||||
continue;
|
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);
|
d = heap_getattr(pgctup, buf, Anum_pg_class_relkind, pgcdesc, &n);
|
||||||
|
|
||||||
rkind = DatumGetChar(d);
|
rkind = DatumGetChar(d);
|
||||||
@ -1005,7 +977,6 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
|||||||
ntups;
|
ntups;
|
||||||
bool isempty,
|
bool isempty,
|
||||||
dowrite;
|
dowrite;
|
||||||
Relation archrel;
|
|
||||||
struct rusage ru0,
|
struct rusage ru0,
|
||||||
ru1;
|
ru1;
|
||||||
|
|
||||||
@ -1022,27 +993,6 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
|||||||
inulls = (char *) palloc(INDEX_MAX_KEYS * sizeof(*inulls));
|
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;
|
Nvpl.vpl_npages = 0;
|
||||||
Fnpages = Fvpl->vpl_npages;
|
Fnpages = Fvpl->vpl_npages;
|
||||||
Fvplast = Fvpl->vpl_pgdesc[Fnpages - 1];
|
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 */
|
if (Vvplast->vpd_noff > 0) /* there are dead tuples */
|
||||||
{ /* on this page - clean */
|
{ /* on this page - clean */
|
||||||
Assert(!isempty);
|
Assert(!isempty);
|
||||||
vc_vacpage(page, Vvplast, archrel);
|
vc_vacpage(page, Vvplast);
|
||||||
dowrite = true;
|
dowrite = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1169,7 +1119,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
|||||||
ToPage = BufferGetPage(ToBuf);
|
ToPage = BufferGetPage(ToBuf);
|
||||||
/* if this page was not used before - clean it */
|
/* if this page was not used before - clean it */
|
||||||
if (!PageIsEmpty(ToPage) && ToVpd->vpd_nusd == 0)
|
if (!PageIsEmpty(ToPage) && ToVpd->vpd_nusd == 0)
|
||||||
vc_vacpage(ToPage, ToVpd, archrel);
|
vc_vacpage(ToPage, ToVpd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy tuple */
|
/* 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
|
* re-used
|
||||||
*/
|
*/
|
||||||
Assert((*vpp)->vpd_noff > 0);
|
Assert((*vpp)->vpd_noff > 0);
|
||||||
vc_vacpage(page, *vpp, archrel);
|
vc_vacpage(page, *vpp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* this page was used */
|
/* this page was used */
|
||||||
@ -1392,14 +1342,11 @@ Elapsed %u/%u sec.",
|
|||||||
i = BlowawayRelationBuffers(onerel, blkno);
|
i = BlowawayRelationBuffers(onerel, blkno);
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
elog (FATAL, "VACUUM (vc_rpfheap): BlowawayRelationBuffers returned %d", i);
|
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);
|
Assert(blkno >= 0);
|
||||||
vacrelstats->npages = blkno; /* set new number of blocks */
|
vacrelstats->npages = blkno; /* set new number of blocks */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (archrel != (Relation) NULL)
|
|
||||||
heap_close(archrel);
|
|
||||||
|
|
||||||
if (Irel != (Relation *) NULL) /* pfree index' allocations */
|
if (Irel != (Relation *) NULL) /* pfree index' allocations */
|
||||||
{
|
{
|
||||||
pfree(Idesc);
|
pfree(Idesc);
|
||||||
@ -1424,19 +1371,11 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl)
|
|||||||
Buffer buf;
|
Buffer buf;
|
||||||
Page page;
|
Page page;
|
||||||
VPageDescr *vpp;
|
VPageDescr *vpp;
|
||||||
Relation archrel;
|
|
||||||
int nblocks;
|
int nblocks;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
nblocks = Vvpl->vpl_npages;
|
nblocks = Vvpl->vpl_npages;
|
||||||
/* if the relation has an archive, open it */
|
nblocks -= Vvpl->vpl_nemend; /* nothing to do with them */
|
||||||
if (onerel->rd_rel->relarch != 'n')
|
|
||||||
archrel = vc_getarchrel(onerel);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
archrel = (Relation) NULL;
|
|
||||||
nblocks -= Vvpl->vpl_nemend; /* nothing to do with them */
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0, vpp = Vvpl->vpl_pgdesc; i < nblocks; i++, vpp++)
|
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);
|
buf = ReadBuffer(onerel, (*vpp)->vpd_blkno);
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
vc_vacpage(page, *vpp, archrel);
|
vc_vacpage(page, *vpp);
|
||||||
WriteBuffer(buf);
|
WriteBuffer(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1468,22 +1407,19 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl)
|
|||||||
if (i < 0)
|
if (i < 0)
|
||||||
elog (FATAL, "VACUUM (vc_vacheap): BlowawayRelationBuffers returned %d", i);
|
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);
|
Assert(nblocks >= 0);
|
||||||
vacrelstats->npages = nblocks; /* set new number of blocks */
|
vacrelstats->npages = nblocks; /* set new number of blocks */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (archrel != (Relation) NULL)
|
|
||||||
heap_close(archrel);
|
|
||||||
|
|
||||||
} /* vc_vacheap */
|
} /* 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.
|
* and repaire its fragmentation.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_vacpage(Page page, VPageDescr vpd, Relation archrel)
|
vc_vacpage(Page page, VPageDescr vpd)
|
||||||
{
|
{
|
||||||
ItemId itemid;
|
ItemId itemid;
|
||||||
HeapTuple htup;
|
HeapTuple htup;
|
||||||
@ -1493,11 +1429,6 @@ vc_vacpage(Page page, VPageDescr vpd, Relation archrel)
|
|||||||
for (i = 0; i < vpd->vpd_noff; i++)
|
for (i = 0; i < vpd->vpd_noff; i++)
|
||||||
{
|
{
|
||||||
itemid = &(((PageHeader) page)->pd_linp[vpd->vpd_voff[i] - 1]);
|
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;
|
itemid->lp_flags &= ~LP_USED;
|
||||||
}
|
}
|
||||||
PageRepairFragmentation(page);
|
PageRepairFragmentation(page);
|
||||||
@ -2128,51 +2059,6 @@ vc_free(VRelList vrl)
|
|||||||
MemoryContextSwitchTo(old);
|
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 *
|
static char *
|
||||||
vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *))
|
vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *))
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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.tableElts = attrList;
|
||||||
/* createStmt.tableType = NULL;*/
|
/* createStmt.tableType = NULL;*/
|
||||||
createStmt.inhRelnames = NIL;
|
createStmt.inhRelnames = NIL;
|
||||||
createStmt.archiveType = ARCH_NONE;
|
|
||||||
createStmt.location = -1;
|
|
||||||
createStmt.archiveLoc = -1;
|
|
||||||
createStmt.constraints = NIL;
|
createStmt.constraints = NIL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
if (operation == CMD_SELECT)
|
||||||
{
|
{
|
||||||
char *intoName;
|
char *intoName;
|
||||||
char archiveMode;
|
|
||||||
Oid intoRelationId;
|
Oid intoRelationId;
|
||||||
TupleDesc tupdesc;
|
TupleDesc tupdesc;
|
||||||
|
|
||||||
@ -560,14 +559,9 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
|
|||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* create the "into" relation
|
* 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;
|
intoName = parseTree->into;
|
||||||
archiveMode = 'n';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* have to copy tupType to get rid of constraints
|
* 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 */
|
/* fixup to prevent zero-length columns in create */
|
||||||
setVarAttrLenForCreateTable(tupdesc, targetList, rangeTable);
|
setVarAttrLenForCreateTable(tupdesc, targetList, rangeTable);
|
||||||
|
|
||||||
intoRelationId = heap_create(intoName,
|
intoRelationId = heap_create(intoName, tupdesc);
|
||||||
intoName, /* not used */
|
|
||||||
archiveMode,
|
|
||||||
DEFAULT_SMGR,
|
|
||||||
tupdesc);
|
|
||||||
#ifdef NOT_USED /* it's copy ... */
|
#ifdef NOT_USED /* it's copy ... */
|
||||||
resetVarAttrLenForCreateTable(tupdesc);
|
resetVarAttrLenForCreateTable(tupdesc);
|
||||||
#endif
|
#endif
|
||||||
@ -1334,7 +1324,6 @@ ExecRelCheck(Relation rel, HeapTuple tuple)
|
|||||||
rte->refname = rte->relname;
|
rte->refname = rte->relname;
|
||||||
rte->relid = rel->rd_id;
|
rte->relid = rel->rd_id;
|
||||||
rte->inh = false;
|
rte->inh = false;
|
||||||
rte->archive = false;
|
|
||||||
rte->inFromCl = true;
|
rte->inFromCl = true;
|
||||||
rtlist = lcons(rte, NIL);
|
rtlist = lcons(rte, NIL);
|
||||||
econtext->ecxt_scantuple = slot; /* scan tuple slot */
|
econtext->ecxt_scantuple = slot; /* scan tuple slot */
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* ExecEndTee
|
* ExecEndTee
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
bufferRel = heap_openr(teeState->tee_bufferRelname);
|
||||||
else
|
else
|
||||||
bufferRel = heap_open(heap_create(teeState->tee_bufferRelname,
|
bufferRel = heap_open(heap_create(teeState->tee_bufferRelname,
|
||||||
/* FIX */ NULL,
|
|
||||||
'n',
|
|
||||||
DEFAULT_SMGR,
|
|
||||||
tupType));
|
tupType));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -180,9 +177,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
|||||||
newoid());
|
newoid());
|
||||||
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
|
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
|
||||||
bufferRel = heap_open(heap_create(teeState->tee_bufferRelname,
|
bufferRel = heap_open(heap_create(teeState->tee_bufferRelname,
|
||||||
NULL, /* XXX */
|
|
||||||
'n',
|
|
||||||
DEFAULT_SMGR,
|
|
||||||
tupType));
|
tupType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h> /* for ttyname() */
|
#include <unistd.h> /* for ttyname() */
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
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)
|
if (special_plans)
|
||||||
result_plan = special_plans;
|
result_plan = special_plans;
|
||||||
else
|
else
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Makefile for optimizer/prep
|
# Makefile for optimizer/prep
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# 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)
|
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
|
# not ready yet: predmig.o xfunc.o
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* prepunion.c--
|
* 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
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
if (rt_entry->inh)
|
||||||
return count + 1;
|
return count + 1;
|
||||||
break;
|
break;
|
||||||
case ARCHIVE_FLAG:
|
|
||||||
if (rt_entry->archive)
|
|
||||||
return count + 1;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -192,9 +188,6 @@ plan_union_queries(Index rt_index,
|
|||||||
case INHERITS_FLAG:
|
case INHERITS_FLAG:
|
||||||
rt_fetch(rt_index, rangetable)->inh = false;
|
rt_fetch(rt_index, rangetable)->inh = false;
|
||||||
break;
|
break;
|
||||||
case ARCHIVE_FLAG:
|
|
||||||
rt_fetch(rt_index, rangetable)->archive = false;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -249,22 +242,10 @@ plan_union_query(List *relids,
|
|||||||
/* new_root->uniqueFlag = false; */
|
/* new_root->uniqueFlag = false; */
|
||||||
new_root->uniqueFlag = NULL;
|
new_root->uniqueFlag = NULL;
|
||||||
new_root->sortClause = NULL;
|
new_root->sortClause = NULL;
|
||||||
if (flag == ARCHIVE_FLAG)
|
fix_parsetree_attnums(rt_index,
|
||||||
{
|
rt_entry->relid,
|
||||||
|
relid,
|
||||||
/*
|
new_root);
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
union_plans = lappend(union_plans, planner(new_root));
|
union_plans = lappend(union_plans, planner(new_root));
|
||||||
union_rtentries = lappend(union_rtentries, new_rt_entry);
|
union_rtentries = lappend(union_rtentries, new_rt_entry);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -41,7 +41,6 @@
|
|||||||
#include "parser/gramparse.h"
|
#include "parser/gramparse.h"
|
||||||
#include "parser/catalog_utils.h"
|
#include "parser/catalog_utils.h"
|
||||||
#include "parser/parse_query.h"
|
#include "parser/parse_query.h"
|
||||||
#include "storage/smgr.h"
|
|
||||||
#include "utils/acl.h"
|
#include "utils/acl.h"
|
||||||
#include "catalog/catname.h"
|
#include "catalog/catname.h"
|
||||||
#include "utils/elog.h"
|
#include "utils/elog.h"
|
||||||
@ -101,7 +100,6 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr);
|
|||||||
|
|
||||||
VersionStmt *vstmt;
|
VersionStmt *vstmt;
|
||||||
DefineStmt *dstmt;
|
DefineStmt *dstmt;
|
||||||
PurgeStmt *pstmt;
|
|
||||||
RuleStmt *rstmt;
|
RuleStmt *rstmt;
|
||||||
AppendStmt *astmt;
|
AppendStmt *astmt;
|
||||||
}
|
}
|
||||||
@ -112,8 +110,8 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr);
|
|||||||
ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt,
|
ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt,
|
||||||
CreatePLangStmt, DropPLangStmt,
|
CreatePLangStmt, DropPLangStmt,
|
||||||
IndexStmt, ListenStmt, OptimizableStmt,
|
IndexStmt, ListenStmt, OptimizableStmt,
|
||||||
ProcedureStmt, PurgeStmt,
|
ProcedureStmt, RecipeStmt, RemoveAggrStmt, RemoveOperStmt,
|
||||||
RecipeStmt, RemoveAggrStmt, RemoveOperStmt, RemoveFuncStmt, RemoveStmt,
|
RemoveFuncStmt, RemoveStmt,
|
||||||
RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt,
|
RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt,
|
||||||
CreatedbStmt, DestroydbStmt, VacuumStmt, RetrieveStmt, CursorStmt,
|
CreatedbStmt, DestroydbStmt, VacuumStmt, RetrieveStmt, CursorStmt,
|
||||||
ReplaceStmt, AppendStmt, NotifyStmt, DeleteStmt, ClusterStmt,
|
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
|
class, index_name, name, file_name, recipe_name, aggr_argtype
|
||||||
|
|
||||||
%type <str> opt_id, opt_portal_name,
|
%type <str> 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
|
result, OptUseOp, opt_class, SpecialRuleRelation
|
||||||
|
|
||||||
%type <str> privileges, operation_commalist, grantee
|
%type <str> privileges, operation_commalist, grantee
|
||||||
@ -163,16 +161,15 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr);
|
|||||||
%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy,
|
%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy,
|
||||||
index_opt_unique, opt_verbose, opt_analyze
|
index_opt_unique, opt_verbose, opt_analyze
|
||||||
|
|
||||||
%type <ival> copy_dirn, archive_type, OptArchiveType, OptArchiveLocation,
|
%type <ival> copy_dirn, def_type, opt_direction, remove_type,
|
||||||
def_type, opt_direction, remove_type, opt_column, event
|
opt_column, event
|
||||||
|
|
||||||
%type <ival> OptLocation, fetch_how_many
|
%type <ival> fetch_how_many
|
||||||
|
|
||||||
%type <list> OptSeqList
|
%type <list> OptSeqList
|
||||||
%type <defelt> OptSeqElem
|
%type <defelt> OptSeqElem
|
||||||
|
|
||||||
%type <dstmt> def_rest
|
%type <dstmt> def_rest
|
||||||
%type <pstmt> purge_quals
|
|
||||||
%type <astmt> insert_rest
|
%type <astmt> insert_rest
|
||||||
|
|
||||||
%type <coldef> columnDef, alter_clause
|
%type <coldef> 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) */
|
/* Keywords for Postgres support (not in SQL92 reserved words) */
|
||||||
%token ABORT_TRANS, ACL, AFTER, AGGREGATE, ANALYZE,
|
%token ABORT_TRANS, ACL, AFTER, AGGREGATE, ANALYZE,
|
||||||
APPEND, ARCHIVE, ARCH_STORE,
|
APPEND, BACKWARD, BEFORE, BINARY, CHANGE, CLUSTER, COPY,
|
||||||
BACKWARD, BEFORE, BINARY, CHANGE, CLUSTER, COPY,
|
|
||||||
DATABASE, DELIMITERS, DO, EXPLAIN, EXTEND,
|
DATABASE, DELIMITERS, DO, EXPLAIN, EXTEND,
|
||||||
FORWARD, FUNCTION, HANDLER, HEAVY,
|
FORWARD, FUNCTION, HANDLER,
|
||||||
INDEX, INHERITS, INSTEAD, ISNULL,
|
INDEX, INHERITS, INSTEAD, ISNULL,
|
||||||
LANCOMPILER, LIGHT, LISTEN, LOAD, LOCATION, MERGE, MOVE,
|
LANCOMPILER, LISTEN, LOAD, LOCATION, MERGE, MOVE,
|
||||||
NEW, NONE, NOTHING, OIDS, OPERATOR, PROCEDURAL, PURGE,
|
NEW, NONE, NOTHING, OIDS, OPERATOR, PROCEDURAL,
|
||||||
RECIPE, RENAME, REPLACE, RESET, RETRIEVE, RETURNS, RULE,
|
RECIPE, RENAME, REPLACE, RESET, RETRIEVE, RETURNS, RULE,
|
||||||
SEQUENCE, SETOF, SHOW, STDIN, STDOUT, STORE, TRUSTED,
|
SEQUENCE, SETOF, SHOW, STDIN, STDOUT, TRUSTED,
|
||||||
VACUUM, VERBOSE, VERSION
|
VACUUM, VERBOSE, VERSION
|
||||||
|
|
||||||
/* Special keywords, not in the query language - see the "lex" file */
|
/* Special keywords, not in the query language - see the "lex" file */
|
||||||
@ -336,7 +332,6 @@ stmt : AddAttrStmt
|
|||||||
| IndexStmt
|
| IndexStmt
|
||||||
| ListenStmt
|
| ListenStmt
|
||||||
| ProcedureStmt
|
| ProcedureStmt
|
||||||
| PurgeStmt
|
|
||||||
| RecipeStmt
|
| RecipeStmt
|
||||||
| RemoveAggrStmt
|
| RemoveAggrStmt
|
||||||
| RemoveOperStmt
|
| RemoveOperStmt
|
||||||
@ -664,17 +659,13 @@ copy_delimiter: USING DELIMITERS Sconst { $$ = $3;}
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
CreateStmt: CREATE TABLE relation_name '(' OptTableElementList ')'
|
CreateStmt: CREATE TABLE relation_name '(' OptTableElementList ')'
|
||||||
OptInherit OptConstraint OptArchiveType OptLocation
|
OptInherit OptConstraint OptArchiveType
|
||||||
OptArchiveLocation
|
|
||||||
{
|
{
|
||||||
CreateStmt *n = makeNode(CreateStmt);
|
CreateStmt *n = makeNode(CreateStmt);
|
||||||
n->relname = $3;
|
n->relname = $3;
|
||||||
n->tableElts = $5;
|
n->tableElts = $5;
|
||||||
n->inhRelnames = $7;
|
n->inhRelnames = $7;
|
||||||
n->constraints = $8;
|
n->constraints = $8;
|
||||||
n->archiveType = $9;
|
|
||||||
n->location = $10;
|
|
||||||
n->archiveLoc = $11;
|
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -690,26 +681,12 @@ tableElementList :
|
|||||||
{ $$ = lcons($1, NIL); }
|
{ $$ = lcons($1, NIL); }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/*
|
||||||
OptArchiveType: ARCHIVE '=' archive_type { $$ = $3; }
|
* This was removed in 6.3, but we keep it so people can upgrade
|
||||||
| /*EMPTY*/ { $$ = ARCH_NONE; }
|
* with old pg_dump scripts.
|
||||||
;
|
*/
|
||||||
|
OptArchiveType: ARCHIVE '=' NONE { }
|
||||||
archive_type: HEAVY { $$ = ARCH_HEAVY; }
|
| /*EMPTY*/ { }
|
||||||
| LIGHT { $$ = ARCH_LIGHT; }
|
|
||||||
| NONE { $$ = ARCH_NONE; }
|
|
||||||
;
|
|
||||||
|
|
||||||
OptLocation: STORE '=' Sconst
|
|
||||||
{ $$ = smgrin($3); }
|
|
||||||
| /*EMPTY*/
|
|
||||||
{ $$ = -1; }
|
|
||||||
;
|
|
||||||
|
|
||||||
OptArchiveLocation: ARCH_STORE '=' Sconst
|
|
||||||
{ $$ = smgrin($3); }
|
|
||||||
| /*EMPTY*/
|
|
||||||
{ $$ = -1; }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
OptInherit: INHERITS '(' relation_name_list ')' { $$ = $3; }
|
OptInherit: INHERITS '(' relation_name_list ')' { $$ = $3; }
|
||||||
@ -1254,7 +1231,7 @@ RevokeStmt: REVOKE privileges ON relation_name_list FROM grantee
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* QUERY:
|
* QUERY:
|
||||||
* define [archive] index <indexname> on <relname>
|
* create index <indexname> on <relname>
|
||||||
* using <access> "(" (<col> with <op>)+ ")" [with
|
* using <access> "(" (<col> with <op>)+ ")" [with
|
||||||
* <target_list>]
|
* <target_list>]
|
||||||
*
|
*
|
||||||
@ -1407,59 +1384,6 @@ def_args: '(' def_name_list ')' { $$ = $2; }
|
|||||||
|
|
||||||
def_name_list: name_list;
|
def_name_list: name_list;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
*
|
|
||||||
* QUERY:
|
|
||||||
* purge <relname> [before <date>] [after <date>]
|
|
||||||
* or
|
|
||||||
* purge <relname> [after <date>] [before <date>]
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
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:
|
* QUERY:
|
||||||
@ -2122,7 +2046,7 @@ SubSelect: SELECT opt_unique res_target_list2
|
|||||||
;
|
;
|
||||||
|
|
||||||
result: INTO TABLE relation_name
|
result: INTO TABLE relation_name
|
||||||
{ $$= $3; /* should check for archive level */ }
|
{ $$= $3; }
|
||||||
| /*EMPTY*/
|
| /*EMPTY*/
|
||||||
{ $$ = NULL; }
|
{ $$ = NULL; }
|
||||||
;
|
;
|
||||||
@ -3446,7 +3370,6 @@ ColId: Id { $$ = $1; }
|
|||||||
| INDEX { $$ = "index"; }
|
| INDEX { $$ = "index"; }
|
||||||
| KEY { $$ = "key"; }
|
| KEY { $$ = "key"; }
|
||||||
| LANGUAGE { $$ = "language"; }
|
| LANGUAGE { $$ = "language"; }
|
||||||
| LIGHT { $$ = "light"; }
|
|
||||||
| LOCATION { $$ = "location"; }
|
| LOCATION { $$ = "location"; }
|
||||||
| MATCH { $$ = "match"; }
|
| MATCH { $$ = "match"; }
|
||||||
| OPERATOR { $$ = "operator"; }
|
| OPERATOR { $$ = "operator"; }
|
||||||
@ -3481,7 +3404,6 @@ ColLabel: ColId { $$ = $1; }
|
|||||||
| ORDER { $$ = "order"; }
|
| ORDER { $$ = "order"; }
|
||||||
| POSITION { $$ = "position"; }
|
| POSITION { $$ = "position"; }
|
||||||
| PRECISION { $$ = "precision"; }
|
| PRECISION { $$ = "precision"; }
|
||||||
| STORE { $$ = "store"; }
|
|
||||||
| TABLE { $$ = "table"; }
|
| TABLE { $$ = "table"; }
|
||||||
| TRANSACTION { $$ = "transaction"; }
|
| TRANSACTION { $$ = "transaction"; }
|
||||||
| TRUE_P { $$ = "true"; }
|
| TRUE_P { $$ = "true"; }
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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},
|
{"analyze", ANALYZE},
|
||||||
{"and", AND},
|
{"and", AND},
|
||||||
{"append", APPEND},
|
{"append", APPEND},
|
||||||
{"archIve", ARCHIVE}, /* XXX crooked: I < _ */
|
{"archive", ARCHIVE},
|
||||||
{"arch_store", ARCH_STORE},
|
|
||||||
{"archive", ARCHIVE}, /* XXX crooked: i > _ */
|
|
||||||
{"as", AS},
|
{"as", AS},
|
||||||
{"asc", ASC},
|
{"asc", ASC},
|
||||||
{"backward", BACKWARD},
|
{"backward", BACKWARD},
|
||||||
@ -106,7 +104,6 @@ static ScanKeyword ScanKeywords[] = {
|
|||||||
{"group", GROUP},
|
{"group", GROUP},
|
||||||
{"handler", HANDLER},
|
{"handler", HANDLER},
|
||||||
{"having", HAVING},
|
{"having", HAVING},
|
||||||
{"heavy", HEAVY},
|
|
||||||
{"hour", HOUR_P},
|
{"hour", HOUR_P},
|
||||||
{"in", IN},
|
{"in", IN},
|
||||||
{"index", INDEX},
|
{"index", INDEX},
|
||||||
@ -124,7 +121,6 @@ static ScanKeyword ScanKeywords[] = {
|
|||||||
{"language", LANGUAGE},
|
{"language", LANGUAGE},
|
||||||
{"leading", LEADING},
|
{"leading", LEADING},
|
||||||
{"left", LEFT},
|
{"left", LEFT},
|
||||||
{"light", LIGHT},
|
|
||||||
{"like", LIKE},
|
{"like", LIKE},
|
||||||
{"listen", LISTEN},
|
{"listen", LISTEN},
|
||||||
{"load", LOAD},
|
{"load", LOAD},
|
||||||
@ -162,7 +158,6 @@ static ScanKeyword ScanKeywords[] = {
|
|||||||
{"procedural", PROCEDURAL},
|
{"procedural", PROCEDURAL},
|
||||||
{"procedure", PROCEDURE},
|
{"procedure", PROCEDURE},
|
||||||
{"public", PUBLIC},
|
{"public", PUBLIC},
|
||||||
{"purge", PURGE},
|
|
||||||
{"recipe", RECIPE},
|
{"recipe", RECIPE},
|
||||||
{"references", REFERENCES},
|
{"references", REFERENCES},
|
||||||
{"rename", RENAME},
|
{"rename", RENAME},
|
||||||
@ -182,7 +177,6 @@ static ScanKeyword ScanKeywords[] = {
|
|||||||
{"show", SHOW},
|
{"show", SHOW},
|
||||||
{"stdin", STDIN},
|
{"stdin", STDIN},
|
||||||
{"stdout", STDOUT},
|
{"stdout", STDOUT},
|
||||||
{"store", STORE},
|
|
||||||
{"substring", SUBSTRING},
|
{"substring", SUBSTRING},
|
||||||
{"table", TABLE},
|
{"table", TABLE},
|
||||||
{"time", TIME},
|
{"time", TIME},
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* recursive (transitive closure) [we don't support them all -- ay
|
||||||
* 9/94 ]
|
* 9/94 ]
|
||||||
*/
|
*/
|
||||||
@ -157,8 +157,6 @@ addRangeTableEntry(ParseState *pstate,
|
|||||||
/* RelOID */
|
/* RelOID */
|
||||||
rte->relid = RelationGetRelationId(relation);
|
rte->relid = RelationGetRelationId(relation);
|
||||||
|
|
||||||
rte->archive = false;
|
|
||||||
|
|
||||||
rte->inFromCl = inFromCl;
|
rte->inFromCl = inFromCl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 */
|
/* new buffers are zero-filled */
|
||||||
MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ);
|
MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ);
|
||||||
smgrextend(bufHdr->bufsmgr, reln,
|
smgrextend(DEFAULT_SMGR, reln,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
}
|
}
|
||||||
return (BufferDescriptorGetBuffer(bufHdr));
|
return (BufferDescriptorGetBuffer(bufHdr));
|
||||||
@ -290,12 +290,12 @@ ReadBufferWithBufferLock(Relation reln,
|
|||||||
{
|
{
|
||||||
/* new buffers are zero-filled */
|
/* new buffers are zero-filled */
|
||||||
MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ);
|
MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ);
|
||||||
status = smgrextend(bufHdr->bufsmgr, reln,
|
status = smgrextend(DEFAULT_SMGR, reln,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
status = smgrread(bufHdr->bufsmgr, reln, blockNum,
|
status = smgrread(DEFAULT_SMGR, reln, blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ BufferAlloc(Relation reln,
|
|||||||
if (blockNum == P_NEW)
|
if (blockNum == P_NEW)
|
||||||
{
|
{
|
||||||
newblock = TRUE;
|
newblock = TRUE;
|
||||||
blockNum = smgrnblocks(reln->rd_rel->relsmgr, reln);
|
blockNum = smgrnblocks(DEFAULT_SMGR, reln);
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_BUFFERTAG(&newTag, reln, blockNum);
|
INIT_BUFFERTAG(&newTag, reln, blockNum);
|
||||||
@ -645,9 +645,6 @@ BufferAlloc(Relation reln,
|
|||||||
strcpy(buf->sb_relname, reln->rd_rel->relname.data);
|
strcpy(buf->sb_relname, reln->rd_rel->relname.data);
|
||||||
strcpy(buf->sb_dbname, GetDatabaseName());
|
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);
|
INIT_BUFFERTAG(&(buf->tag), reln, blockNum);
|
||||||
if (!BufTableInsert(buf))
|
if (!BufTableInsert(buf))
|
||||||
{
|
{
|
||||||
@ -830,7 +827,7 @@ FlushBuffer(Buffer buffer, bool release)
|
|||||||
bufHdr->flags &= ~BM_JUST_DIRTIED;
|
bufHdr->flags &= ~BM_JUST_DIRTIED;
|
||||||
SpinRelease(BufMgrLock);
|
SpinRelease(BufMgrLock);
|
||||||
|
|
||||||
status = smgrflush(bufHdr->bufsmgr, bufrel, bufHdr->tag.blockNum,
|
status = smgrflush(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
|
|
||||||
RelationDecrementReferenceCount(bufrel);
|
RelationDecrementReferenceCount(bufrel);
|
||||||
@ -1038,14 +1035,14 @@ BufferSync()
|
|||||||
#endif /* OPTIMIZE_SINGLE */
|
#endif /* OPTIMIZE_SINGLE */
|
||||||
if (reln == (Relation) NULL)
|
if (reln == (Relation) NULL)
|
||||||
{
|
{
|
||||||
status = smgrblindwrt(bufHdr->bufsmgr, bufHdr->sb_dbname,
|
status = smgrblindwrt(DEFAULT_SMGR, bufHdr->sb_dbname,
|
||||||
bufHdr->sb_relname, bufdb, bufrel,
|
bufHdr->sb_relname, bufdb, bufrel,
|
||||||
bufHdr->tag.blockNum,
|
bufHdr->tag.blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
status = smgrwrite(bufHdr->bufsmgr, reln,
|
status = smgrwrite(DEFAULT_SMGR, reln,
|
||||||
bufHdr->tag.blockNum,
|
bufHdr->tag.blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
}
|
}
|
||||||
@ -1375,14 +1372,14 @@ BufferReplace(BufferDesc *bufHdr, bool bufferLockHeld)
|
|||||||
|
|
||||||
if (reln != (Relation) NULL)
|
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));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
/* blind write always flushes */
|
/* blind write always flushes */
|
||||||
status = smgrblindwrt(bufHdr->bufsmgr, bufHdr->sb_dbname,
|
status = smgrblindwrt(DEFAULT_SMGR, bufHdr->sb_dbname,
|
||||||
bufHdr->sb_relname, bufdb, bufrel,
|
bufHdr->sb_relname, bufdb, bufrel,
|
||||||
bufHdr->tag.blockNum,
|
bufHdr->tag.blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
@ -1413,7 +1410,7 @@ RelationGetNumberOfBlocks(Relation relation)
|
|||||||
{
|
{
|
||||||
return
|
return
|
||||||
((relation->rd_islocal) ? relation->rd_nblocks :
|
((relation->rd_islocal) ? relation->rd_nblocks :
|
||||||
smgrnblocks(relation->rd_rel->relsmgr, relation));
|
smgrnblocks(DEFAULT_SMGR, relation));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
Assert(bufrel != NULL);
|
||||||
|
|
||||||
/* flush this page */
|
/* flush this page */
|
||||||
smgrwrite(bufrel->rd_rel->relsmgr, bufrel, bufHdr->tag.blockNum,
|
smgrwrite(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
LocalBufferFlushCount++;
|
LocalBufferFlushCount++;
|
||||||
RelationDecrementReferenceCount(bufrel);
|
RelationDecrementReferenceCount(bufrel);
|
||||||
@ -202,7 +202,7 @@ FlushLocalBuffer(Buffer buffer, bool release)
|
|||||||
bufrel = RelationIdCacheGetRelation(bufHdr->tag.relId.relId);
|
bufrel = RelationIdCacheGetRelation(bufHdr->tag.relId.relId);
|
||||||
|
|
||||||
Assert(bufrel != NULL);
|
Assert(bufrel != NULL);
|
||||||
smgrflush(bufrel->rd_rel->relsmgr, bufrel, bufHdr->tag.blockNum,
|
smgrflush(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
|
||||||
(char *) MAKE_PTR(bufHdr->data));
|
(char *) MAKE_PTR(bufHdr->data));
|
||||||
LocalBufferFlushCount++;
|
LocalBufferFlushCount++;
|
||||||
RelationDecrementReferenceCount(bufrel);
|
RelationDecrementReferenceCount(bufrel);
|
||||||
@ -276,7 +276,7 @@ LocalBufferSync(void)
|
|||||||
|
|
||||||
Assert(bufrel != NULL);
|
Assert(bufrel != NULL);
|
||||||
|
|
||||||
smgrwrite(bufrel->rd_rel->relsmgr, bufrel, buf->tag.blockNum,
|
smgrwrite(DEFAULT_SMGR, bufrel, buf->tag.blockNum,
|
||||||
(char *) MAKE_PTR(buf->data));
|
(char *) MAKE_PTR(buf->data));
|
||||||
LocalBufferFlushCount++;
|
LocalBufferFlushCount++;
|
||||||
RelationDecrementReferenceCount(bufrel);
|
RelationDecrementReferenceCount(bufrel);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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.
|
* be located on whatever storage manager the user requested.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
heap_create(objname,
|
heap_create(objname, tupdesc);
|
||||||
objname,
|
|
||||||
(int) archchar, smgr,
|
|
||||||
tupdesc);
|
|
||||||
|
|
||||||
/* make the relation visible in this transaction */
|
/* make the relation visible in this transaction */
|
||||||
CommandCounterIncrement();
|
CommandCounterIncrement();
|
||||||
@ -160,7 +157,7 @@ inv_create(int flags)
|
|||||||
if (!RelationIsValid(r))
|
if (!RelationIsValid(r))
|
||||||
{
|
{
|
||||||
elog(WARN, "cannot create large object on %s under inversion",
|
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))
|
if (!RelationIsValid(indr))
|
||||||
{
|
{
|
||||||
elog(WARN, "cannot create index for large obj on %s under inversion",
|
elog(WARN, "cannot create index for large obj on %s under inversion",
|
||||||
smgrout(smgr));
|
smgrout(DEFAULT_SMGR));
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = (LargeObjectDesc *) palloc(sizeof(LargeObjectDesc));
|
retval = (LargeObjectDesc *) palloc(sizeof(LargeObjectDesc));
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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/creatinh.h"
|
||||||
#include "commands/sequence.h"
|
#include "commands/sequence.h"
|
||||||
#include "commands/defrem.h"
|
#include "commands/defrem.h"
|
||||||
#include "commands/purge.h"
|
|
||||||
#include "commands/rename.h"
|
#include "commands/rename.h"
|
||||||
#include "commands/view.h"
|
#include "commands/view.h"
|
||||||
#include "commands/version.h"
|
#include "commands/version.h"
|
||||||
@ -210,19 +209,6 @@ ProcessUtility(Node * parsetree,
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
case T_CopyStmt:
|
||||||
{
|
{
|
||||||
CopyStmt *stmt = (CopyStmt *) parsetree;
|
CopyStmt *stmt = (CopyStmt *) parsetree;
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
* Routines for handling of 'SET var TO',
|
* Routines for handling of 'SET var TO',
|
||||||
* 'SHOW var' and 'RESET var' statements.
|
* '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 <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <time.h>
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "tcop/variable.h"
|
#include "tcop/variable.h"
|
||||||
|
15
src/backend/utils/cache/relcache.c
vendored
15
src/backend/utils/cache/relcache.c
vendored
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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.
|
* by the storage manager code to rd_fd.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
fd = smgropen(relp->relsmgr, relation);
|
fd = smgropen(DEFAULT_SMGR, relation);
|
||||||
|
|
||||||
Assert(fd >= -1);
|
Assert(fd >= -1);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
@ -1091,7 +1091,6 @@ formrdesc(char *relationName,
|
|||||||
relation->rd_rel->relpages = 1; /* XXX */
|
relation->rd_rel->relpages = 1; /* XXX */
|
||||||
relation->rd_rel->reltuples = 1; /* XXX */
|
relation->rd_rel->reltuples = 1; /* XXX */
|
||||||
relation->rd_rel->relkind = RELKIND_RELATION;
|
relation->rd_rel->relkind = RELKIND_RELATION;
|
||||||
relation->rd_rel->relarch = 'n';
|
|
||||||
relation->rd_rel->relnatts = (uint16) natts;
|
relation->rd_rel->relnatts = (uint16) natts;
|
||||||
relation->rd_isnailed = true;
|
relation->rd_isnailed = true;
|
||||||
|
|
||||||
@ -1157,7 +1156,7 @@ RelationIdCacheGetRelation(Oid relationId)
|
|||||||
{
|
{
|
||||||
if (rd->rd_fd == -1)
|
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);
|
Assert(rd->rd_fd != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1190,7 +1189,7 @@ RelationNameCacheGetRelation(char *relationName)
|
|||||||
{
|
{
|
||||||
if (rd->rd_fd == -1)
|
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);
|
Assert(rd->rd_fd != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1594,13 +1593,13 @@ RelationPurgeLocalRelation(bool xactCommitted)
|
|||||||
{
|
{
|
||||||
if (!(reln->rd_tmpunlinked))
|
if (!(reln->rd_tmpunlinked))
|
||||||
{
|
{
|
||||||
smgrunlink(reln->rd_rel->relsmgr, reln);
|
smgrunlink(DEFAULT_SMGR, reln);
|
||||||
reln->rd_tmpunlinked = TRUE;
|
reln->rd_tmpunlinked = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
smgrunlink(reln->rd_rel->relsmgr, reln);
|
smgrunlink(DEFAULT_SMGR, reln);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!IsBootstrapProcessingMode() && !(reln->rd_istemp))
|
else if (!IsBootstrapProcessingMode() && !(reln->rd_istemp))
|
||||||
@ -1613,7 +1612,7 @@ RelationPurgeLocalRelation(bool xactCommitted)
|
|||||||
* heap_destroyr and we skip smgrclose for them. -
|
* heap_destroyr and we skip smgrclose for them. -
|
||||||
* vadim 05/22/97
|
* vadim 05/22/97
|
||||||
*/
|
*/
|
||||||
smgrclose(reln->rd_rel->relsmgr, reln);
|
smgrclose(DEFAULT_SMGR, reln);
|
||||||
|
|
||||||
reln->rd_islocal = FALSE;
|
reln->rd_islocal = FALSE;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* 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",
|
fprintf(stderr, "%s dumping out the contents of Table %s %s\n",
|
||||||
g_comment_start, classname, g_comment_end);
|
g_comment_start, classname, g_comment_end);
|
||||||
|
|
||||||
/* skip archive names */
|
|
||||||
if (isArchiveName(classname))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!dumpData)
|
if (!dumpData)
|
||||||
dumpClasses_nodumpData(fout, classname, oids);
|
dumpClasses_nodumpData(fout, classname, oids);
|
||||||
else
|
else
|
||||||
@ -907,20 +903,11 @@ clearTableInfo(TableInfo *tblinfo, int numTables)
|
|||||||
|
|
||||||
if (tblinfo[i].oid)
|
if (tblinfo[i].oid)
|
||||||
free(tblinfo[i].oid);
|
free(tblinfo[i].oid);
|
||||||
if (tblinfo[i].relarch)
|
|
||||||
free(tblinfo[i].relarch);
|
|
||||||
if (tblinfo[i].relacl)
|
if (tblinfo[i].relacl)
|
||||||
free(tblinfo[i].relacl);
|
free(tblinfo[i].relacl);
|
||||||
if (tblinfo[i].usename)
|
if (tblinfo[i].usename)
|
||||||
free(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)
|
if (tblinfo[i].relname)
|
||||||
free(tblinfo[i].relname);
|
free(tblinfo[i].relname);
|
||||||
|
|
||||||
@ -1288,7 +1275,6 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
|
|||||||
|
|
||||||
int i_oid;
|
int i_oid;
|
||||||
int i_relname;
|
int i_relname;
|
||||||
int i_relarch;
|
|
||||||
int i_relkind;
|
int i_relkind;
|
||||||
int i_relacl;
|
int i_relacl;
|
||||||
int i_usename;
|
int i_usename;
|
||||||
@ -1313,7 +1299,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
|
|||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
sprintf(query,
|
sprintf(query,
|
||||||
"SELECT pg_class.oid, relname, relarch, relkind, relacl, usename, "
|
"SELECT pg_class.oid, relname, relkind, relacl, usename, "
|
||||||
"relchecks, reltriggers "
|
"relchecks, reltriggers "
|
||||||
"from pg_class, pg_user "
|
"from pg_class, pg_user "
|
||||||
"where relowner = usesysid and "
|
"where relowner = usesysid and "
|
||||||
@ -1336,7 +1322,6 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
|
|||||||
|
|
||||||
i_oid = PQfnumber(res, "oid");
|
i_oid = PQfnumber(res, "oid");
|
||||||
i_relname = PQfnumber(res, "relname");
|
i_relname = PQfnumber(res, "relname");
|
||||||
i_relarch = PQfnumber(res, "relarch");
|
|
||||||
i_relkind = PQfnumber(res, "relkind");
|
i_relkind = PQfnumber(res, "relkind");
|
||||||
i_relacl = PQfnumber(res, "relacl");
|
i_relacl = PQfnumber(res, "relacl");
|
||||||
i_usename = PQfnumber(res, "usename");
|
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].oid = strdup(PQgetvalue(res, i, i_oid));
|
||||||
tblinfo[i].relname = strdup(PQgetvalue(res, i, i_relname));
|
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].relacl = strdup(PQgetvalue(res, i, i_relacl));
|
||||||
tblinfo[i].sequence = (strcmp(PQgetvalue(res, i, i_relkind), "S") == 0);
|
tblinfo[i].sequence = (strcmp(PQgetvalue(res, i, i_relkind), "S") == 0);
|
||||||
tblinfo[i].usename = strdup(PQgetvalue(res, i, i_usename));
|
tblinfo[i].usename = strdup(PQgetvalue(res, i, i_usename));
|
||||||
@ -1636,10 +1620,6 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
|
|||||||
for (i = 0; i < numTables; i++)
|
for (i = 0; i < numTables; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* skip archive tables */
|
|
||||||
if (isArchiveName(tblinfo[i].relname))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (tblinfo[i].sequence)
|
if (tblinfo[i].sequence)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -2178,7 +2158,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
|
|||||||
char **parentRels; /* list of names of parent relations */
|
char **parentRels; /* list of names of parent relations */
|
||||||
int numParents;
|
int numParents;
|
||||||
int actual_atts; /* number of attrs in this CREATE statment */
|
int actual_atts; /* number of attrs in this CREATE statment */
|
||||||
const char *archiveMode;
|
|
||||||
|
|
||||||
/* First - dump SEQUENCEs */
|
/* First - dump SEQUENCEs */
|
||||||
for (i = 0; i < numTables; i++)
|
for (i = 0; i < numTables; i++)
|
||||||
@ -2204,10 +2183,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
|
|||||||
if (isViewRule(tblinfo[i].relname))
|
if (isViewRule(tblinfo[i].relname))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* skip archive names */
|
|
||||||
if (isArchiveName(tblinfo[i].relname))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
parentRels = tblinfo[i].parentRels;
|
parentRels = tblinfo[i].parentRels;
|
||||||
numParents = tblinfo[i].numParents;
|
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)
|
if (acls)
|
||||||
fprintf(fout,
|
fprintf(fout,
|
||||||
"UPDATE pg_class SET relacl='%s' where relname='%s';\n",
|
"UPDATE pg_class SET relacl='%s' where relname='%s';\n",
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
|
||||||
*
|
*
|
||||||
@ -66,7 +66,6 @@ typedef struct _tableInfo
|
|||||||
{
|
{
|
||||||
char *oid;
|
char *oid;
|
||||||
char *relname;
|
char *relname;
|
||||||
char *relarch;
|
|
||||||
char *relacl;
|
char *relacl;
|
||||||
bool sequence;
|
bool sequence;
|
||||||
int numatts; /* number of attributes */
|
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 check_conn_and_db(void);
|
||||||
extern void parseArgTypes(char **argtypes, const char *str);
|
extern void parseArgTypes(char **argtypes, const char *str);
|
||||||
extern int isArchiveName(const char *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* version specific routines
|
* version specific routines
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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 <sequence_name>\n\t[increment <NUMBER>]\n\t[start <NUMBER>]\n\t[minvalue <NUMBER>]\n\t[maxvalue <NUMBER>]\n\t[cache <NUMBER>]\n\t[cycle];"},
|
"create sequence <sequence_name>\n\t[increment <NUMBER>]\n\t[start <NUMBER>]\n\t[minvalue <NUMBER>]\n\t[maxvalue <NUMBER>]\n\t[cache <NUMBER>]\n\t[cycle];"},
|
||||||
{"create table",
|
{"create table",
|
||||||
"create a new table",
|
"create a new table",
|
||||||
"create table <class_name>\n\t(<attr1> <type1> [default <expression>] [not null] [,...])\n\t[inherits (<class_name1>,...<class_nameN>)\n\t[[constraint <name>] check <condition> [,...] ]\n\tarchive=<archive_mode>\n\tstore=<smgr_name>\n\tarch_store=<smgr_name>];"},
|
"create table <class_name>\n\t(<attr1> <type1> [default <expression>] [not null] [,...])\n\t[inherits (<class_name1>,...<class_nameN>)\n\t[[constraint <name>] check <condition> [,...] ]\n;"},
|
||||||
{"create trigger",
|
{"create trigger",
|
||||||
"create a new trigger",
|
"create a new trigger",
|
||||||
"create trigger <trigger_name> after|before event1 [or event2 [or event3] ]\n\ton <class_name> for each row|statement\n\texecute procedure <func_name> ([arguments]);\n\n\teventX is one of INSERT, DELETE, UPDATE"},
|
"create trigger <trigger_name> after|before event1 [or event2 [or event3] ]\n\ton <class_name> for each row|statement\n\texecute procedure <func_name> ([arguments]);\n\n\teventX is one of INSERT, DELETE, UPDATE"},
|
||||||
@ -159,9 +159,6 @@ static struct _helpStruct QL_HELP[] = {
|
|||||||
{"notify",
|
{"notify",
|
||||||
"signal all frontends and backends listening on a relation",
|
"signal all frontends and backends listening on a relation",
|
||||||
"notify <class_name>"},
|
"notify <class_name>"},
|
||||||
{"purge",
|
|
||||||
"purge historical data",
|
|
||||||
"purge <class_name> [before <abstime>] [after <reltime>];"},
|
|
||||||
{"reset",
|
{"reset",
|
||||||
"set run-time environment back to default",
|
"set run-time environment back to default",
|
||||||
"reset {DateStyle | GEQO | R_PLANS}"},
|
"reset {DateStyle | GEQO | R_PLANS}"},
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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 <utils/rel.h>
|
#include <utils/rel.h>
|
||||||
|
|
||||||
extern Relation heap_creatr(char *relname, unsigned smgr, TupleDesc att);
|
extern Relation heap_creatr(char *relname, TupleDesc att);
|
||||||
|
|
||||||
extern Oid
|
extern Oid
|
||||||
heap_create(char relname[],
|
heap_create(char relname[], TupleDesc tupdesc);
|
||||||
char *typename,
|
|
||||||
int arch,
|
|
||||||
unsigned smgr, TupleDesc tupdesc);
|
|
||||||
|
|
||||||
extern void heap_destroy(char relname[]);
|
extern void heap_destroy(char relname[]);
|
||||||
extern void heap_destroyr(Relation r);
|
extern void heap_destroyr(Relation r);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
* NOTES
|
||||||
* the genbki.sh script reads this file and generates .bki
|
* 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 \
|
#define Schema_pg_class \
|
||||||
{ 1259l, {"relname"}, 19l, 0l, NAMEDATALEN, 1, 0l, -1l, '\0', '\0', 'i', '\0', '\0' }, \
|
{ 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, {"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, {"relowner"}, 26l, 0l, 4, 3, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
||||||
{ 1259l, {"relam"}, 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, 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, 5, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1259l, {"reltuples"}, 23, 0l, 4, 6, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
||||||
{ 1259l, {"relexpires"}, 702, 0l, 4, 6, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1259l, {"relhasindex"}, 16, 0l, 1, 7, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \
|
||||||
{ 1259l, {"relpreserved"}, 703, 0l, 4, 7, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1259l, {"relisshared"}, 16, 0l, 1, 8, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \
|
||||||
{ 1259l, {"relhasindex"}, 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, {"relisshared"}, 16, 0l, 1, 9, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \
|
{ 1259l, {"relnatts"}, 21, 0l, 2, 10, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
||||||
{ 1259l, {"relkind"}, 18, 0l, 1, 10, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \
|
{ 1259l, {"relchecks"}, 21l, 0l, 2, 11, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
||||||
{ 1259l, {"relarch"}, 18, 0l, 1, 11, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \
|
{ 1259l, {"reltriggers"}, 21l, 0l, 2, 12, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
||||||
{ 1259l, {"relnatts"}, 21, 0l, 2, 12, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
{ 1259l, {"relhasrules"}, 16, 0l, 1, 13, 0l, -1l, '\001', '\0', 'c', '\0', '\0' }, \
|
||||||
{ 1259l, {"relsmgr"}, 210l, 0l, 2, 13, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
{ 1259l, {"relacl"}, 1034l, 0l, -1, 14, 0l, -1l, '\0', '\0', 'i', '\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' }
|
|
||||||
|
|
||||||
DATA(insert OID = 0 ( 1259 relname 19 0 NAMEDATALEN 1 0 -1 f f i f f));
|
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 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 relowner 26 0 4 3 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 relam 26 0 4 4 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 relpages 23 0 4 5 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 reltuples 23 0 4 6 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 relhasindex 16 0 1 7 0 -1 t f c f f));
|
||||||
DATA(insert OID = 0 ( 1259 relpreserved 702 0 4 7 0 -1 t f i f f));
|
DATA(insert OID = 0 ( 1259 relisshared 16 0 1 8 0 -1 t f c f f));
|
||||||
DATA(insert OID = 0 ( 1259 relhasindex 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 relisshared 16 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 relkind 18 0 1 10 0 -1 t f c f f));
|
DATA(insert OID = 0 ( 1259 relchecks 21 0 2 11 0 -1 t f s f f));
|
||||||
DATA(insert OID = 0 ( 1259 relarch 18 0 1 11 0 -1 t f c f f));
|
DATA(insert OID = 0 ( 1259 reltriggers 21 0 2 12 0 -1 t f s f f));
|
||||||
DATA(insert OID = 0 ( 1259 relnatts 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 relsmgr 210 0 2 13 0 -1 t f s f f));
|
DATA(insert OID = 0 ( 1259 relacl 1034 0 -1 14 0 -1 f f i 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 ctid 27 0 6 -1 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 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));
|
DATA(insert OID = 0 ( 1259 xmin 28 0 4 -3 0 -1 f f i f f));
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
* NOTES
|
||||||
* ``pg_relation'' is being replaced by ``pg_class''. currently
|
* ``pg_relation'' is being replaced by ``pg_class''. currently
|
||||||
@ -58,15 +58,9 @@ CATALOG(pg_class) BOOTSTRAP
|
|||||||
Oid relam;
|
Oid relam;
|
||||||
int4 relpages;
|
int4 relpages;
|
||||||
int4 reltuples;
|
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 relhasindex;
|
||||||
bool relisshared;
|
bool relisshared;
|
||||||
char relkind;
|
char relkind;
|
||||||
char relarch; /* 'h' = heavy, 'l' = light, 'n' = no
|
|
||||||
* archival */
|
|
||||||
int2 relnatts;
|
int2 relnatts;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -74,8 +68,7 @@ CATALOG(pg_class) BOOTSTRAP
|
|||||||
* must be exactly this many instances in Class pg_attribute for this
|
* must be exactly this many instances in Class pg_attribute for this
|
||||||
* class which have attnum > 0 (= user attribute).
|
* class which have attnum > 0 (= user attribute).
|
||||||
*/
|
*/
|
||||||
int2 relsmgr;
|
int2 relchecks; /* # of CHECK constraints, not stored in db? */
|
||||||
int2 relchecks; /* # of CHECK constraints */
|
|
||||||
int2 reltriggers; /* # of TRIGGERs */
|
int2 reltriggers; /* # of TRIGGERs */
|
||||||
bool relhasrules;
|
bool relhasrules;
|
||||||
aclitem relacl[1]; /* this is here for the catalog */
|
aclitem relacl[1]; /* this is here for the catalog */
|
||||||
@ -102,55 +95,51 @@ typedef FormData_pg_class *Form_pg_class;
|
|||||||
* relacl field.
|
* relacl field.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
#define Natts_pg_class_fixed 17
|
#define Natts_pg_class_fixed 13
|
||||||
#define Natts_pg_class 18
|
#define Natts_pg_class 14
|
||||||
#define Anum_pg_class_relname 1
|
#define Anum_pg_class_relname 1
|
||||||
#define Anum_pg_class_reltype 2
|
#define Anum_pg_class_reltype 2
|
||||||
#define Anum_pg_class_relowner 3
|
#define Anum_pg_class_relowner 3
|
||||||
#define Anum_pg_class_relam 4
|
#define Anum_pg_class_relam 4
|
||||||
#define Anum_pg_class_relpages 5
|
#define Anum_pg_class_relpages 5
|
||||||
#define Anum_pg_class_reltuples 6
|
#define Anum_pg_class_reltuples 6
|
||||||
#define Anum_pg_class_relexpires 7
|
#define Anum_pg_class_relhasindex 7
|
||||||
#define Anum_pg_class_relpreserved 8
|
#define Anum_pg_class_relisshared 8
|
||||||
#define Anum_pg_class_relhasindex 9
|
#define Anum_pg_class_relkind 9
|
||||||
#define Anum_pg_class_relisshared 10
|
#define Anum_pg_class_relnatts 10
|
||||||
#define Anum_pg_class_relkind 11
|
#define Anum_pg_class_relchecks 11
|
||||||
#define Anum_pg_class_relarch 12
|
#define Anum_pg_class_reltriggers 12
|
||||||
#define Anum_pg_class_relnatts 13
|
#define Anum_pg_class_relhasrules 13
|
||||||
#define Anum_pg_class_relsmgr 14
|
#define Anum_pg_class_relacl 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
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* initial contents of pg_class
|
* 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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
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("");
|
DESCR("");
|
||||||
|
|
||||||
#define RelOid_pg_type 1247
|
#define RelOid_pg_type 1247
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
* NOTES
|
||||||
* the genbki.sh script reads this file and generates .bki
|
* the genbki.sh script reads this file and generates .bki
|
||||||
@ -48,7 +48,6 @@ CATALOG(pg_index)
|
|||||||
int28 indkey;
|
int28 indkey;
|
||||||
oid8 indclass;
|
oid8 indclass;
|
||||||
bool indisclustered;
|
bool indisclustered;
|
||||||
bool indisarchived;
|
|
||||||
bool indislossy; /* do we fetch false tuples (lossy
|
bool indislossy; /* do we fetch false tuples (lossy
|
||||||
* compression)? */
|
* compression)? */
|
||||||
bool indhaskeytype; /* does key type != attribute type? */
|
bool indhaskeytype; /* does key type != attribute type? */
|
||||||
@ -70,17 +69,16 @@ typedef FormData_pg_index *IndexTupleForm;
|
|||||||
* compiler constants for pg_index
|
* 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_indexrelid 1
|
||||||
#define Anum_pg_index_indrelid 2
|
#define Anum_pg_index_indrelid 2
|
||||||
#define Anum_pg_index_indproc 3
|
#define Anum_pg_index_indproc 3
|
||||||
#define Anum_pg_index_indkey 4
|
#define Anum_pg_index_indkey 4
|
||||||
#define Anum_pg_index_indclass 5
|
#define Anum_pg_index_indclass 5
|
||||||
#define Anum_pg_index_indisclustered 6
|
#define Anum_pg_index_indisclustered 6
|
||||||
#define Anum_pg_index_indisarchived 7
|
#define Anum_pg_index_indislossy 7
|
||||||
#define Anum_pg_index_indislossy 8
|
#define Anum_pg_index_indhaskeytype 8
|
||||||
#define Anum_pg_index_indhaskeytype 9
|
#define Anum_pg_index_indisunique 8
|
||||||
#define Anum_pg_index_indisunique 10
|
#define Anum_pg_index_indpred 10
|
||||||
#define Anum_pg_index_indpred 11
|
|
||||||
|
|
||||||
#endif /* PG_INDEX_H */
|
#endif /* PG_INDEX_H */
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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 DefineRelation(CreateStmt *stmt);
|
||||||
extern void RemoveRelation(char *name);
|
extern void RemoveRelation(char *name);
|
||||||
extern char *MakeArchiveName(Oid relid);
|
|
||||||
|
|
||||||
#endif /* CREATINH_H */
|
#endif /* CREATINH_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 */
|
|
||||||
|
@ -259,7 +259,6 @@
|
|||||||
/* #define FASTBUILD_DEBUG */
|
/* #define FASTBUILD_DEBUG */
|
||||||
#define RTDEBUG
|
#define RTDEBUG
|
||||||
#define GISTDEBUG
|
#define GISTDEBUG
|
||||||
/* #define PURGEDEBUG */
|
|
||||||
/* #define DEBUG_RECIPE */
|
/* #define DEBUG_RECIPE */
|
||||||
/* #define ASYNC_DEBUG */
|
/* #define ASYNC_DEBUG */
|
||||||
/* #define COPY_DEBUG */
|
/* #define COPY_DEBUG */
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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_FetchStmt,
|
||||||
T_IndexStmt,
|
T_IndexStmt,
|
||||||
T_ProcedureStmt,
|
T_ProcedureStmt,
|
||||||
T_PurgeStmt,
|
|
||||||
T_RecipeStmt,
|
T_RecipeStmt,
|
||||||
T_RemoveAggrStmt,
|
T_RemoveAggrStmt,
|
||||||
T_RemoveFuncStmt,
|
T_RemoveFuncStmt,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
* Create Table Statement
|
||||||
* ----------------------
|
* ----------------------
|
||||||
*/
|
*/
|
||||||
typedef enum ArchType
|
|
||||||
{
|
|
||||||
ARCH_NONE, ARCH_LIGHT, ARCH_HEAVY /* archive mode */
|
|
||||||
} ArchType;
|
|
||||||
|
|
||||||
typedef struct CreateStmt
|
typedef struct CreateStmt
|
||||||
{
|
{
|
||||||
NodeTag type;
|
NodeTag type;
|
||||||
@ -141,9 +136,6 @@ typedef struct CreateStmt
|
|||||||
List *tableElts; /* column definitions list of ColumnDef */
|
List *tableElts; /* column definitions list of ColumnDef */
|
||||||
List *inhRelnames; /* relations to inherit from list of Value
|
List *inhRelnames; /* relations to inherit from list of Value
|
||||||
* (string) */
|
* (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) */
|
List *constraints; /* list of constraints (ConstaintDef) */
|
||||||
} CreateStmt;
|
} CreateStmt;
|
||||||
|
|
||||||
@ -328,18 +320,6 @@ typedef struct ProcedureStmt
|
|||||||
char *language; /* C or SQL */
|
char *language; /* C or SQL */
|
||||||
} 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
|
* Drop Aggregate Statement
|
||||||
* ----------------------
|
* ----------------------
|
||||||
@ -880,7 +860,6 @@ typedef struct RangeTblEntry
|
|||||||
* from clause) */
|
* from clause) */
|
||||||
Oid relid;
|
Oid relid;
|
||||||
bool inh; /* inheritance? */
|
bool inh; /* inheritance? */
|
||||||
bool archive; /* filled in by plan_archive */
|
|
||||||
bool inFromCl; /* comes from From Clause */
|
bool inFromCl; /* comes from From Clause */
|
||||||
} RangeTblEntry;
|
} RangeTblEntry;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
typedef enum UnionFlag
|
||||||
{
|
{
|
||||||
INHERITS_FLAG, ARCHIVE_FLAG, VERSION_FLAG
|
INHERITS_FLAG, VERSION_FLAG
|
||||||
} UnionFlag;
|
} UnionFlag;
|
||||||
|
|
||||||
extern List *
|
extern List *
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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
|
* NOTE
|
||||||
* If BUFFERPAGE0 is defined, then 0 will be used as a
|
* If BUFFERPAGE0 is defined, then 0 will be used as a
|
||||||
@ -116,7 +116,6 @@ struct sbufdesc_unpadded
|
|||||||
BufferTag tag;
|
BufferTag tag;
|
||||||
int buf_id;
|
int buf_id;
|
||||||
BufFlags flags;
|
BufFlags flags;
|
||||||
int16 bufsmgr;
|
|
||||||
unsigned refcount;
|
unsigned refcount;
|
||||||
#ifdef HAS_TEST_AND_SET
|
#ifdef HAS_TEST_AND_SET
|
||||||
slock_t io_in_progress_lock;
|
slock_t io_in_progress_lock;
|
||||||
@ -139,7 +138,6 @@ struct sbufdesc
|
|||||||
int buf_id; /* maps global desc to local desc */
|
int buf_id; /* maps global desc to local desc */
|
||||||
|
|
||||||
BufFlags flags; /* described below */
|
BufFlags flags; /* described below */
|
||||||
int16 bufsmgr; /* storage manager id for buffer */
|
|
||||||
unsigned refcount; /* # of times buffer is pinned */
|
unsigned refcount; /* # of times buffer is pinned */
|
||||||
|
|
||||||
#ifdef HAS_TEST_AND_SET
|
#ifdef HAS_TEST_AND_SET
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.\" This is -*-nroff-*-
|
.\" This is -*-nroff-*-
|
||||||
.\" XXX standard disclaimer belongs here....
|
.\" 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
|
.TH "CREATE TABLE" SQL 09/25/97 PostgreSQL
|
||||||
.SH NAME
|
.SH NAME
|
||||||
create table \(em create a new class
|
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
|
[\fB,\fP attname type [\fBdefault\fP value] [\fBnot null\fP] [, ...] ]\fB )\fP
|
||||||
[\fBinherits\fR \fB(\fR classname [\fB,\fR classname] \fB)\fR]
|
[\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 ] ]
|
[\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
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.BR "Create Table"
|
.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
|
must evaluate to a boolean expression. Multiple attributes may be referenced within
|
||||||
a single constraint.
|
a single constraint.
|
||||||
.PP
|
.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
|
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
|
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
|
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
|
may be configured lower at some sites. A class cannot have the same
|
||||||
name as a system catalog class.
|
name as a system catalog class.
|
||||||
.PP
|
.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
|
.SH EXAMPLES
|
||||||
.nf
|
.nf
|
||||||
--
|
--
|
||||||
@ -140,13 +97,6 @@ constraint empcon check (wage > 5.30 and wage <= 30.00), check (name <> '')
|
|||||||
.fi
|
.fi
|
||||||
.nf
|
.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
|
--Create class tictactoe to store noughts-and-crosses
|
||||||
--boards as a 2-dimensional array
|
--boards as a 2-dimensional array
|
||||||
--
|
--
|
||||||
|
@ -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).
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.\" This is -*-nroff-*-
|
.\" This is -*-nroff-*-
|
||||||
.\" XXX standard disclaimer belongs here....
|
.\" 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
|
.TH VACUUM SQL 11/05/95 PostgreSQL PostgreSQL
|
||||||
.SH NAME
|
.SH NAME
|
||||||
vacuum \(em vacuum a database
|
vacuum \(em vacuum a database
|
||||||
@ -11,8 +11,7 @@ vacuum \(em vacuum a database
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.BR Vacuum
|
.BR Vacuum
|
||||||
is the Postgres vacuum cleaner. It opens every class in the database,
|
is the Postgres vacuum cleaner. It opens every class in the database,
|
||||||
moves deleted records to the archive for archived relations, cleans
|
cleans out records from aborted transactions, and updates statistics in the
|
||||||
out records from aborted transactions, and updates statistics in the
|
|
||||||
system catalogs. The statistics maintained include the number of
|
system catalogs. The statistics maintained include the number of
|
||||||
tuples and number of pages stored in all classes. Running
|
tuples and number of pages stored in all classes. Running
|
||||||
.BR vacuum
|
.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
|
recent changes, and allow the Postgres query optimizer to make better
|
||||||
choices in planning user queries.
|
choices in planning user queries.
|
||||||
.PP
|
.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
|
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
|
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
|
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
|
are sure vacuum is not running, remove the pg_vlock file in your
|
||||||
database directory(i.e. data/base/dbname/pg_vlock).
|
database directory(i.e. data/base/dbname/pg_vlock).
|
||||||
.SH "SEE ALSO"
|
|
||||||
purge(l).
|
|
||||||
|
Reference in New Issue
Block a user