Re: missing rename support

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Ali Dar <ali(dot)munir(dot)dar(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: missing rename support
Date: 2013-02-09 05:09:43
Message-ID: 16616.1360386583@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-02-09 05:24:00 pgsql: psql: Improve expanded print output in tuples-only mode
Previous Message Tom Lane 2013-02-09 03:33:13 Re: Identity projection