Remove all time travel stuff. Small parser cleanup.
This commit is contained in:
parent
e075271c17
commit
e9e1ff226f
@ -169,7 +169,7 @@ gistbuild(Relation heap,
|
||||
econtext = NULL;
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(scan, 0, &buffer);
|
||||
|
||||
/* int the tuples as we insert them */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.16 1997/09/08 21:40:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.17 1997/11/20 23:19:50 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
@ -121,7 +121,7 @@ hashbuild(Relation heap,
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
|
||||
/* start a heap scan */
|
||||
hscan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
hscan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(hscan, 0, &buffer);
|
||||
|
||||
/* build the index */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.21 1997/11/02 15:24:26 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.22 1997/11/20 23:19:57 momjian Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@ -215,7 +215,7 @@ heapgettup(Relation relation,
|
||||
ItemPointer tid,
|
||||
int dir,
|
||||
Buffer *b,
|
||||
TimeQual timeQual,
|
||||
bool seeself,
|
||||
int nkeys,
|
||||
ScanKey key)
|
||||
{
|
||||
@ -254,19 +254,11 @@ heapgettup(Relation relation,
|
||||
elog(DEBUG, "heapgettup(%.16s, tid=0x%x, dir=%d, ...)",
|
||||
RelationGetRelationName(relation), tid, dir);
|
||||
}
|
||||
elog(DEBUG, "heapgettup(..., b=0x%x, timeQ=0x%x, nkeys=%d, key=0x%x",
|
||||
b, timeQual, nkeys, key);
|
||||
if (timeQual == SelfTimeQual)
|
||||
{
|
||||
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', SelfTimeQual",
|
||||
relation->rd_rel->relkind, &relation->rd_rel->relname);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', timeQual=%d",
|
||||
relation->rd_rel->relkind, &relation->rd_rel->relname,
|
||||
timeQual);
|
||||
}
|
||||
elog(DEBUG, "heapgettup(..., b=0x%x, nkeys=%d, key=0x%x", b, nkeys, key);
|
||||
|
||||
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', %s",
|
||||
relation->rd_rel->relkind, &relation->rd_rel->relname,
|
||||
(seeself == true) ? "SeeSelf" : "NoSeeSelf");
|
||||
#endif /* !defined(HEAPDEBUGALL) */
|
||||
|
||||
if (!ItemPointerIsValid(tid))
|
||||
@ -303,9 +295,7 @@ heapgettup(Relation relation,
|
||||
|
||||
#ifndef NO_BUFFERISVALID
|
||||
if (!BufferIsValid(*b))
|
||||
{
|
||||
elog(WARN, "heapgettup: failed ReadBuffer");
|
||||
}
|
||||
#endif
|
||||
|
||||
dp = (Page) BufferGetPage(*b);
|
||||
@ -430,7 +420,7 @@ heapgettup(Relation relation,
|
||||
* ----------------
|
||||
*/
|
||||
HeapTupleSatisfies(lpp, relation, *b, (PageHeader) dp,
|
||||
timeQual, nkeys, key, rtup);
|
||||
seeself, nkeys, key, rtup);
|
||||
if (rtup != NULL)
|
||||
{
|
||||
ItemPointer iptr = &(rtup->t_ctid);
|
||||
@ -618,7 +608,7 @@ heap_close(Relation relation)
|
||||
HeapScanDesc
|
||||
heap_beginscan(Relation relation,
|
||||
int atend,
|
||||
TimeQual timeQual,
|
||||
bool seeself,
|
||||
unsigned nkeys,
|
||||
ScanKey key)
|
||||
{
|
||||
@ -646,9 +636,7 @@ heap_beginscan(Relation relation,
|
||||
|
||||
/* XXX someday assert SelfTimeQual if relkind == RELKIND_UNCATALOGED */
|
||||
if (relation->rd_rel->relkind == RELKIND_UNCATALOGED)
|
||||
{
|
||||
timeQual = SelfTimeQual;
|
||||
}
|
||||
seeself = true;
|
||||
|
||||
/* ----------------
|
||||
* increment relation ref count while scanning relation
|
||||
@ -666,24 +654,19 @@ heap_beginscan(Relation relation,
|
||||
sdesc->rs_rd = relation;
|
||||
|
||||
if (nkeys)
|
||||
{
|
||||
|
||||
/*
|
||||
* we do this here instead of in initsdesc() because heap_rescan
|
||||
* also calls initsdesc() and we don't want to allocate memory
|
||||
* again
|
||||
*/
|
||||
sdesc->rs_key = (ScanKey) palloc(sizeof(ScanKeyData) * nkeys);
|
||||
}
|
||||
else
|
||||
{
|
||||
sdesc->rs_key = NULL;
|
||||
}
|
||||
|
||||
initsdesc(sdesc, relation, atend, nkeys, key);
|
||||
|
||||
sdesc->rs_atend = atend;
|
||||
sdesc->rs_tr = timeQual;
|
||||
sdesc->rs_seeself = seeself;
|
||||
sdesc->rs_nkeys = (short) nkeys;
|
||||
|
||||
return (sdesc);
|
||||
@ -900,7 +883,7 @@ heap_getnext(HeapScanDesc scandesc,
|
||||
iptr,
|
||||
-1,
|
||||
&(sdesc->rs_cbuf),
|
||||
sdesc->rs_tr,
|
||||
sdesc->rs_seeself,
|
||||
sdesc->rs_nkeys,
|
||||
sdesc->rs_key);
|
||||
}
|
||||
@ -987,7 +970,7 @@ heap_getnext(HeapScanDesc scandesc,
|
||||
iptr,
|
||||
1,
|
||||
&sdesc->rs_cbuf,
|
||||
sdesc->rs_tr,
|
||||
sdesc->rs_seeself,
|
||||
sdesc->rs_nkeys,
|
||||
sdesc->rs_key);
|
||||
}
|
||||
@ -1032,7 +1015,7 @@ heap_getnext(HeapScanDesc scandesc,
|
||||
*/
|
||||
HeapTuple
|
||||
heap_fetch(Relation relation,
|
||||
TimeQual timeQual,
|
||||
bool seeself,
|
||||
ItemPointer tid,
|
||||
Buffer *b)
|
||||
{
|
||||
@ -1094,7 +1077,7 @@ heap_fetch(Relation relation,
|
||||
*/
|
||||
|
||||
HeapTupleSatisfies(lp, relation, buffer, dp,
|
||||
timeQual, 0, (ScanKey) NULL, tuple);
|
||||
seeself, 0, (ScanKey) NULL, tuple);
|
||||
|
||||
if (tuple == NULL)
|
||||
{
|
||||
@ -1259,7 +1242,7 @@ heap_delete(Relation relation, ItemPointer tid)
|
||||
* ----------------
|
||||
*/
|
||||
HeapTupleSatisfies(lp, relation, b, dp,
|
||||
NowTimeQual, 0, (ScanKey) NULL, tp);
|
||||
false, 0, (ScanKey) NULL, tp);
|
||||
if (!tp)
|
||||
{
|
||||
|
||||
@ -1395,7 +1378,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||
relation,
|
||||
buffer,
|
||||
(PageHeader) dp,
|
||||
NowTimeQual,
|
||||
false,
|
||||
0,
|
||||
(ScanKey) NULL,
|
||||
tuple);
|
||||
@ -1492,7 +1475,7 @@ heap_markpos(HeapScanDesc sdesc)
|
||||
(ItemPointer) NULL : &sdesc->rs_ctup->t_ctid,
|
||||
-1,
|
||||
&sdesc->rs_pbuf,
|
||||
sdesc->rs_tr,
|
||||
sdesc->rs_seeself,
|
||||
sdesc->rs_nkeys,
|
||||
sdesc->rs_key);
|
||||
|
||||
@ -1506,7 +1489,7 @@ heap_markpos(HeapScanDesc sdesc)
|
||||
(ItemPointer) NULL : &sdesc->rs_ctup->t_ctid,
|
||||
1,
|
||||
&sdesc->rs_nbuf,
|
||||
sdesc->rs_tr,
|
||||
sdesc->rs_seeself,
|
||||
sdesc->rs_nkeys,
|
||||
sdesc->rs_key);
|
||||
}
|
||||
@ -1594,7 +1577,7 @@ heap_restrpos(HeapScanDesc sdesc)
|
||||
&sdesc->rs_mptid,
|
||||
0,
|
||||
&sdesc->rs_pbuf,
|
||||
NowTimeQual,
|
||||
false,
|
||||
0,
|
||||
(ScanKey) NULL);
|
||||
}
|
||||
@ -1610,7 +1593,7 @@ heap_restrpos(HeapScanDesc sdesc)
|
||||
&sdesc->rs_mctid,
|
||||
0,
|
||||
&sdesc->rs_cbuf,
|
||||
NowTimeQual,
|
||||
false,
|
||||
0,
|
||||
(ScanKey) NULL);
|
||||
}
|
||||
@ -1626,7 +1609,7 @@ heap_restrpos(HeapScanDesc sdesc)
|
||||
&sdesc->rs_mntid,
|
||||
0,
|
||||
&sdesc->rs_nbuf,
|
||||
NowTimeQual,
|
||||
false,
|
||||
0,
|
||||
(ScanKey) NULL);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.12 1997/09/08 21:41:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.13 1997/11/20 23:20:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -508,7 +508,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(operatorObjectId));
|
||||
|
||||
scan = heap_beginscan(operatorRelation, false, NowTimeQual,
|
||||
scan = heap_beginscan(operatorRelation, false, false,
|
||||
1, &scanKeyData);
|
||||
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
@ -564,7 +564,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
|
||||
ObjectIdGetDatum(indexObjectId));
|
||||
|
||||
relation = heap_openr(IndexRelationName);
|
||||
scan = heap_beginscan(relation, false, NowTimeQual, 1, entry);
|
||||
scan = heap_beginscan(relation, false, false, 1, entry);
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
elog(WARN, "IndexSupportInitialize: corrupted catalogs");
|
||||
@ -628,7 +628,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
|
||||
entry[1].sk_argument =
|
||||
ObjectIdGetDatum(operatorClassObjectId[attributeNumber - 1]);
|
||||
|
||||
scan = heap_beginscan(relation, false, NowTimeQual, 2, entry);
|
||||
scan = heap_beginscan(relation, false, false, 2, entry);
|
||||
|
||||
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
|
||||
HeapTupleIsValid(tuple))
|
||||
@ -671,7 +671,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
|
||||
for (strategy = 1; strategy <= maxStrategyNumber; strategy++)
|
||||
ScanKeyEntrySetIllegal(StrategyMapGetScanKeyEntry(map, strategy));
|
||||
|
||||
scan = heap_beginscan(relation, false, NowTimeQual, 2, entry);
|
||||
scan = heap_beginscan(relation, false, false, 2, entry);
|
||||
|
||||
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
|
||||
HeapTupleIsValid(tuple))
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.20 1997/09/08 21:41:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.21 1997/11/20 23:20:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -120,7 +120,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
|
||||
{ /* they're equal */
|
||||
btitem = (BTItem) PageGetItem(page, PageGetItemId(page, offset));
|
||||
itup = &(btitem->bti_itup);
|
||||
htup = heap_fetch(heapRel, SelfTimeQual, &(itup->t_tid), NULL);
|
||||
htup = heap_fetch(heapRel, true, &(itup->t_tid), NULL);
|
||||
if (htup != (HeapTuple) NULL)
|
||||
{ /* it is a duplicate */
|
||||
elog(WARN, "Cannot insert a duplicate key into a unique index.");
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.23 1997/09/08 21:41:24 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.24 1997/11/20 23:20:21 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
@ -153,7 +153,7 @@ btbuild(Relation heap,
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
|
||||
/* start a heap scan */
|
||||
hscan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
hscan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(hscan, 0, &buffer);
|
||||
|
||||
/* build the index */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.18 1997/09/18 20:19:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.19 1997/11/20 23:20:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -164,7 +164,7 @@ rtbuild(Relation heap,
|
||||
slot = NULL;
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(scan, 0, &buffer);
|
||||
|
||||
/* count the tuples as we insert them */
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.27 1997/11/17 16:58:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.28 1997/11/20 23:20:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -487,14 +487,14 @@ boot_openrel(char *relname)
|
||||
{
|
||||
StartPortalAllocMode(DefaultAllocMode, 0);
|
||||
rdesc = heap_openr(TypeRelationName);
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
|
||||
for (i = 0; PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)); ++i);
|
||||
heap_endscan(sdesc);
|
||||
app = Typ = ALLOC(struct typmap *, i + 1);
|
||||
while (i-- > 0)
|
||||
*app++ = ALLOC(struct typmap, 1);
|
||||
*app = (struct typmap *) NULL;
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
|
||||
app = Typ;
|
||||
while (PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)))
|
||||
{
|
||||
@ -852,7 +852,7 @@ gettype(char *type)
|
||||
if (DebugMode)
|
||||
printf("bootstrap.c: External Type: %s\n", type);
|
||||
rdesc = heap_openr(TypeRelationName);
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
|
||||
i = 0;
|
||||
while (PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)))
|
||||
++i;
|
||||
@ -861,7 +861,7 @@ gettype(char *type)
|
||||
while (i-- > 0)
|
||||
*app++ = ALLOC(struct typmap, 1);
|
||||
*app = (struct typmap *) NULL;
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
|
||||
app = Typ;
|
||||
while (PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)))
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.30 1997/11/02 15:24:55 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.31 1997/11/20 23:20:38 momjian Exp $
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
* heap_creatr() - Create an uncataloged heap relation
|
||||
@ -500,7 +500,7 @@ RelationAlreadyExists(Relation pg_class_desc, char relname[])
|
||||
*/
|
||||
pg_class_scan = heap_beginscan(pg_class_desc,
|
||||
0,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@ -903,7 +903,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
|
||||
scan = heap_beginscan(catalogRelation,
|
||||
false,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@ -931,7 +931,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
|
||||
scan = heap_beginscan(catalogRelation,
|
||||
false,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@ -959,7 +959,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
|
||||
scan = heap_beginscan(catalogRelation,
|
||||
false,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@ -998,7 +998,7 @@ RelationRemoveIndexes(Relation relation)
|
||||
|
||||
scan = heap_beginscan(indexRelation,
|
||||
false,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@ -1046,7 +1046,7 @@ DeletePgRelationTuple(Relation rdesc)
|
||||
|
||||
pg_class_scan = heap_beginscan(pg_class_desc,
|
||||
0,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@ -1110,7 +1110,7 @@ DeletePgAttributeTuples(Relation rdesc)
|
||||
|
||||
pg_attribute_scan = heap_beginscan(pg_attribute_desc,
|
||||
0,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@ -1179,7 +1179,7 @@ DeletePgTypeTuple(Relation rdesc)
|
||||
|
||||
pg_type_scan = heap_beginscan(pg_type_desc,
|
||||
0,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@ -1215,7 +1215,7 @@ DeletePgTypeTuple(Relation rdesc)
|
||||
|
||||
pg_attribute_scan = heap_beginscan(pg_attribute_desc,
|
||||
0,
|
||||
NowTimeQual,
|
||||
false,
|
||||
1,
|
||||
&attkey);
|
||||
|
||||
@ -1670,7 +1670,7 @@ RemoveAttrDefault(Relation rel)
|
||||
|
||||
RelationSetLockForWrite(adrel);
|
||||
|
||||
adscan = heap_beginscan(adrel, 0, NowTimeQual, 1, &key);
|
||||
adscan = heap_beginscan(adrel, 0, false, 1, &key);
|
||||
|
||||
while (tup = heap_getnext(adscan, 0, (Buffer *) NULL), PointerIsValid(tup))
|
||||
heap_delete(adrel, &tup->t_ctid);
|
||||
@ -1697,7 +1697,7 @@ RemoveRelCheck(Relation rel)
|
||||
|
||||
RelationSetLockForWrite(rcrel);
|
||||
|
||||
rcscan = heap_beginscan(rcrel, 0, NowTimeQual, 1, &key);
|
||||
rcscan = heap_beginscan(rcrel, 0, false, 1, &key);
|
||||
|
||||
while (tup = heap_getnext(rcscan, 0, (Buffer *) NULL), PointerIsValid(tup))
|
||||
heap_delete(rcrel, &tup->t_ctid);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.25 1997/11/02 15:25:01 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.26 1997/11/20 23:20:44 momjian Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@ -178,7 +178,7 @@ RelationNameGetObjectId(char *relationName,
|
||||
NameEqualRegProcedure,
|
||||
PointerGetDatum(relationName));
|
||||
|
||||
pg_class_scan = heap_beginscan(pg_class, 0, NowTimeQual, 1, &key);
|
||||
pg_class_scan = heap_beginscan(pg_class, 0, false, 1, &key);
|
||||
|
||||
/* ----------------
|
||||
* if we find the named relation, fetch its relation id
|
||||
@ -505,7 +505,7 @@ AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId)
|
||||
* ----------------
|
||||
*/
|
||||
pg_am_desc = heap_openr(AccessMethodRelationName);
|
||||
pg_am_scan = heap_beginscan(pg_am_desc, 0, NowTimeQual, 1, &key);
|
||||
pg_am_scan = heap_beginscan(pg_am_desc, 0, false, 1, &key);
|
||||
|
||||
pg_am_tuple = heap_getnext(pg_am_scan, 0, (Buffer *) NULL);
|
||||
|
||||
@ -952,7 +952,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(indexoid));
|
||||
|
||||
scan = heap_beginscan(pg_index, 0, NowTimeQual, 1, &entry);
|
||||
scan = heap_beginscan(pg_index, 0, false, 1, &entry);
|
||||
tuple = heap_getnext(scan, 0, &buffer);
|
||||
heap_endscan(scan);
|
||||
|
||||
@ -1249,7 +1249,7 @@ index_destroy(Oid indexId)
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(indexId));;
|
||||
|
||||
scan = heap_beginscan(catalogRelation, 0, NowTimeQual, 1, &entry);
|
||||
scan = heap_beginscan(catalogRelation, 0, false, 1, &entry);
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
|
||||
AssertState(HeapTupleIsValid(tuple));
|
||||
@ -1266,7 +1266,7 @@ index_destroy(Oid indexId)
|
||||
|
||||
entry.sk_attno = Anum_pg_attribute_attrelid;
|
||||
|
||||
scan = heap_beginscan(catalogRelation, 0, NowTimeQual, 1, &entry);
|
||||
scan = heap_beginscan(catalogRelation, 0, false, 1, &entry);
|
||||
|
||||
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
|
||||
HeapTupleIsValid(tuple))
|
||||
@ -1285,7 +1285,7 @@ index_destroy(Oid indexId)
|
||||
|
||||
entry.sk_attno = Anum_pg_index_indexrelid;
|
||||
|
||||
scan = heap_beginscan(catalogRelation, 0, NowTimeQual, 1, &entry);
|
||||
scan = heap_beginscan(catalogRelation, 0, false, 1, &entry);
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
@ -1415,7 +1415,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
||||
key[0].sk_argument = ObjectIdGetDatum(relid);
|
||||
|
||||
pg_class_scan =
|
||||
heap_beginscan(pg_class, 0, NowTimeQual, 1, key);
|
||||
heap_beginscan(pg_class, 0, false, 1, key);
|
||||
|
||||
if (!HeapScanIsValid(pg_class_scan))
|
||||
{
|
||||
@ -1611,7 +1611,7 @@ DefaultBuild(Relation heapRelation,
|
||||
*/
|
||||
scan = heap_beginscan(heapRelation, /* relation */
|
||||
0, /* start at end */
|
||||
NowTimeQual, /* time range */
|
||||
false, /* seeself */
|
||||
0, /* number of keys */
|
||||
(ScanKey) NULL); /* scan key */
|
||||
|
||||
@ -1825,7 +1825,7 @@ IndexIsUniqueNoCache(Oid indexId)
|
||||
(RegProcedure) ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(indexId));
|
||||
|
||||
scandesc = heap_beginscan(pg_index, 0, SelfTimeQual, 1, skey);
|
||||
scandesc = heap_beginscan(pg_index, 0, true, 1, skey);
|
||||
|
||||
tuple = heap_getnext(scandesc, 0, NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.15 1997/09/08 21:42:20 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.16 1997/11/20 23:20:47 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -242,7 +242,7 @@ CatalogIndexFetchTuple(Relation heapRelation,
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
}
|
||||
else
|
||||
@ -394,7 +394,7 @@ ProcedureNameIndexScan(Relation heapRelation,
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
if (HeapTupleIsValid(tuple))
|
||||
{
|
||||
@ -459,7 +459,7 @@ ProcedureSrcIndexScan(Relation heapRelation, text *procSrc)
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
}
|
||||
else
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.14 1997/09/18 20:20:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.15 1997/11/20 23:20:49 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* these routines moved here from commands/define.c and somewhat cleaned up.
|
||||
@ -116,7 +116,7 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc,
|
||||
*/
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
3,
|
||||
opKey);
|
||||
|
||||
@ -697,7 +697,7 @@ OperatorDef(char *operatorName,
|
||||
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
3,
|
||||
opKey);
|
||||
|
||||
@ -796,7 +796,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
1,
|
||||
opKey);
|
||||
|
||||
@ -886,7 +886,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
1,
|
||||
opKey);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.11 1997/09/18 20:20:19 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.12 1997/11/20 23:20:50 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -66,7 +66,7 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
|
||||
|
||||
scan = heap_beginscan(pg_type_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
1,
|
||||
typeKey);
|
||||
|
||||
@ -472,7 +472,7 @@ TypeCreate(char *typeName,
|
||||
typeKey[0].sk_argument = PointerGetDatum(typeName);
|
||||
pg_type_scan = heap_beginscan(pg_type_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
1,
|
||||
typeKey);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.23 1997/11/05 21:18:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.24 1997/11/20 23:20:56 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -206,7 +206,7 @@ Async_Notify(char *relname)
|
||||
lRel = heap_openr(ListenerRelationName);
|
||||
tdesc = RelationGetTupleDescriptor(lRel);
|
||||
RelationSetLockForWrite(lRel);
|
||||
sRel = heap_beginscan(lRel, 0, NowTimeQual, 1, &key);
|
||||
sRel = heap_beginscan(lRel, 0, false, 1, &key);
|
||||
|
||||
nulls[0] = nulls[1] = nulls[2] = ' ';
|
||||
repl[0] = repl[1] = repl[2] = ' ';
|
||||
@ -287,7 +287,7 @@ Async_NotifyAtCommit()
|
||||
Int32GetDatum(1));
|
||||
lRel = heap_openr(ListenerRelationName);
|
||||
RelationSetLockForWrite(lRel);
|
||||
sRel = heap_beginscan(lRel, 0, NowTimeQual, 1, &key);
|
||||
sRel = heap_beginscan(lRel, 0, false, 1, &key);
|
||||
tdesc = RelationGetTupleDescriptor(lRel);
|
||||
ourpid = getpid();
|
||||
|
||||
@ -441,7 +441,7 @@ Async_Listen(char *relname, int pid)
|
||||
|
||||
/* is someone already listening. One listener per relation */
|
||||
tdesc = RelationGetTupleDescriptor(lDesc);
|
||||
s = heap_beginscan(lDesc, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
s = heap_beginscan(lDesc, 0, false, 0, (ScanKey) NULL);
|
||||
while (HeapTupleIsValid(htup = heap_getnext(s, 0, &b)))
|
||||
{
|
||||
d = heap_getattr(htup, b, Anum_pg_listener_relname, tdesc,
|
||||
@ -599,7 +599,7 @@ Async_NotifyFrontEnd()
|
||||
lRel = heap_openr(ListenerRelationName);
|
||||
RelationSetLockForWrite(lRel);
|
||||
tdesc = RelationGetTupleDescriptor(lRel);
|
||||
sRel = heap_beginscan(lRel, 0, NowTimeQual, 2, key);
|
||||
sRel = heap_beginscan(lRel, 0, false, 2, key);
|
||||
|
||||
nulls[0] = nulls[1] = nulls[2] = ' ';
|
||||
repl[0] = repl[1] = repl[2] = ' ';
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.15 1997/09/08 02:21:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.16 1997/11/20 23:20:58 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -355,7 +355,7 @@ rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex)
|
||||
{
|
||||
|
||||
HeapTid = &ScanResult->heap_iptr;
|
||||
LocalHeapTuple = heap_fetch(LocalOldHeap, 0, HeapTid, &LocalBuffer);
|
||||
LocalHeapTuple = heap_fetch(LocalOldHeap, false, HeapTid, &LocalBuffer);
|
||||
OIDNewHeapInsert =
|
||||
heap_insert(LocalNewHeap, LocalHeapTuple);
|
||||
pfree(ScanResult);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.20 1997/10/27 08:55:16 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.21 1997/11/20 23:21:00 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||
@ -440,7 +440,7 @@ PerformAddAttribute(char *relationName,
|
||||
* XXX use syscache here as an optimization
|
||||
*/
|
||||
key[1].sk_argument = (Datum) colDef->colname;
|
||||
attsdesc = heap_beginscan(attrdesc, 0, NowTimeQual, 2, key);
|
||||
attsdesc = heap_beginscan(attrdesc, 0, false, 2, key);
|
||||
|
||||
|
||||
tup = heap_getnext(attsdesc, 0, (Buffer *) NULL);
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.34 1997/09/12 04:07:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.35 1997/11/20 23:21:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -224,7 +224,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
int32 ntuples;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
scandesc = heap_beginscan(rel, 0, NULL, 0, NULL);
|
||||
scandesc = heap_beginscan(rel, 0, false, 0, NULL);
|
||||
|
||||
attr_count = rel->rd_att->natts;
|
||||
attr = rel->rd_att->attrs;
|
||||
@ -921,7 +921,7 @@ GetIndexRelations(Oid main_relation_oid,
|
||||
bool isnull;
|
||||
|
||||
pg_index_rel = heap_openr(IndexRelationName);
|
||||
scandesc = heap_beginscan(pg_index_rel, 0, NULL, 0, NULL);
|
||||
scandesc = heap_beginscan(pg_index_rel, 0, false, 0, NULL);
|
||||
tupDesc = RelationGetTupleDescriptor(pg_index_rel);
|
||||
|
||||
*n_indices = 0;
|
||||
@ -1198,7 +1198,7 @@ CountTuples(Relation relation)
|
||||
|
||||
int i;
|
||||
|
||||
scandesc = heap_beginscan(relation, 0, NULL, 0, NULL);
|
||||
scandesc = heap_beginscan(relation, 0, false, 0, NULL);
|
||||
|
||||
for (tuple = heap_getnext(scandesc, 0, NULL), i = 0;
|
||||
tuple != NULL;
|
||||
|
@ -189,7 +189,7 @@ DropProceduralLanguage(DropPLangStmt * stmt)
|
||||
ScanKeyEntryInitialize(&scanKeyData, 0, Anum_pg_language_lanname,
|
||||
F_NAMEEQ, PointerGetDatum(languageName));
|
||||
|
||||
scanDesc = heap_beginscan(rdesc, 0, NowTimeQual, 1, &scanKeyData);
|
||||
scanDesc = heap_beginscan(rdesc, 0, false, 1, &scanKeyData);
|
||||
|
||||
tup = heap_getnext(scanDesc, 0, (Buffer *) NULL);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/purge.c,v 1.8 1997/09/08 02:22:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/purge.c,v 1.9 1997/11/20 23:21:08 momjian Exp $
|
||||
*
|
||||
* Note:
|
||||
* XXX There are many instances of int32 instead of ...Time. These
|
||||
@ -110,7 +110,7 @@ RelationPurge(char *relationName,
|
||||
key[0].sk_argument = PointerGetDatum(relationName);
|
||||
fmgr_info(key[0].sk_procedure, &key[0].sk_func, &key[0].sk_nargs);
|
||||
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 1, key);
|
||||
scan = heap_beginscan(relation, 0, false, 1, key);
|
||||
oldTuple = heap_getnext(scan, 0, &buffer);
|
||||
if (!HeapTupleIsValid(oldTuple))
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.10 1997/10/25 01:08:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.11 1997/11/20 23:21:10 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -804,8 +804,7 @@ tg_parseTeeNode(TgRecipe * r,
|
||||
tt,
|
||||
tt,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL));
|
||||
FALSE));
|
||||
rt_ind = length(orig->rtable);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.15 1997/09/18 20:20:24 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.16 1997/11/20 23:21:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -95,7 +95,7 @@ RemoveOperator(char *operatorName, /* operator name */
|
||||
ObjectIdGetDatum(typeId2));
|
||||
|
||||
relation = heap_openr(OperatorRelationName);
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 3, operatorKey);
|
||||
scan = heap_beginscan(relation, 0, false, 3, operatorKey);
|
||||
tup = heap_getnext(scan, 0, &buffer);
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
@ -163,7 +163,7 @@ SingleOpOperatorRemove(Oid typeOid)
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
key[0].sk_attno = attnums[i];
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 1, key);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 1, key);
|
||||
while (PointerIsValid(tup = heap_getnext(sdesc, 0, &buffer)))
|
||||
{
|
||||
ItemPointerCopy(&tup->t_ctid, &itemPointerData);
|
||||
@ -212,7 +212,7 @@ AttributeAndRelationRemove(Oid typeOid)
|
||||
oidptr->next = NULL;
|
||||
optr = oidptr;
|
||||
rdesc = heap_openr(AttributeRelationName);
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 1, key);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 1, key);
|
||||
while (PointerIsValid(tup = heap_getnext(sdesc, 0, &buffer)))
|
||||
{
|
||||
ItemPointerCopy(&tup->t_ctid, &itemPointerData);
|
||||
@ -233,7 +233,7 @@ AttributeAndRelationRemove(Oid typeOid)
|
||||
while (PointerIsValid((char *) optr->next))
|
||||
{
|
||||
key[0].sk_argument = (Datum) (optr++)->reloid;
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 1, key);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 1, key);
|
||||
tup = heap_getnext(sdesc, 0, &buffer);
|
||||
if (PointerIsValid(tup))
|
||||
{
|
||||
@ -283,7 +283,7 @@ RemoveType(char *typeName) /* type name to be removed */
|
||||
|
||||
typeKey[0].sk_argument = PointerGetDatum(typeName);
|
||||
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 1, typeKey);
|
||||
scan = heap_beginscan(relation, 0, false, 1, typeKey);
|
||||
tup = heap_getnext(scan, 0, (Buffer *) 0);
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
@ -301,7 +301,7 @@ RemoveType(char *typeName) /* type name to be removed */
|
||||
shadow_type = makeArrayTypeName(typeName);
|
||||
typeKey[0].sk_argument = NameGetDatum(shadow_type);
|
||||
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual,
|
||||
scan = heap_beginscan(relation, 0, false,
|
||||
1, (ScanKey) typeKey);
|
||||
tup = heap_getnext(scan, 0, (Buffer *) 0);
|
||||
|
||||
@ -389,7 +389,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
|
||||
fmgr_info(key[0].sk_procedure, &key[0].sk_func, &key[0].sk_nargs);
|
||||
|
||||
relation = heap_openr(ProcedureRelationName);
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 1, key);
|
||||
scan = heap_beginscan(relation, 0, false, 1, key);
|
||||
|
||||
do
|
||||
{ /* hope this is ok because it's indexed */
|
||||
@ -496,7 +496,7 @@ RemoveAggregate(char *aggName, char *aggType)
|
||||
ObjectIdGetDatum(basetypeID));
|
||||
|
||||
relation = heap_openr(AggregateRelationName);
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 2, aggregateKey);
|
||||
scan = heap_beginscan(relation, 0, false, 2, aggregateKey);
|
||||
tup = heap_getnext(scan, 0, (Buffer *) 0);
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
RelationSetLockForWrite(tgrel);
|
||||
ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid,
|
||||
ObjectIdEqualRegProcedure, rel->rd_id);
|
||||
tgscan = heap_beginscan(tgrel, 0, NowTimeQual, 1, &key);
|
||||
tgscan = heap_beginscan(tgrel, 0, false, 1, &key);
|
||||
while (tuple = heap_getnext(tgscan, 0, (Buffer *) NULL), PointerIsValid(tuple))
|
||||
{
|
||||
Form_pg_trigger pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple);
|
||||
@ -279,7 +279,7 @@ DropTrigger(DropTrigStmt * stmt)
|
||||
RelationSetLockForWrite(tgrel);
|
||||
ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid,
|
||||
ObjectIdEqualRegProcedure, rel->rd_id);
|
||||
tgscan = heap_beginscan(tgrel, 0, NowTimeQual, 1, &key);
|
||||
tgscan = heap_beginscan(tgrel, 0, false, 1, &key);
|
||||
while (tuple = heap_getnext(tgscan, 0, (Buffer *) NULL), PointerIsValid(tuple))
|
||||
{
|
||||
Form_pg_trigger pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple);
|
||||
@ -344,7 +344,7 @@ RelationRemoveTriggers(Relation rel)
|
||||
ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid,
|
||||
ObjectIdEqualRegProcedure, rel->rd_id);
|
||||
|
||||
tgscan = heap_beginscan(tgrel, 0, NowTimeQual, 1, &key);
|
||||
tgscan = heap_beginscan(tgrel, 0, false, 1, &key);
|
||||
|
||||
while (tup = heap_getnext(tgscan, 0, (Buffer *) NULL), PointerIsValid(tup))
|
||||
heap_delete(tgrel, &tup->t_ctid);
|
||||
@ -395,7 +395,7 @@ RelationBuildTriggers(Relation relation)
|
||||
break;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(tgrel, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(tgrel, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
continue;
|
||||
@ -859,7 +859,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
|
||||
}
|
||||
|
||||
HeapTupleSatisfies(lp, relation, b, dp,
|
||||
NowTimeQual, 0, (ScanKey) NULL, tuple);
|
||||
false, 0, (ScanKey) NULL, tuple);
|
||||
if (!tuple)
|
||||
{
|
||||
ReleaseBuffer(b);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.49 1997/11/02 15:25:07 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.50 1997/11/20 23:21:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -296,7 +296,7 @@ vc_getrels(NameData *VacRelP)
|
||||
pgclass = heap_openr(RelationRelationName);
|
||||
pgcdesc = RelationGetTupleDescriptor(pgclass);
|
||||
|
||||
pgcscan = heap_beginscan(pgclass, false, NowTimeQual, 1, &pgckey);
|
||||
pgcscan = heap_beginscan(pgclass, false, false, 1, &pgckey);
|
||||
|
||||
while (HeapTupleIsValid(pgctup = heap_getnext(pgcscan, 0, &buf)))
|
||||
{
|
||||
@ -429,7 +429,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
|
||||
|
||||
pgclass = heap_openr(RelationRelationName);
|
||||
pgcdesc = RelationGetTupleDescriptor(pgclass);
|
||||
pgcscan = heap_beginscan(pgclass, false, NowTimeQual, 1, &pgckey);
|
||||
pgcscan = heap_beginscan(pgclass, false, false, 1, &pgckey);
|
||||
|
||||
/*
|
||||
* Race condition -- if the pg_class tuple has gone away since the
|
||||
@ -1856,7 +1856,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst
|
||||
ObjectIdGetDatum(relid));
|
||||
|
||||
rd = heap_openr(RelationRelationName);
|
||||
rsdesc = heap_beginscan(rd, false, NowTimeQual, 1, &rskey);
|
||||
rsdesc = heap_beginscan(rd, false, false, 1, &rskey);
|
||||
|
||||
if (!HeapTupleIsValid(rtup = heap_getnext(rsdesc, 0, &rbuf)))
|
||||
elog(WARN, "pg_class entry for relid %d vanished during vacuuming",
|
||||
@ -1879,7 +1879,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst
|
||||
ScanKeyEntryInitialize(&askey, 0, Anum_pg_attribute_attrelid,
|
||||
F_INT4EQ, relid);
|
||||
|
||||
asdesc = heap_beginscan(ad, false, NowTimeQual, 1, &askey);
|
||||
asdesc = heap_beginscan(ad, false, false, 1, &askey);
|
||||
|
||||
while (HeapTupleIsValid(atup = heap_getnext(asdesc, 0, &abuf)))
|
||||
{
|
||||
@ -2027,10 +2027,10 @@ vc_delhilowstats(Oid relid, int attcnt, int *attnums)
|
||||
ScanKeyEntryInitialize(&pgskey, 0x0, Anum_pg_statistic_starelid,
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(relid));
|
||||
pgsscan = heap_beginscan(pgstatistic, false, NowTimeQual, 1, &pgskey);
|
||||
pgsscan = heap_beginscan(pgstatistic, false, false, 1, &pgskey);
|
||||
}
|
||||
else
|
||||
pgsscan = heap_beginscan(pgstatistic, false, NowTimeQual, 0, NULL);
|
||||
pgsscan = heap_beginscan(pgstatistic, false, false, 0, NULL);
|
||||
|
||||
while (HeapTupleIsValid(pgstup = heap_getnext(pgsscan, 0, NULL)))
|
||||
{
|
||||
@ -2284,7 +2284,7 @@ vc_getindices(Oid relid, int *nindices, Relation **Irel)
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(relid));
|
||||
|
||||
pgiscan = heap_beginscan(pgindex, false, NowTimeQual, 1, &pgikey);
|
||||
pgiscan = heap_beginscan(pgindex, false, false, 1, &pgikey);
|
||||
|
||||
while (HeapTupleIsValid(pgitup = heap_getnext(pgiscan, 0, NULL)))
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.13 1997/11/17 16:58:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.14 1997/11/20 23:21:18 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -236,10 +236,10 @@ UpdateRangeTableOfViewParse(char *viewName, Query *viewParse)
|
||||
*/
|
||||
rt_entry1 =
|
||||
addRangeTableEntry(NULL, (char *) viewName, "*CURRENT*",
|
||||
FALSE, FALSE, NULL);
|
||||
FALSE, FALSE);
|
||||
rt_entry2 =
|
||||
addRangeTableEntry(NULL, (char *) viewName, "*NEW*",
|
||||
FALSE, FALSE, NULL);
|
||||
FALSE, FALSE);
|
||||
new_rt = lcons(rt_entry2, old_rt);
|
||||
new_rt = lcons(rt_entry1, new_rt);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.8 1997/09/08 21:42:52 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.9 1997/11/20 23:21:22 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
static Pointer
|
||||
ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
|
||||
bool isindex, ScanDirection dir, TimeQual time_range);
|
||||
bool isindex, ScanDirection dir);
|
||||
static Relation ExecOpenR(Oid relationOid, bool isindex);
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
@ -70,7 +70,6 @@ ExecOpenScanR(Oid relOid,
|
||||
ScanKey skeys,
|
||||
bool isindex,
|
||||
ScanDirection dir,
|
||||
TimeQual timeRange,
|
||||
Relation *returnRelation, /* return */
|
||||
Pointer *returnScanDesc) /* return */
|
||||
{
|
||||
@ -89,8 +88,7 @@ ExecOpenScanR(Oid relOid,
|
||||
nkeys,
|
||||
skeys,
|
||||
isindex,
|
||||
dir,
|
||||
timeRange);
|
||||
dir);
|
||||
|
||||
if (returnRelation != NULL)
|
||||
*returnRelation = relation;
|
||||
@ -146,8 +144,7 @@ ExecBeginScan(Relation relation,
|
||||
int nkeys,
|
||||
ScanKey skeys,
|
||||
bool isindex,
|
||||
ScanDirection dir,
|
||||
TimeQual time_range)
|
||||
ScanDirection dir)
|
||||
{
|
||||
Pointer scanDesc;
|
||||
|
||||
@ -172,7 +169,7 @@ ExecBeginScan(Relation relation,
|
||||
{
|
||||
scanDesc = (Pointer) heap_beginscan(relation,
|
||||
ScanDirectionIsBackward(dir),
|
||||
time_range,
|
||||
false,
|
||||
nkeys,
|
||||
skeys);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.30 1997/11/17 16:41:04 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.31 1997/11/20 23:21:24 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1331,13 +1331,11 @@ ExecRelCheck(Relation rel, HeapTuple tuple)
|
||||
slot->ttc_buffer = InvalidBuffer;
|
||||
slot->ttc_whichplan = -1;
|
||||
rte->relname = nameout(&(rel->rd_rel->relname));
|
||||
rte->timeRange = NULL;
|
||||
rte->refname = rte->relname;
|
||||
rte->relid = rel->rd_id;
|
||||
rte->inh = false;
|
||||
rte->archive = false;
|
||||
rte->inFromCl = true;
|
||||
rte->timeQual = NULL;
|
||||
rtlist = lcons(rte, NIL);
|
||||
econtext->ecxt_scantuple = slot; /* scan tuple slot */
|
||||
econtext->ecxt_innertuple = NULL; /* inner tuple slot */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.20 1997/10/25 01:09:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.21 1997/11/20 23:21:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -756,7 +756,7 @@ ExecOpenIndices(Oid resultRelationOid,
|
||||
*/
|
||||
indexSd = heap_beginscan(indexRd, /* scan desc */
|
||||
false, /* scan backward flag */
|
||||
NowTimeQual, /* time qual */
|
||||
false, /* see self */
|
||||
1, /* number scan keys */
|
||||
&key); /* scan keys */
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.10 1997/09/08 21:43:13 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.11 1997/11/20 23:21:28 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -128,7 +128,7 @@ IndexNext(IndexScan *node)
|
||||
{
|
||||
iptr = &result->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation,
|
||||
NowTimeQual,
|
||||
false,
|
||||
iptr,
|
||||
&buffer);
|
||||
/* be tidy */
|
||||
@ -480,7 +480,6 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
|
||||
RangeTblEntry *rtentry;
|
||||
Index relid;
|
||||
Oid reloid;
|
||||
TimeQual timeQual;
|
||||
|
||||
Relation currentRelation;
|
||||
HeapScanDesc currentScanDesc;
|
||||
@ -911,14 +910,12 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
|
||||
relid = node->scan.scanrelid;
|
||||
rtentry = rt_fetch(relid, rangeTable);
|
||||
reloid = rtentry->relid;
|
||||
timeQual = rtentry->timeQual;
|
||||
|
||||
ExecOpenScanR(reloid, /* relation */
|
||||
0, /* nkeys */
|
||||
(ScanKey) NULL, /* scan key */
|
||||
0, /* is index */
|
||||
direction, /* scan direction */
|
||||
timeQual, /* time qual */
|
||||
¤tRelation, /* return: rel desc */
|
||||
(Pointer *) ¤tScanDesc); /* return: scan desc */
|
||||
|
||||
@ -957,7 +954,6 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
|
||||
scanKeys[i], /* scan key */
|
||||
true, /* is index */
|
||||
direction, /* scan direction */
|
||||
timeQual, /* time qual */
|
||||
&(relationDescs[i]), /* return: rel desc */
|
||||
(Pointer *) &(scanDescs[i]));
|
||||
/* return: scan desc */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.9 1997/09/08 21:43:14 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.10 1997/11/20 23:21:32 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -140,7 +140,7 @@ ExecMaterial(Material *node)
|
||||
currentScanDesc = heap_beginscan(currentRelation, /* relation */
|
||||
ScanDirectionIsBackward(dir),
|
||||
/* bkwd flag */
|
||||
NowTimeQual, /* time qual */
|
||||
false, /* seeself */
|
||||
0, /* num scan keys */
|
||||
NULL); /* scan keys */
|
||||
matstate->csstate.css_currentRelation = currentRelation;
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.7 1997/09/08 21:43:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.8 1997/11/20 23:21:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -158,7 +158,6 @@ InitScanRelation(SeqScan *node, EState *estate,
|
||||
List *rangeTable;
|
||||
RangeTblEntry *rtentry;
|
||||
Oid reloid;
|
||||
TimeQual timeQual;
|
||||
ScanDirection direction;
|
||||
Relation currentRelation;
|
||||
HeapScanDesc currentScanDesc;
|
||||
@ -179,7 +178,6 @@ InitScanRelation(SeqScan *node, EState *estate,
|
||||
rangeTable = estate->es_range_table;
|
||||
rtentry = rt_fetch(relid, rangeTable);
|
||||
reloid = rtentry->relid;
|
||||
timeQual = rtentry->timeQual;
|
||||
direction = estate->es_direction;
|
||||
resultRelationInfo = estate->es_result_relation_info;
|
||||
|
||||
@ -188,7 +186,6 @@ InitScanRelation(SeqScan *node, EState *estate,
|
||||
NULL, /* scan key */
|
||||
0, /* is index */
|
||||
direction,/* scan direction */
|
||||
timeQual, /* time qual */
|
||||
¤tRelation, /* return: rel desc */
|
||||
(Pointer *) ¤tScanDesc); /* return: scan desc */
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* ExecEndTee
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.9 1997/09/08 21:43:20 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.10 1997/11/20 23:21:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -252,7 +252,7 @@ initTeeScanDescs(Tee *node)
|
||||
{
|
||||
teeState->tee_leftScanDesc = heap_beginscan(bufferRel,
|
||||
ScanDirectionIsBackward(dir),
|
||||
NowTimeQual, /* time qual */
|
||||
false, /* seeself */
|
||||
0, /* num scan keys */
|
||||
NULL /* scan keys */
|
||||
);
|
||||
@ -261,7 +261,7 @@ initTeeScanDescs(Tee *node)
|
||||
{
|
||||
teeState->tee_rightScanDesc = heap_beginscan(bufferRel,
|
||||
ScanDirectionIsBackward(dir),
|
||||
NowTimeQual, /* time qual */
|
||||
false, /* seeself */
|
||||
0, /* num scan keys */
|
||||
NULL /* scan keys */
|
||||
);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.14 1997/11/02 15:25:11 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.15 1997/11/20 23:21:40 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1470,8 +1470,6 @@ _copyRangeTblEntry(RangeTblEntry *from)
|
||||
newnode->relname = pstrdup(from->relname);
|
||||
if (from->refname)
|
||||
newnode->refname = pstrdup(from->refname);
|
||||
newnode->timeRange = NULL;
|
||||
newnode->timeQual = NULL;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.11 1997/09/08 21:44:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.12 1997/11/20 23:21:47 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -998,7 +998,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
|
||||
* will be used to find the associated strategy numbers for the test.
|
||||
* --Nels, Jan '93
|
||||
*/
|
||||
scan = heap_beginscan(relation, false, NowTimeQual, 2, entry);
|
||||
scan = heap_beginscan(relation, false, false, 2, entry);
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
@ -1029,7 +1029,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(clause_op));
|
||||
|
||||
scan = heap_beginscan(relation, false, NowTimeQual, 3, entry);
|
||||
scan = heap_beginscan(relation, false, false, 3, entry);
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
@ -1061,7 +1061,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
|
||||
Integer16EqualRegProcedure,
|
||||
Int16GetDatum(test_strategy));
|
||||
|
||||
scan = heap_beginscan(relation, false, NowTimeQual, 3, entry);
|
||||
scan = heap_beginscan(relation, false, false, 3, entry);
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
|
@ -1,69 +0,0 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* archive.c--
|
||||
* Support for planning scans on archived relations
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Attic/archive.c,v 1.4 1997/09/08 21:45:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include <stdio.h> /* for sprintf() */
|
||||
#include <sys/types.h> /* for u_int in relcache.h */
|
||||
#include "postgres.h"
|
||||
|
||||
#include "utils/rel.h"
|
||||
#include "utils/elog.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "catalog/pg_class.h"
|
||||
#include "nodes/pg_list.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "optimizer/prep.h"
|
||||
#include "commands/creatinh.h"
|
||||
|
||||
void
|
||||
plan_archive(List *rt)
|
||||
{
|
||||
List *rtitem;
|
||||
RangeTblEntry *rte;
|
||||
TimeRange *trange;
|
||||
Relation r;
|
||||
Oid reloid;
|
||||
|
||||
foreach(rtitem, rt)
|
||||
{
|
||||
rte = lfirst(rtitem);
|
||||
trange = rte->timeRange;
|
||||
if (trange)
|
||||
{
|
||||
reloid = rte->relid;
|
||||
r = RelationIdGetRelation(reloid);
|
||||
if (r->rd_rel->relarch != 'n')
|
||||
{
|
||||
rte->archive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* find_archive_rels -- Given a particular relid, find the archive
|
||||
* relation's relid.
|
||||
*/
|
||||
List *
|
||||
find_archive_rels(Oid relid)
|
||||
{
|
||||
Relation arel;
|
||||
char *arelName;
|
||||
|
||||
arelName = MakeArchiveName(relid);
|
||||
arel = RelationNameGetRelation(arelName);
|
||||
pfree(arelName);
|
||||
|
||||
return lconsi(arel->rd_id, lconsi(relid, NIL));
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.6 1997/09/08 21:45:37 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.7 1997/11/20 23:21:57 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -178,10 +178,6 @@ plan_union_queries(Index rt_index,
|
||||
union_relids = VersionGetParents(rt_entry->relid);
|
||||
break;
|
||||
|
||||
case ARCHIVE_FLAG:
|
||||
union_relids = find_archive_rels(rt_entry->relid);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.10 1997/09/18 20:20:50 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.11 1997/11/20 23:22:01 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -148,7 +148,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
|
||||
ObjectIdGetDatum(indrelid));
|
||||
|
||||
relation = heap_openr(IndexRelationName);
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual,
|
||||
scan = heap_beginscan(relation, 0, false,
|
||||
1, &indexKey);
|
||||
}
|
||||
if (!HeapScanIsValid(scan))
|
||||
@ -420,7 +420,7 @@ find_inheritance_children(Oid inhparent)
|
||||
|
||||
key[0].sk_argument = ObjectIdGetDatum((Oid) inhparent);
|
||||
relation = heap_openr(InheritsRelationName);
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 1, key);
|
||||
scan = heap_beginscan(relation, 0, false, 1, key);
|
||||
while (HeapTupleIsValid(inheritsTuple =
|
||||
heap_getnext(scan, 0,
|
||||
(Buffer *) NULL)))
|
||||
@ -455,7 +455,7 @@ VersionGetParents(Oid verrelid)
|
||||
fmgr_info(F_OIDEQ, &key[0].sk_func, &key[0].sk_nargs);
|
||||
relation = heap_openr(VersionRelationName);
|
||||
key[0].sk_argument = ObjectIdGetDatum(verrelid);
|
||||
scan = heap_beginscan(relation, 0, NowTimeQual, 1, key);
|
||||
scan = heap_beginscan(relation, 0, false, 1, key);
|
||||
for (;;)
|
||||
{
|
||||
versionTuple = heap_getnext(scan, 0,
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Makefile for parser
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.9 1997/11/14 15:48:19 thomas Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.10 1997/11/20 23:22:05 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -23,7 +23,7 @@ endif
|
||||
|
||||
|
||||
OBJS= analyze.o catalog_utils.o dbcommands.o gram.o \
|
||||
keywords.o parser.o parse_query.o scan.o scansup.o sysfunc.o
|
||||
keywords.o parser.o parse_query.o scan.o scansup.o
|
||||
|
||||
all: SUBSYS.o
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.48 1997/10/30 16:34:22 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.49 1997/11/20 23:22:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -21,6 +21,7 @@
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "parse.h" /* for AND, OR, etc. */
|
||||
#include "catalog/pg_aggregate.h"
|
||||
#include "catalog/pg_type.h" /* for INT4OID, etc. */
|
||||
#include "catalog/pg_proc.h"
|
||||
#include "utils/elog.h"
|
||||
@ -66,33 +67,31 @@ static List *expandAllTables(ParseState *pstate);
|
||||
static char *figureColname(Node *expr, Node *resval);
|
||||
static List *makeTargetNames(ParseState *pstate, List *cols);
|
||||
static List *transformTargetList(ParseState *pstate, List *targetlist);
|
||||
static TargetEntry *
|
||||
make_targetlist_expr(ParseState *pstate,
|
||||
static TargetEntry *make_targetlist_expr(ParseState *pstate,
|
||||
char *colname, Node *expr,
|
||||
List *arrayRef);
|
||||
static bool inWhereClause = false;
|
||||
static Node *transformWhereClause(ParseState *pstate, Node *a_expr);
|
||||
static List *
|
||||
transformGroupClause(ParseState *pstate, List *grouplist,
|
||||
static List *transformGroupClause(ParseState *pstate, List *grouplist,
|
||||
List *targetlist);
|
||||
static List *
|
||||
transformSortClause(ParseState *pstate,
|
||||
static List *transformSortClause(ParseState *pstate,
|
||||
List *orderlist, List *targetlist,
|
||||
char *uniqueFlag);
|
||||
|
||||
static void parseFromClause(ParseState *pstate, List *frmList);
|
||||
static Node *
|
||||
ParseFunc(ParseState *pstate, char *funcname,
|
||||
static Node *ParseFunc(ParseState *pstate, char *funcname,
|
||||
List *fargs, int *curr_resno);
|
||||
static List *setup_tlist(char *attname, Oid relid);
|
||||
static List *setup_base_tlist(Oid typeid);
|
||||
static void
|
||||
make_arguments(int nargs, List *fargs, Oid *input_typeids,
|
||||
static void make_arguments(int nargs, List *fargs, Oid *input_typeids,
|
||||
Oid *function_typeids);
|
||||
static void AddAggToParseState(ParseState *pstate, Aggreg *aggreg);
|
||||
static void finalizeAggregates(ParseState *pstate, Query *qry);
|
||||
static void parseCheckAggregates(ParseState *pstate, Query *qry);
|
||||
static ParseState *makeParseState(void);
|
||||
static Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
|
||||
static Node *parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen);
|
||||
static Aggreg *ParseAgg(char *aggname, Oid basetype, Node *target);
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@ -464,9 +463,9 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt)
|
||||
* equal to 2.
|
||||
*/
|
||||
addRangeTableEntry(pstate, stmt->object->relname, "*CURRENT*",
|
||||
FALSE, FALSE, NULL);
|
||||
FALSE, FALSE);
|
||||
addRangeTableEntry(pstate, stmt->object->relname, "*NEW*",
|
||||
FALSE, FALSE, NULL);
|
||||
FALSE, FALSE);
|
||||
|
||||
pstate->p_last_resno = 1;
|
||||
pstate->p_is_rule = true; /* for expand all */
|
||||
@ -947,8 +946,7 @@ parseFromClause(ParseState *pstate, List *frmList)
|
||||
* eg. select * from foo f where f.x = 1; will generate wrong answer
|
||||
* if we expand * to foo.x.
|
||||
*/
|
||||
rte = addRangeTableEntry(pstate, relname, refname, baserel->inh, TRUE,
|
||||
baserel->timeRange);
|
||||
rte = addRangeTableEntry(pstate, relname, refname, baserel->inh, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -968,7 +966,7 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList)
|
||||
return;
|
||||
|
||||
if (refnameRangeTablePosn(pstate->p_rtable, relname) < 1)
|
||||
rte = addRangeTableEntry(pstate, relname, relname, FALSE, FALSE, NULL);
|
||||
rte = addRangeTableEntry(pstate, relname, relname, FALSE, FALSE);
|
||||
else
|
||||
rte = refnameRangeTableEntry(pstate->p_rtable, relname);
|
||||
|
||||
@ -2321,7 +2319,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
|
||||
|
||||
rte = refnameRangeTableEntry(pstate->p_rtable, refname);
|
||||
if (rte == NULL)
|
||||
rte = addRangeTableEntry(pstate, refname, refname, FALSE, FALSE, NULL);
|
||||
rte = addRangeTableEntry(pstate, refname, refname, FALSE, FALSE);
|
||||
|
||||
relname = rte->relname;
|
||||
relid = rte->relid;
|
||||
@ -2443,7 +2441,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
|
||||
rte = refnameRangeTableEntry(pstate->p_rtable, refname);
|
||||
if (rte == NULL)
|
||||
rte = addRangeTableEntry(pstate, refname, refname,
|
||||
FALSE, FALSE, NULL);
|
||||
FALSE, FALSE);
|
||||
relname = rte->relname;
|
||||
|
||||
vnum = refnameRangeTablePosn(pstate->p_rtable, rte->refname);
|
||||
@ -2862,3 +2860,340 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
/* not used
|
||||
#define PSIZE(PTR) (*((int32 *)(PTR) - 1))
|
||||
*/
|
||||
|
||||
static Node *
|
||||
parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
{
|
||||
/* check for passing non-ints */
|
||||
Const *adt;
|
||||
Datum lcp;
|
||||
Type tp;
|
||||
char type_string[NAMEDATALEN];
|
||||
int32 len;
|
||||
char *cp = NULL;
|
||||
char *const_string = NULL;
|
||||
bool string_palloced = false;
|
||||
|
||||
switch (nodeTag(expr))
|
||||
{
|
||||
case T_String:
|
||||
const_string = DatumGetPointer(expr->val.str);
|
||||
break;
|
||||
case T_Integer:
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%ld", expr->val.ival);
|
||||
break;
|
||||
default:
|
||||
elog(WARN,
|
||||
"parser_typecast: cannot cast this expression to type \"%s\"",
|
||||
typename->name);
|
||||
}
|
||||
|
||||
if (typename->arrayBounds != NIL)
|
||||
{
|
||||
sprintf(type_string, "_%s", typename->name);
|
||||
tp = (Type) type(type_string);
|
||||
}
|
||||
else
|
||||
{
|
||||
tp = (Type) type(typename->name);
|
||||
}
|
||||
|
||||
len = tlen(tp);
|
||||
|
||||
#if 0 /* fix me */
|
||||
switch (CInteger(lfirst(expr)))
|
||||
{
|
||||
case INT4OID: /* int4 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%d", ((Const *) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case NAMEOID: /* char16 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%s", ((Const *) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case CHAROID: /* char */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%c", ((Const) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case FLOAT8OID: /* float8 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%f", ((Const) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case CASHOID: /* money */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%d",
|
||||
(int) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
|
||||
case TEXTOID: /* text */
|
||||
const_string = DatumGetPointer(((Const) lnext(expr))->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
|
||||
case UNKNOWNOID: /* unknown */
|
||||
const_string = DatumGetPointer(((Const) lnext(expr))->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "unknown type %d", CInteger(lfirst(expr)));
|
||||
}
|
||||
#endif
|
||||
|
||||
cp = instr2(tp, const_string, typlen);
|
||||
|
||||
if (!tbyvalue(tp))
|
||||
{
|
||||
/*
|
||||
if (len >= 0 && len != PSIZE(cp)) {
|
||||
char *pp;
|
||||
pp = (char *) palloc(len);
|
||||
memmove(pp, cp, len);
|
||||
cp = pp;
|
||||
}
|
||||
*/
|
||||
lcp = PointerGetDatum(cp);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (len)
|
||||
{
|
||||
case 1:
|
||||
lcp = Int8GetDatum(cp);
|
||||
break;
|
||||
case 2:
|
||||
lcp = Int16GetDatum(cp);
|
||||
break;
|
||||
case 4:
|
||||
lcp = Int32GetDatum(cp);
|
||||
break;
|
||||
default:
|
||||
lcp = PointerGetDatum(cp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
adt = makeConst(typeid(tp),
|
||||
len,
|
||||
(Datum) lcp,
|
||||
false,
|
||||
tbyvalue(tp),
|
||||
false, /* not a set */
|
||||
true /* is cast */ );
|
||||
|
||||
if (string_palloced)
|
||||
pfree(const_string);
|
||||
|
||||
return (Node *) adt;
|
||||
}
|
||||
|
||||
static Node *
|
||||
parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
|
||||
{
|
||||
/* check for passing non-ints */
|
||||
Const *adt;
|
||||
Datum lcp;
|
||||
int32 len = tlen(tp);
|
||||
char *cp = NULL;
|
||||
|
||||
char *const_string = NULL;
|
||||
bool string_palloced = false;
|
||||
|
||||
Assert(IsA(expr, Const));
|
||||
|
||||
switch (exprType)
|
||||
{
|
||||
case 0: /* NULL */
|
||||
break;
|
||||
case INT4OID: /* int4 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%d",
|
||||
(int) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case NAMEOID: /* char16 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%s",
|
||||
(char *) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case CHAROID: /* char */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%c",
|
||||
(char) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case FLOAT4OID: /* float4 */
|
||||
{
|
||||
float32 floatVal =
|
||||
DatumGetFloat32(((Const *) expr)->constvalue);
|
||||
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%f", *floatVal);
|
||||
break;
|
||||
}
|
||||
case FLOAT8OID: /* float8 */
|
||||
{
|
||||
float64 floatVal =
|
||||
DatumGetFloat64(((Const *) expr)->constvalue);
|
||||
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%f", *floatVal);
|
||||
break;
|
||||
}
|
||||
case CASHOID: /* money */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%ld",
|
||||
(long) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case TEXTOID: /* text */
|
||||
const_string =
|
||||
DatumGetPointer(((Const *) expr)->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
case UNKNOWNOID: /* unknown */
|
||||
const_string =
|
||||
DatumGetPointer(((Const *) expr)->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "unknown type %u ", exprType);
|
||||
}
|
||||
|
||||
if (!exprType)
|
||||
{
|
||||
adt = makeConst(typeid(tp),
|
||||
(Size) 0,
|
||||
(Datum) NULL,
|
||||
true, /* isnull */
|
||||
false, /* was omitted */
|
||||
false, /* not a set */
|
||||
true /* is cast */ );
|
||||
return ((Node *) adt);
|
||||
}
|
||||
|
||||
cp = instr2(tp, const_string, typlen);
|
||||
|
||||
|
||||
if (!tbyvalue(tp))
|
||||
{
|
||||
/*
|
||||
if (len >= 0 && len != PSIZE(cp)) {
|
||||
char *pp;
|
||||
pp = (char *) palloc(len);
|
||||
memmove(pp, cp, len);
|
||||
cp = pp;
|
||||
}
|
||||
*/
|
||||
lcp = PointerGetDatum(cp);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (len)
|
||||
{
|
||||
case 1:
|
||||
lcp = Int8GetDatum(cp);
|
||||
break;
|
||||
case 2:
|
||||
lcp = Int16GetDatum(cp);
|
||||
break;
|
||||
case 4:
|
||||
lcp = Int32GetDatum(cp);
|
||||
break;
|
||||
default:
|
||||
lcp = PointerGetDatum(cp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
adt = makeConst(typeid(tp),
|
||||
(Size) len,
|
||||
(Datum) lcp,
|
||||
false,
|
||||
false, /* was omitted */
|
||||
false, /* not a set */
|
||||
true /* is cast */ );
|
||||
|
||||
/*
|
||||
* printf("adt %s : %u %d %d\n",CString(expr),typeid(tp) , len,cp);
|
||||
*/
|
||||
if (string_palloced)
|
||||
pfree(const_string);
|
||||
|
||||
return ((Node *) adt);
|
||||
}
|
||||
|
||||
static Aggreg *
|
||||
ParseAgg(char *aggname, Oid basetype, Node *target)
|
||||
{
|
||||
Oid fintype;
|
||||
Oid vartype;
|
||||
Oid xfn1;
|
||||
Form_pg_aggregate aggform;
|
||||
Aggreg *aggreg;
|
||||
HeapTuple theAggTuple;
|
||||
|
||||
theAggTuple = SearchSysCacheTuple(AGGNAME, PointerGetDatum(aggname),
|
||||
ObjectIdGetDatum(basetype),
|
||||
0, 0);
|
||||
if (!HeapTupleIsValid(theAggTuple))
|
||||
{
|
||||
elog(WARN, "aggregate %s does not exist", aggname);
|
||||
}
|
||||
|
||||
aggform = (Form_pg_aggregate) GETSTRUCT(theAggTuple);
|
||||
fintype = aggform->aggfinaltype;
|
||||
xfn1 = aggform->aggtransfn1;
|
||||
|
||||
if (nodeTag(target) != T_Var && nodeTag(target) != T_Expr)
|
||||
elog(WARN, "parser: aggregate can only be applied on an attribute or expression");
|
||||
|
||||
/* only aggregates with transfn1 need a base type */
|
||||
if (OidIsValid(xfn1))
|
||||
{
|
||||
basetype = aggform->aggbasetype;
|
||||
if (nodeTag(target) == T_Var)
|
||||
vartype = ((Var *) target)->vartype;
|
||||
else
|
||||
vartype = ((Expr *) target)->typeOid;
|
||||
|
||||
if (basetype != vartype)
|
||||
{
|
||||
Type tp1,
|
||||
tp2;
|
||||
|
||||
tp1 = get_id_type(basetype);
|
||||
tp2 = get_id_type(vartype);
|
||||
elog(NOTICE, "Aggregate type mismatch:");
|
||||
elog(WARN, "%s works on %s, not %s", aggname,
|
||||
tname(tp1), tname(tp2));
|
||||
}
|
||||
}
|
||||
|
||||
aggreg = makeNode(Aggreg);
|
||||
aggreg->aggname = pstrdup(aggname);
|
||||
aggreg->basetype = aggform->aggbasetype;
|
||||
aggreg->aggtype = fintype;
|
||||
|
||||
aggreg->target = target;
|
||||
|
||||
return aggreg;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.29 1997/11/02 15:25:19 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.30 1997/11/20 23:22:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -347,7 +347,7 @@ binary_oper_get_candidates(char *opname,
|
||||
pg_operator_desc = heap_openr(OperatorRelationName);
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
nkeys,
|
||||
opKey);
|
||||
|
||||
@ -642,7 +642,7 @@ unary_oper_get_candidates(char *op,
|
||||
pg_operator_desc = heap_openr(OperatorRelationName);
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
2,
|
||||
opKey);
|
||||
|
||||
@ -1004,7 +1004,7 @@ func_get_candidates(char *funcname, int nargs)
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
if (HeapTupleIsValid(tuple))
|
||||
{
|
||||
@ -1352,7 +1352,7 @@ findsupers(Oid relid, Oid **supervec)
|
||||
ObjectIdEqualRegProcedure,
|
||||
ObjectIdGetDatum(relid));
|
||||
|
||||
inhscan = heap_beginscan(inhrel, 0, NowTimeQual, 1, &skey);
|
||||
inhscan = heap_beginscan(inhrel, 0, false, 1, &skey);
|
||||
|
||||
while (HeapTupleIsValid(inhtup = heap_getnext(inhscan, 0, &buf)))
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.11 1997/11/10 15:17:44 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.12 1997/11/20 23:22:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -159,7 +159,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel)
|
||||
ScanKeyEntryInitialize(&scanKey, 0, Anum_pg_database_datname,
|
||||
NameEqualRegProcedure, NameGetDatum(dbname));
|
||||
|
||||
scan = heap_beginscan(dbrel, 0, NowTimeQual, 1, &scanKey);
|
||||
scan = heap_beginscan(dbrel, 0, false, 1, &scanKey);
|
||||
if (!HeapScanIsValid(scan))
|
||||
elog(WARN, "%s: cannot begin scan of pg_database.", command);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.68 1997/11/17 16:37:24 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.69 1997/11/20 23:22:19 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@ -95,7 +95,6 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr);
|
||||
IndexElem *ielem;
|
||||
RangeVar *range;
|
||||
RelExpr *relexp;
|
||||
TimeRange *trange;
|
||||
A_Indices *aind;
|
||||
ResTarget *target;
|
||||
ParamNo *paramno;
|
||||
@ -134,8 +133,7 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr);
|
||||
|
||||
%type <str> opt_id, opt_portal_name,
|
||||
before_clause, after_clause, all_Op, MathOp, opt_name, opt_unique,
|
||||
result, OptUseOp, opt_class, opt_range_start, opt_range_end,
|
||||
SpecialRuleRelation
|
||||
result, OptUseOp, opt_class, SpecialRuleRelation
|
||||
|
||||
%type <str> privileges, operation_commalist, grantee
|
||||
%type <chr> operation, TriggerOneEvent
|
||||
@ -190,7 +188,6 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr);
|
||||
%type <ielem> index_elem, func_index
|
||||
%type <range> from_val
|
||||
%type <relexp> relation_expr
|
||||
%type <trange> time_range
|
||||
%type <target> res_target_el, res_target_el2
|
||||
%type <paramno> ParamNo
|
||||
|
||||
@ -2353,7 +2350,6 @@ relation_expr: relation_name
|
||||
$$ = makeNode(RelExpr);
|
||||
$$->relname = $1;
|
||||
$$->inh = FALSE;
|
||||
$$->timeRange = NULL;
|
||||
}
|
||||
| relation_name '*' %prec '='
|
||||
{
|
||||
@ -2361,44 +2357,7 @@ relation_expr: relation_name
|
||||
$$ = makeNode(RelExpr);
|
||||
$$->relname = $1;
|
||||
$$->inh = TRUE;
|
||||
$$->timeRange = NULL;
|
||||
}
|
||||
| relation_name time_range
|
||||
{
|
||||
/* time-qualified query */
|
||||
$$ = makeNode(RelExpr);
|
||||
$$->relname = $1;
|
||||
$$->inh = FALSE;
|
||||
$$->timeRange = $2;
|
||||
}
|
||||
;
|
||||
|
||||
/* Time travel
|
||||
* Range specification clause.
|
||||
*/
|
||||
time_range: '[' opt_range_start ',' opt_range_end ']'
|
||||
{
|
||||
$$ = makeNode(TimeRange);
|
||||
$$->startDate = $2;
|
||||
$$->endDate = $4;
|
||||
elog (WARN, "time travel is no longer available");
|
||||
}
|
||||
| '[' date ']'
|
||||
{
|
||||
$$ = makeNode(TimeRange);
|
||||
$$->startDate = $2;
|
||||
$$->endDate = NULL;
|
||||
elog (WARN, "time travel is no longer available");
|
||||
}
|
||||
;
|
||||
|
||||
opt_range_start: date
|
||||
| /*EMPTY*/ { $$ = "epoch"; }
|
||||
;
|
||||
|
||||
opt_range_end: date
|
||||
| /*EMPTY*/ { $$ = "now"; }
|
||||
;
|
||||
|
||||
opt_array_bounds: '[' ']' nest_array_bounds
|
||||
{ $$ = lcons(makeInteger(-1), $3); }
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.22 1997/11/02 15:25:30 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.23 1997/11/20 23:22:22 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -127,8 +127,8 @@ RangeTblEntry *
|
||||
addRangeTableEntry(ParseState *pstate,
|
||||
char *relname,
|
||||
char *refname,
|
||||
bool inh, bool inFromCl,
|
||||
TimeRange *timeRange)
|
||||
bool inh,
|
||||
bool inFromCl)
|
||||
{
|
||||
Relation relation;
|
||||
RangeTblEntry *rte = makeNode(RangeTblEntry);
|
||||
@ -154,8 +154,6 @@ addRangeTableEntry(ParseState *pstate,
|
||||
*/
|
||||
rte->inh = inh;
|
||||
|
||||
rte->timeRange = timeRange;
|
||||
|
||||
/* RelOID */
|
||||
rte->relid = RelationGetRelationId(relation);
|
||||
|
||||
@ -194,7 +192,7 @@ expandAll(ParseState *pstate, char *relname, char *refname, int *this_resno)
|
||||
|
||||
rte = refnameRangeTableEntry(pstate->p_rtable, refname);
|
||||
if (rte == NULL)
|
||||
rte = addRangeTableEntry(pstate, relname, refname, FALSE, FALSE, NULL);
|
||||
rte = addRangeTableEntry(pstate, relname, refname, FALSE, FALSE);
|
||||
|
||||
rdesc = heap_open(rte->relid);
|
||||
|
||||
@ -475,7 +473,7 @@ make_var(ParseState *pstate, char *refname, char *attrname, Oid *type_id)
|
||||
|
||||
rte = refnameRangeTableEntry(pstate->p_rtable, refname);
|
||||
if (rte == NULL)
|
||||
rte = addRangeTableEntry(pstate, refname, refname, FALSE, FALSE, NULL);
|
||||
rte = addRangeTableEntry(pstate, refname, refname, FALSE, FALSE);
|
||||
|
||||
vnum = refnameRangeTablePosn(pstate->p_rtable, refname);
|
||||
|
||||
|
@ -6,45 +6,20 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.27 1997/11/17 16:59:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.28 1997/11/20 23:22:24 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/param.h> /* for MAXPATHLEN */
|
||||
|
||||
#include "postgres.h"
|
||||
#include "parser/catalog_utils.h"
|
||||
#include "parser/gramparse.h"
|
||||
#include "parser/parse_query.h"
|
||||
#include "nodes/pg_list.h"
|
||||
#include "nodes/execnodes.h"
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "nodes/primnodes.h"
|
||||
#include "nodes/plannodes.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/exc.h"
|
||||
#include "utils/excid.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "catalog/pg_aggregate.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "access/heapam.h"
|
||||
#include "optimizer/clauses.h"
|
||||
|
||||
void init_io(); /* from scan.l */
|
||||
void parser_init(Oid *typev, int nargs); /* from gram.y */
|
||||
int yyparse(); /* from gram.c */
|
||||
|
||||
char *parseString; /* the char* which holds the string to be
|
||||
* parsed */
|
||||
char *parseCh; /* a pointer used during parsing to walk
|
||||
* down ParseString */
|
||||
|
||||
List *parsetree = NIL;
|
||||
|
||||
#ifdef SETS_FIXED
|
||||
@ -70,9 +45,7 @@ parser(char *str, Oid *typev, int nargs)
|
||||
|
||||
init_io();
|
||||
|
||||
/* Set things up to read from the string, if there is one */
|
||||
parseString = (char *) palloc(strlen(str) + 1);
|
||||
memmove(parseString, str, strlen(str) + 1);
|
||||
parseString = pstrdup(str);
|
||||
|
||||
parser_init(typev, nargs);
|
||||
yyresult = yyparse();
|
||||
@ -83,10 +56,8 @@ parser(char *str, Oid *typev, int nargs)
|
||||
|
||||
clearerr(stdin);
|
||||
|
||||
if (yyresult)
|
||||
{ /* error */
|
||||
if (yyresult) /* error */
|
||||
return ((QueryTreeList *) NULL);
|
||||
}
|
||||
|
||||
queryList = parse_analyze(parsetree);
|
||||
|
||||
@ -205,339 +176,3 @@ define_sets(Node *clause)
|
||||
|
||||
#endif
|
||||
|
||||
/* not used
|
||||
#define PSIZE(PTR) (*((int32 *)(PTR) - 1))
|
||||
*/
|
||||
|
||||
Node *
|
||||
parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
{
|
||||
/* check for passing non-ints */
|
||||
Const *adt;
|
||||
Datum lcp;
|
||||
Type tp;
|
||||
char type_string[NAMEDATALEN];
|
||||
int32 len;
|
||||
char *cp = NULL;
|
||||
char *const_string = NULL;
|
||||
bool string_palloced = false;
|
||||
|
||||
switch (nodeTag(expr))
|
||||
{
|
||||
case T_String:
|
||||
const_string = DatumGetPointer(expr->val.str);
|
||||
break;
|
||||
case T_Integer:
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%ld", expr->val.ival);
|
||||
break;
|
||||
default:
|
||||
elog(WARN,
|
||||
"parser_typecast: cannot cast this expression to type \"%s\"",
|
||||
typename->name);
|
||||
}
|
||||
|
||||
if (typename->arrayBounds != NIL)
|
||||
{
|
||||
sprintf(type_string, "_%s", typename->name);
|
||||
tp = (Type) type(type_string);
|
||||
}
|
||||
else
|
||||
{
|
||||
tp = (Type) type(typename->name);
|
||||
}
|
||||
|
||||
len = tlen(tp);
|
||||
|
||||
#if 0 /* fix me */
|
||||
switch (CInteger(lfirst(expr)))
|
||||
{
|
||||
case INT4OID: /* int4 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%d", ((Const *) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case NAMEOID: /* char16 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%s", ((Const *) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case CHAROID: /* char */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%c", ((Const) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case FLOAT8OID: /* float8 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%f", ((Const) lnext(expr))->constvalue);
|
||||
break;
|
||||
|
||||
case CASHOID: /* money */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%d",
|
||||
(int) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
|
||||
case TEXTOID: /* text */
|
||||
const_string = DatumGetPointer(((Const) lnext(expr))->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
|
||||
case UNKNOWNOID: /* unknown */
|
||||
const_string = DatumGetPointer(((Const) lnext(expr))->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "unknown type %d", CInteger(lfirst(expr)));
|
||||
}
|
||||
#endif
|
||||
|
||||
cp = instr2(tp, const_string, typlen);
|
||||
|
||||
if (!tbyvalue(tp))
|
||||
{
|
||||
/*
|
||||
if (len >= 0 && len != PSIZE(cp)) {
|
||||
char *pp;
|
||||
pp = (char *) palloc(len);
|
||||
memmove(pp, cp, len);
|
||||
cp = pp;
|
||||
}
|
||||
*/
|
||||
lcp = PointerGetDatum(cp);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (len)
|
||||
{
|
||||
case 1:
|
||||
lcp = Int8GetDatum(cp);
|
||||
break;
|
||||
case 2:
|
||||
lcp = Int16GetDatum(cp);
|
||||
break;
|
||||
case 4:
|
||||
lcp = Int32GetDatum(cp);
|
||||
break;
|
||||
default:
|
||||
lcp = PointerGetDatum(cp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
adt = makeConst(typeid(tp),
|
||||
len,
|
||||
(Datum) lcp,
|
||||
false,
|
||||
tbyvalue(tp),
|
||||
false, /* not a set */
|
||||
true /* is cast */ );
|
||||
|
||||
if (string_palloced)
|
||||
pfree(const_string);
|
||||
|
||||
return (Node *) adt;
|
||||
}
|
||||
|
||||
Node *
|
||||
parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
|
||||
{
|
||||
/* check for passing non-ints */
|
||||
Const *adt;
|
||||
Datum lcp;
|
||||
int32 len = tlen(tp);
|
||||
char *cp = NULL;
|
||||
|
||||
char *const_string = NULL;
|
||||
bool string_palloced = false;
|
||||
|
||||
Assert(IsA(expr, Const));
|
||||
|
||||
switch (exprType)
|
||||
{
|
||||
case 0: /* NULL */
|
||||
break;
|
||||
case INT4OID: /* int4 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%d",
|
||||
(int) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case NAMEOID: /* char16 */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%s",
|
||||
(char *) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case CHAROID: /* char */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%c",
|
||||
(char) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case FLOAT4OID: /* float4 */
|
||||
{
|
||||
float32 floatVal =
|
||||
DatumGetFloat32(((Const *) expr)->constvalue);
|
||||
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%f", *floatVal);
|
||||
break;
|
||||
}
|
||||
case FLOAT8OID: /* float8 */
|
||||
{
|
||||
float64 floatVal =
|
||||
DatumGetFloat64(((Const *) expr)->constvalue);
|
||||
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%f", *floatVal);
|
||||
break;
|
||||
}
|
||||
case CASHOID: /* money */
|
||||
const_string = (char *) palloc(256);
|
||||
string_palloced = true;
|
||||
sprintf(const_string, "%ld",
|
||||
(long) ((Const *) expr)->constvalue);
|
||||
break;
|
||||
case TEXTOID: /* text */
|
||||
const_string =
|
||||
DatumGetPointer(((Const *) expr)->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
case UNKNOWNOID: /* unknown */
|
||||
const_string =
|
||||
DatumGetPointer(((Const *) expr)->constvalue);
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "unknown type %u ", exprType);
|
||||
}
|
||||
|
||||
if (!exprType)
|
||||
{
|
||||
adt = makeConst(typeid(tp),
|
||||
(Size) 0,
|
||||
(Datum) NULL,
|
||||
true, /* isnull */
|
||||
false, /* was omitted */
|
||||
false, /* not a set */
|
||||
true /* is cast */ );
|
||||
return ((Node *) adt);
|
||||
}
|
||||
|
||||
cp = instr2(tp, const_string, typlen);
|
||||
|
||||
|
||||
if (!tbyvalue(tp))
|
||||
{
|
||||
/*
|
||||
if (len >= 0 && len != PSIZE(cp)) {
|
||||
char *pp;
|
||||
pp = (char *) palloc(len);
|
||||
memmove(pp, cp, len);
|
||||
cp = pp;
|
||||
}
|
||||
*/
|
||||
lcp = PointerGetDatum(cp);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (len)
|
||||
{
|
||||
case 1:
|
||||
lcp = Int8GetDatum(cp);
|
||||
break;
|
||||
case 2:
|
||||
lcp = Int16GetDatum(cp);
|
||||
break;
|
||||
case 4:
|
||||
lcp = Int32GetDatum(cp);
|
||||
break;
|
||||
default:
|
||||
lcp = PointerGetDatum(cp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
adt = makeConst(typeid(tp),
|
||||
(Size) len,
|
||||
(Datum) lcp,
|
||||
false,
|
||||
false, /* was omitted */
|
||||
false, /* not a set */
|
||||
true /* is cast */ );
|
||||
|
||||
/*
|
||||
* printf("adt %s : %u %d %d\n",CString(expr),typeid(tp) , len,cp);
|
||||
*/
|
||||
if (string_palloced)
|
||||
pfree(const_string);
|
||||
|
||||
return ((Node *) adt);
|
||||
}
|
||||
|
||||
Aggreg *
|
||||
ParseAgg(char *aggname, Oid basetype, Node *target)
|
||||
{
|
||||
Oid fintype;
|
||||
Oid vartype;
|
||||
Oid xfn1;
|
||||
Form_pg_aggregate aggform;
|
||||
Aggreg *aggreg;
|
||||
HeapTuple theAggTuple;
|
||||
|
||||
theAggTuple = SearchSysCacheTuple(AGGNAME, PointerGetDatum(aggname),
|
||||
ObjectIdGetDatum(basetype),
|
||||
0, 0);
|
||||
if (!HeapTupleIsValid(theAggTuple))
|
||||
{
|
||||
elog(WARN, "aggregate %s does not exist", aggname);
|
||||
}
|
||||
|
||||
aggform = (Form_pg_aggregate) GETSTRUCT(theAggTuple);
|
||||
fintype = aggform->aggfinaltype;
|
||||
xfn1 = aggform->aggtransfn1;
|
||||
|
||||
if (nodeTag(target) != T_Var && nodeTag(target) != T_Expr)
|
||||
elog(WARN, "parser: aggregate can only be applied on an attribute or expression");
|
||||
|
||||
/* only aggregates with transfn1 need a base type */
|
||||
if (OidIsValid(xfn1))
|
||||
{
|
||||
basetype = aggform->aggbasetype;
|
||||
if (nodeTag(target) == T_Var)
|
||||
vartype = ((Var *) target)->vartype;
|
||||
else
|
||||
vartype = ((Expr *) target)->typeOid;
|
||||
|
||||
if (basetype != vartype)
|
||||
{
|
||||
Type tp1,
|
||||
tp2;
|
||||
|
||||
tp1 = get_id_type(basetype);
|
||||
tp2 = get_id_type(vartype);
|
||||
elog(NOTICE, "Aggregate type mismatch:");
|
||||
elog(WARN, "%s works on %s, not %s", aggname,
|
||||
tname(tp1), tname(tp2));
|
||||
}
|
||||
}
|
||||
|
||||
aggreg = makeNode(Aggreg);
|
||||
aggreg->aggname = pstrdup(aggname);
|
||||
aggreg->basetype = aggform->aggbasetype;
|
||||
aggreg->aggtype = fintype;
|
||||
|
||||
aggreg->target = target;
|
||||
|
||||
return aggreg;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.29 1997/11/17 16:31:39 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.30 1997/11/20 23:22:25 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -29,12 +29,11 @@
|
||||
#include "parser/gramparse.h"
|
||||
#include "parser/keywords.h"
|
||||
#include "parser/scansup.h"
|
||||
#include "parser/sysfunc.h"
|
||||
#include "parse.h"
|
||||
#include "utils/builtins.h"
|
||||
|
||||
extern char *parseString;
|
||||
extern char *parseCh;
|
||||
static char *parseCh;
|
||||
|
||||
/* some versions of lex define this as a macro */
|
||||
#if defined(yywrap)
|
||||
@ -127,8 +126,6 @@ number [-+.0-9Ee]
|
||||
letter [\200-\377_A-Za-z]
|
||||
letter_or_digit [\200-\377_A-Za-z0-9]
|
||||
|
||||
sysfunc SYS_{letter}{letter_or_digit}*
|
||||
|
||||
identifier {letter}{letter_or_digit}*
|
||||
|
||||
typecast "::"
|
||||
@ -278,11 +275,6 @@ other .
|
||||
}
|
||||
|
||||
|
||||
{sysfunc} {
|
||||
yylval.str = pstrdup(SystemFunctionHandler((char *)yytext));
|
||||
return (SCONST);
|
||||
}
|
||||
|
||||
{typecast} { return TYPECAST; }
|
||||
|
||||
{self}/-[\.0-9] {
|
||||
|
@ -1,86 +0,0 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* sysfunc.c--
|
||||
* process system functions and return a string result
|
||||
*
|
||||
* Notes:
|
||||
* 1) I return a string result because most of the functions cannot return any
|
||||
* normal type anyway (e.g. SYS_DATE, SYS_TIME, etc...), and the few that
|
||||
* might (SYS_UID or whatever) can just return it as a string - no problem.
|
||||
* This keeps the function flexible enough to be of good use.
|
||||
*
|
||||
* Written by Chad Robinson, chadr@brttech.com
|
||||
* Last modified: 04/27/1996
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <config.h>
|
||||
#include <postgres.h>
|
||||
#include <miscadmin.h>
|
||||
#include <parser/sysfunc.h>
|
||||
|
||||
/*
|
||||
* Can't get much more obvious than this. Might need to replace localtime()
|
||||
* on older systems...
|
||||
*/
|
||||
static char *
|
||||
Sysfunc_system_date(void)
|
||||
{
|
||||
time_t cur_time_secs;
|
||||
struct tm *cur_time_expanded;
|
||||
static char buf[12]; /* Just for safety, y'understand... */
|
||||
|
||||
time(&cur_time_secs);
|
||||
cur_time_expanded = localtime(&cur_time_secs);
|
||||
if (EuroDates == 1)
|
||||
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mday,
|
||||
cur_time_expanded->tm_mon + 1, cur_time_expanded->tm_year + 1900);
|
||||
else
|
||||
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mon + 1,
|
||||
cur_time_expanded->tm_mday, cur_time_expanded->tm_year + 1900);
|
||||
|
||||
return &buf[0];
|
||||
}
|
||||
|
||||
static char *
|
||||
Sysfunc_system_time(void)
|
||||
{
|
||||
time_t cur_time_secs;
|
||||
struct tm *cur_time_expanded;
|
||||
static char buf[10]; /* Just for safety, y'understand... */
|
||||
|
||||
time(&cur_time_secs);
|
||||
cur_time_expanded = localtime(&cur_time_secs);
|
||||
sprintf(buf, "%2.2d:%2.2d:%2.2d", cur_time_expanded->tm_hour,
|
||||
cur_time_expanded->tm_min, cur_time_expanded->tm_sec);
|
||||
|
||||
return &buf[0];
|
||||
}
|
||||
|
||||
char *
|
||||
SystemFunctionHandler(char *funct)
|
||||
{
|
||||
if (!strcmp(funct, "SYS_DATE"))
|
||||
return Sysfunc_system_date();
|
||||
if (!strcmp(funct, "SYS_TIME"))
|
||||
return Sysfunc_system_time();
|
||||
return "*unknown function*";
|
||||
}
|
||||
|
||||
#ifdef SYSFUNC_TEST
|
||||
/*
|
||||
* Chad's rule of coding #4 - never delete a test function, even a stupid
|
||||
* one - you always need it 10 minutes after you delete it.
|
||||
*/
|
||||
void
|
||||
main(void)
|
||||
{
|
||||
printf("Current system date: %s\n", SystemFunctionHandler("SYS_DATE"));
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.5 1997/09/12 04:08:06 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.6 1997/11/20 23:22:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -90,7 +90,7 @@ RemoveRewriteRule(char *ruleName)
|
||||
ScanKeyEntryInitialize(&scanKeyData, 0, Anum_pg_rewrite_rulename,
|
||||
F_CHAR16EQ, NameGetDatum(ruleName));
|
||||
scanDesc = heap_beginscan(RewriteRelation,
|
||||
0, NowTimeQual, 1, &scanKeyData);
|
||||
0, false, 1, &scanKeyData);
|
||||
|
||||
tuple = heap_getnext(scanDesc, 0, (Buffer *) NULL);
|
||||
|
||||
@ -165,7 +165,7 @@ RelationRemoveRules(Oid relid)
|
||||
F_OIDEQ,
|
||||
ObjectIdGetDatum(relid));
|
||||
scanDesc = heap_beginscan(RewriteRelation,
|
||||
0, NowTimeQual, 1, &scanKeyData);
|
||||
0, false, 1, &scanKeyData);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.11 1997/10/25 05:35:55 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.12 1997/11/20 23:22:39 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -109,7 +109,7 @@ IsDefinedRewriteRule(char *ruleName)
|
||||
ScanKeyEntryInitialize(&scanKey, 0, Anum_pg_rewrite_rulename,
|
||||
NameEqualRegProcedure, PointerGetDatum(ruleName));
|
||||
scanDesc = heap_beginscan(RewriteRelation,
|
||||
0, NowTimeQual, 1, &scanKey);
|
||||
0, false, 1, &scanKey);
|
||||
|
||||
tuple = heap_getnext(scanDesc, 0, (Buffer *) NULL);
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.19 1997/11/02 15:25:40 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.20 1997/11/20 23:22:46 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -628,7 +628,7 @@ inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP)
|
||||
* a time qual in.
|
||||
*/
|
||||
|
||||
htup = heap_fetch(obj_desc->heap_r, NowTimeQual,
|
||||
htup = heap_fetch(obj_desc->heap_r, false,
|
||||
&(res->heap_iptr), bufP);
|
||||
|
||||
} while (htup == (HeapTuple) NULL);
|
||||
@ -639,7 +639,7 @@ inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP)
|
||||
}
|
||||
else
|
||||
{
|
||||
htup = heap_fetch(obj_desc->heap_r, NowTimeQual,
|
||||
htup = heap_fetch(obj_desc->heap_r, false,
|
||||
&(obj_desc->htid), bufP);
|
||||
}
|
||||
|
||||
@ -1206,7 +1206,7 @@ _inv_getsize(Relation hreln, TupleDesc hdesc, Relation ireln)
|
||||
if (buf != InvalidBuffer)
|
||||
ReleaseBuffer(buf);
|
||||
|
||||
htup = heap_fetch(hreln, NowTimeQual, &(res->heap_iptr), &buf);
|
||||
htup = heap_fetch(hreln, false, &(res->heap_iptr), &buf);
|
||||
|
||||
} while (!HeapTupleIsValid(htup));
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.17 1997/09/08 21:47:48 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.18 1997/11/20 23:22:50 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* See acl.h.
|
||||
@ -123,7 +123,7 @@ ChangeAcl(char *relname,
|
||||
relkey[0].sk_argument = NameGetDatum(relname);
|
||||
hsdp = heap_beginscan(relation,
|
||||
0,
|
||||
NowTimeQual,
|
||||
false,
|
||||
(unsigned) 1,
|
||||
relkey);
|
||||
htp = heap_getnext(hsdp, 0, &buffer);
|
||||
@ -491,7 +491,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||
&relkey[0].sk_func,
|
||||
&relkey[0].sk_nargs);
|
||||
relkey[0].sk_argument = NameGetDatum(relname);
|
||||
hsdp = heap_beginscan(relation, 0, NowTimeQual, 1, relkey);
|
||||
hsdp = heap_beginscan(relation, 0, false, 1, relkey);
|
||||
htp = heap_getnext(hsdp, 0, (Buffer *) 0);
|
||||
if (HeapTupleIsValid(htp) &&
|
||||
!heap_attisnull(htp, Anum_pg_class_relacl))
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.6 1997/09/12 04:08:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.7 1997/11/20 23:22:57 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -72,7 +72,7 @@ int4notin(int16 not_in_arg, char *relation_and_attr)
|
||||
/* the last argument should be a ScanKey, not an integer! - jolly */
|
||||
/* it looks like the arguments are out of order, too */
|
||||
/* but skeyData is never initialized! does this work?? - ay 2/95 */
|
||||
scan_descriptor = heap_beginscan(relation_to_scan, false, NULL, 0,
|
||||
scan_descriptor = heap_beginscan(relation_to_scan, false, false, 0,
|
||||
&skeyData);
|
||||
|
||||
retval = true;
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.9 1997/11/15 16:32:01 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.10 1997/11/20 23:23:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -55,7 +55,7 @@ regprocin(char *proname)
|
||||
(RegProcedure) F_CHAR16EQ,
|
||||
(Datum) proname);
|
||||
|
||||
procscan = heap_beginscan(proc, 0, NowTimeQual, 1, &key);
|
||||
procscan = heap_beginscan(proc, 0, false, 1, &key);
|
||||
if (!HeapScanIsValid(procscan))
|
||||
{
|
||||
heap_close(proc);
|
||||
@ -114,7 +114,7 @@ regprocout(RegProcedure proid)
|
||||
(RegProcedure) F_INT4EQ,
|
||||
(Datum) proid);
|
||||
|
||||
procscan = heap_beginscan(proc, 0, NowTimeQual, 1, &key);
|
||||
procscan = heap_beginscan(proc, 0, false, 1, &key);
|
||||
if (!HeapScanIsValid(procscan))
|
||||
{
|
||||
heap_close(proc);
|
||||
@ -192,7 +192,7 @@ oid8types(Oid (*oidArray)[])
|
||||
(RegProcedure) F_INT4EQ,
|
||||
(Datum) *sp);
|
||||
|
||||
typescan = heap_beginscan(type, 0, NowTimeQual, 1, &key);
|
||||
typescan = heap_beginscan(type, 0, false, 1, &key);
|
||||
if (!HeapScanIsValid(typescan))
|
||||
{
|
||||
heap_close(type);
|
||||
|
@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.10 1997/09/08 02:31:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.11 1997/11/20 23:23:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -350,7 +350,7 @@ gethilokey(Oid relid,
|
||||
key[0].sk_argument = ObjectIdGetDatum(relid);
|
||||
key[1].sk_argument = Int16GetDatum((int16) attnum);
|
||||
key[2].sk_argument = ObjectIdGetDatum(opid);
|
||||
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 3, key);
|
||||
sdesc = heap_beginscan(rdesc, 0, false, 3, key);
|
||||
tuple = heap_getnext(sdesc, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.7 1997/09/08 02:31:01 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.8 1997/11/20 23:23:05 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -121,7 +121,7 @@ SetDefine(char *querystr, char *typename)
|
||||
oidKey[0].sk_argument = ObjectIdGetDatum(setoid);
|
||||
pg_proc_scan = heap_beginscan(procrel,
|
||||
0,
|
||||
SelfTimeQual,
|
||||
true,
|
||||
1,
|
||||
oidKey);
|
||||
tup = heap_getnext(pg_proc_scan, 0, &buffer);
|
||||
|
4
src/backend/utils/cache/catcache.c
vendored
4
src/backend/utils/cache/catcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.16 1997/09/18 20:22:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.17 1997/11/20 23:23:08 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@ -973,7 +973,7 @@ SearchSysCache(struct catcache * cache,
|
||||
*/
|
||||
MemoryContextSwitchTo(oldcxt);
|
||||
|
||||
sd = heap_beginscan(relation, 0, NowTimeQual,
|
||||
sd = heap_beginscan(relation, 0, false,
|
||||
cache->cc_nkeys, cache->cc_skey);
|
||||
|
||||
/* should this buffer be ReleaseBuffer'd? --djm 8/20/96 */
|
||||
|
12
src/backend/utils/cache/relcache.c
vendored
12
src/backend/utils/cache/relcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.28 1997/11/17 16:59:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.29 1997/11/20 23:23:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -383,7 +383,7 @@ scan_pg_rel_seq(RelationBuildDescInfo buildinfo)
|
||||
if (!IsInitProcessingMode())
|
||||
RelationSetLockForRead(pg_class_desc);
|
||||
pg_class_scan =
|
||||
heap_beginscan(pg_class_desc, 0, NowTimeQual, 1, &key);
|
||||
heap_beginscan(pg_class_desc, 0, false, 1, &key);
|
||||
pg_class_tuple = heap_getnext(pg_class_scan, 0, &buf);
|
||||
|
||||
/* ----------------
|
||||
@ -555,7 +555,7 @@ build_tupdesc_seq(RelationBuildDescInfo buildinfo,
|
||||
*/
|
||||
pg_attribute_desc = heap_openr(AttributeRelationName);
|
||||
pg_attribute_scan =
|
||||
heap_beginscan(pg_attribute_desc, 0, NowTimeQual, 1, &key);
|
||||
heap_beginscan(pg_attribute_desc, 0, false, 1, &key);
|
||||
|
||||
/* ----------------
|
||||
* add attribute data to relation->rd_att
|
||||
@ -726,7 +726,7 @@ RelationBuildRuleLock(Relation relation)
|
||||
*/
|
||||
pg_rewrite_desc = heap_openr(RewriteRelationName);
|
||||
pg_rewrite_scan =
|
||||
heap_beginscan(pg_rewrite_desc, 0, NowTimeQual, 1, &key);
|
||||
heap_beginscan(pg_rewrite_desc, 0, false, 1, &key);
|
||||
pg_rewrite_tupdesc =
|
||||
RelationGetTupleDescriptor(pg_rewrite_desc);
|
||||
|
||||
@ -1728,7 +1728,7 @@ AttrDefaultFetch(Relation relation)
|
||||
break;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(adrel, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(adrel, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
continue;
|
||||
@ -1817,7 +1817,7 @@ RelCheckFetch(Relation relation)
|
||||
break;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(rcrel, NowTimeQual, iptr, &buffer);
|
||||
tuple = heap_fetch(rcrel, false, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
continue;
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.2 1997/11/10 15:14:34 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.3 1997/11/20 23:23:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -59,7 +59,7 @@ GetDatabaseInfo(char *name, Oid *owner, char *path)
|
||||
ScanKeyEntryInitialize(&scanKey, 0, Anum_pg_database_datname,
|
||||
NameEqualRegProcedure, NameGetDatum(name));
|
||||
|
||||
scan = heap_beginscan(dbrel, 0, NowTimeQual, 1, &scanKey);
|
||||
scan = heap_beginscan(dbrel, 0, false, 1, &scanKey);
|
||||
if (!HeapScanIsValid(scan))
|
||||
elog(WARN, "GetDatabaseInfo: cannot begin scan of %s", DatabaseRelationName);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.9 1997/11/02 15:26:17 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.10 1997/11/20 23:23:20 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -25,9 +25,6 @@
|
||||
|
||||
#include "utils/tqual.h"
|
||||
|
||||
static int4 SelfTimeQualData;
|
||||
TimeQual SelfTimeQual = (TimeQual) &SelfTimeQualData;
|
||||
|
||||
extern bool PostgresIsInitialized;
|
||||
|
||||
/*
|
||||
@ -82,33 +79,23 @@ static bool HeapTupleSatisfiesItself(HeapTuple tuple);
|
||||
static bool HeapTupleSatisfiesNow(HeapTuple tuple);
|
||||
|
||||
/*
|
||||
* HeapTupleSatisfiesTimeQual --
|
||||
* HeapTupleSatisfiesScope --
|
||||
* True iff heap tuple satsifies a time qual.
|
||||
*
|
||||
* Note:
|
||||
* Assumes heap tuple is valid.
|
||||
* Assumes time qual is valid.
|
||||
*/
|
||||
bool
|
||||
HeapTupleSatisfiesTimeQual(HeapTuple tuple, TimeQual qual)
|
||||
HeapTupleSatisfiesVisibility(HeapTuple tuple, bool seeself)
|
||||
{
|
||||
|
||||
if (TransactionIdEquals(tuple->t_xmax, AmiTransactionId))
|
||||
return (false);
|
||||
|
||||
if (qual == SelfTimeQual || heapisoverride())
|
||||
{
|
||||
if (seeself == true || heapisoverride())
|
||||
return (HeapTupleSatisfiesItself(tuple));
|
||||
}
|
||||
|
||||
if (qual == NowTimeQual)
|
||||
{
|
||||
else
|
||||
return (HeapTupleSatisfiesNow(tuple));
|
||||
}
|
||||
|
||||
elog(WARN, "HeapTupleSatisfiesTimeQual: illegal time qual");
|
||||
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: heapam.h,v 1.21 1997/11/02 15:26:37 vadim Exp $
|
||||
* $Id: heapam.h,v 1.22 1997/11/20 23:23:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -123,13 +123,12 @@ extern Relation heap_openr(char *relationName);
|
||||
extern void heap_close(Relation relation);
|
||||
extern HeapScanDesc
|
||||
heap_beginscan(Relation relation, int atend,
|
||||
TimeQual timeQual, unsigned nkeys, ScanKey key);
|
||||
bool seeself, unsigned nkeys, ScanKey key);
|
||||
extern void heap_rescan(HeapScanDesc sdesc, bool scanFromEnd, ScanKey key);
|
||||
extern void heap_endscan(HeapScanDesc sdesc);
|
||||
extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw, Buffer *b);
|
||||
extern HeapTuple
|
||||
heap_fetch(Relation relation, TimeQual timeQual,
|
||||
ItemPointer tid, Buffer *b);
|
||||
heap_fetch(Relation relation, bool seeself, ItemPointer tid, Buffer *b);
|
||||
extern Oid heap_insert(Relation relation, HeapTuple tup);
|
||||
extern int heap_delete(Relation relation, ItemPointer tid);
|
||||
extern int
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: relscan.h,v 1.8 1997/09/08 21:50:56 momjian Exp $
|
||||
* $Id: relscan.h,v 1.9 1997/11/20 23:23:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -33,7 +33,7 @@ typedef struct HeapScanDescData
|
||||
ItemPointerData rs_mntid; /* marked next tid */
|
||||
ItemPointerData rs_mcd; /* marked current delta XXX ??? */
|
||||
bool rs_atend; /* restart scan at end? */
|
||||
TimeQual rs_tr; /* time qualification */
|
||||
bool rs_seeself; /* see self or not */
|
||||
uint16 rs_cdelta; /* current delta in chain */
|
||||
uint16 rs_nkeys; /* number of attributes in keys */
|
||||
ScanKey rs_key; /* key descriptors */
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: valid.h,v 1.9 1997/11/02 15:26:46 vadim Exp $
|
||||
* $Id: valid.h,v 1.10 1997/11/20 23:23:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -113,7 +113,7 @@ do \
|
||||
relation, \
|
||||
buffer, \
|
||||
disk_page, \
|
||||
qual, \
|
||||
seeself, \
|
||||
nKeys, \
|
||||
key, \
|
||||
result) \
|
||||
@ -144,7 +144,7 @@ do \
|
||||
{ \
|
||||
uint16 _infomask = _tuple->t_infomask; \
|
||||
\
|
||||
_res = HeapTupleSatisfiesTimeQual(_tuple, (qual)); \
|
||||
_res = HeapTupleSatisfiesVisibility(_tuple, (seeself)); \
|
||||
if (_tuple->t_infomask != _infomask) \
|
||||
SetBufferCommitInfoNeedsSave(buffer); \
|
||||
if (_res) \
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: executor.h,v 1.14 1997/09/27 14:37:21 momjian Exp $
|
||||
* $Id: executor.h,v 1.15 1997/11/20 23:23:39 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -28,8 +28,8 @@
|
||||
*/
|
||||
extern void
|
||||
ExecOpenScanR(Oid relOid, int nkeys, ScanKey skeys, bool isindex,
|
||||
ScanDirection dir, TimeQual timeRange,
|
||||
Relation *returnRelation, Pointer *returnScanDesc);
|
||||
ScanDirection dir, Relation *returnRelation,
|
||||
Pointer *returnScanDesc);
|
||||
extern void ExecCloseR(Plan *node);
|
||||
extern void ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent);
|
||||
extern HeapScanDesc
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: parsenodes.h,v 1.30 1997/11/07 06:38:38 thomas Exp $
|
||||
* $Id: parsenodes.h,v 1.31 1997/11/20 23:23:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -785,16 +785,6 @@ typedef struct ParamString
|
||||
char *val;
|
||||
} ParamString;
|
||||
|
||||
/*
|
||||
* TimeRange - specifies a time range
|
||||
*/
|
||||
typedef struct TimeRange
|
||||
{
|
||||
NodeTag type;
|
||||
char *startDate;
|
||||
char *endDate; /* snapshot if NULL */
|
||||
} TimeRange;
|
||||
|
||||
/*
|
||||
* RelExpr - relation expressions
|
||||
*/
|
||||
@ -803,7 +793,6 @@ typedef struct RelExpr
|
||||
NodeTag type;
|
||||
char *relname; /* the relation name */
|
||||
bool inh; /* inheritance query */
|
||||
TimeRange *timeRange; /* the time range */
|
||||
} RelExpr;
|
||||
|
||||
/*
|
||||
@ -887,14 +876,12 @@ typedef struct RangeTblEntry
|
||||
{
|
||||
NodeTag type;
|
||||
char *relname; /* real name of the relation */
|
||||
TimeRange *timeRange; /* time range */
|
||||
char *refname; /* the reference name (specified in the
|
||||
* from clause) */
|
||||
Oid relid;
|
||||
bool inh; /* inheritance? */
|
||||
bool archive; /* filled in by plan_archive */
|
||||
bool inFromCl; /* comes from From Clause */
|
||||
TimeQual timeQual; /* filled in by pg_plan */
|
||||
} RangeTblEntry;
|
||||
|
||||
/*
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: prep.h,v 1.5 1997/09/08 21:53:30 momjian Exp $
|
||||
* $Id: prep.h,v 1.6 1997/11/20 23:23:48 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -16,12 +16,6 @@
|
||||
#include <nodes/plannodes.h>
|
||||
#include <nodes/parsenodes.h>
|
||||
|
||||
/*
|
||||
* prototypes for archive.h
|
||||
*/
|
||||
extern void plan_archive(List *rt);
|
||||
extern List *find_archive_rels(Oid relid);
|
||||
|
||||
/*
|
||||
* prototypes for prepqual.h
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: parse_query.h,v 1.13 1997/11/02 15:27:08 vadim Exp $
|
||||
* $Id: parse_query.h,v 1.14 1997/11/20 23:23:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -29,8 +29,7 @@ extern int refnameRangeTablePosn(List *rtable, char *refname);
|
||||
extern RangeTblEntry *
|
||||
addRangeTableEntry(ParseState *pstate,
|
||||
char *relname, char *refname,
|
||||
bool inh, bool inFromCl,
|
||||
TimeRange *timeRange);
|
||||
bool inh, bool inFromCl);
|
||||
extern List *
|
||||
expandAll(ParseState *pstate, char *relname, char *refname,
|
||||
int *this_resno);
|
||||
@ -49,13 +48,9 @@ extern Const *make_const(Value *value);
|
||||
extern void param_type_init(Oid *typev, int nargs);
|
||||
extern Oid param_type(int t);
|
||||
|
||||
/* parser.c (was ylib.c) */
|
||||
extern QueryTreeList *parser(char *str, Oid *typev, int nargs);
|
||||
extern Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
|
||||
extern Node *parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen);
|
||||
extern Aggreg *ParseAgg(char *aggname, Oid basetype, Node *target);
|
||||
extern void
|
||||
handleTargetColname(ParseState *pstate, char **resname,
|
||||
|
||||
extern void handleTargetColname(ParseState *pstate, char **resname,
|
||||
char *refname, char *colname);
|
||||
|
||||
/*
|
||||
|
@ -1,9 +0,0 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* sysfunc.h--
|
||||
* support for system functions
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
extern char *SystemFunctionHandler(char *funct);
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: tqual.h,v 1.10 1997/11/02 15:27:14 vadim Exp $
|
||||
* $Id: tqual.h,v 1.11 1997/11/20 23:24:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -15,18 +15,12 @@
|
||||
|
||||
#include <access/htup.h>
|
||||
|
||||
typedef Pointer TimeQual;
|
||||
|
||||
/* Tuples valid as of StartTransactionCommand */
|
||||
#define NowTimeQual ((TimeQual) NULL)
|
||||
|
||||
/* As above, plus updates in this command */
|
||||
extern TimeQual SelfTimeQual;
|
||||
|
||||
extern void setheapoverride(bool on);
|
||||
extern bool heapisoverride(void);
|
||||
|
||||
extern bool HeapTupleSatisfiesTimeQual(HeapTuple tuple, TimeQual qual);
|
||||
extern bool HeapTupleSatisfiesVisibility(HeapTuple tuple, bool seeself);
|
||||
|
||||
|
||||
#endif /* TQUAL_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user