Re: missing rename support - Mailing list pgsql-hackers

From Tom Lane
Subject Re: missing rename support
Date
Msg-id 16616.1360386583@sss.pgh.pa.us
Whole thread Raw
In response to Re: missing rename support  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> [ alter-rule-rename_complete.v2.patch ]

Committed with assorted editorialization.  Aside from cosmetic issues,
the main changes were:

* use RangeVarGetRelidExtended with a callback to perform the lookup
and locking of the target relation.  This is a new API that the original
version of RenameRewriteRule couldn't have known about.  I borrowed the
code pretty much verbatim from renametrig(), and am now wondering
whether there shouldn't be some attempt to unify the callbacks for this.

* call CacheInvalidateRelcache to ensure that other sessions notice the
rule tuple update.  It may be that this isn't necessary because nothing
looks at the rule name fields in relcache entries ... but I wouldn't bet
on that, and in any case it seems like bad practice to let stale cache
entries hang around.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Identity projection
Next
From: Pavan Deolasee
Date:
Subject: Re: Too frequent checkpoints ?