1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Make relhasrules and relhastriggers work like relhasindex, namely we let

VACUUM reset them to false rather than trying to clean 'em up during DROP.
This commit is contained in:
Tom Lane
2008-11-10 00:49:37 +00:00
parent e4718f2c9e
commit c5451c22e3
7 changed files with 67 additions and 43 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.275 2008/11/09 21:24:32 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.276 2008/11/10 00:49:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -721,6 +721,17 @@ RelationBuildRuleLock(Relation relation)
systable_endscan(rewrite_scan);
heap_close(rewrite_desc, AccessShareLock);
/*
* there might not be any rules (if relhasrules is out-of-date)
*/
if (numlocks == 0)
{
relation->rd_rules = NULL;
relation->rd_rulescxt = NULL;
MemoryContextDelete(rulescxt);
return;
}
/*
* form a RuleLock and insert into relation
*/