1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Restructure indexscan API (index_beginscan, index_getnext) per

yesterday's proposal to pghackers.  Also remove unnecessary parameters
to heap_beginscan, heap_rescan.  I modified pg_proc.h to reflect the
new numbers of parameters for the AM interface routines, but did not
force an initdb because nothing actually looks at those fields.
This commit is contained in:
Tom Lane
2002-05-20 23:51:44 +00:00
parent c961474c96
commit 44fbe20d62
59 changed files with 834 additions and 1283 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.70 2002/05/12 20:10:04 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.71 2002/05/20 23:51:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -292,18 +292,11 @@ DefineQueryRewrite(RuleStmt *stmt)
if (event_relation->rd_rel->relkind != RELKIND_VIEW)
{
HeapScanDesc scanDesc;
HeapTuple tuple;
scanDesc = heap_beginscan(event_relation, 0, SnapshotNow, 0, NULL);
tuple = heap_getnext(scanDesc, 0);
if (HeapTupleIsValid(tuple))
scanDesc = heap_beginscan(event_relation, SnapshotNow, 0, NULL);
if (heap_getnext(scanDesc, ForwardScanDirection) != NULL)
elog(ERROR, "Relation \"%s\" is not empty. Cannot convert it to view",
event_obj->relname);
/*
* don't need heap_freetuple because we never got a valid
* tuple
*/
heap_endscan(scanDesc);
RelisBecomingView = true;