Re: missing rename support

From: Ali Dar <ali(dot)munir(dot)dar(at)gmail(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: missing rename support
Date: 2013-01-29 15:34:53
Message-ID: CAAj60S4wC=Cwao082t8BATx9aeHmBr3H49GJcbfb-tjMhYOeLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Please find attached the complete patch for alter rename rule. I have
followed all the suggestions. Followings things are added in this updated
patch:
1) Disallow alter rename of ON SELECT rules.
2) Remove warning.
3) Varibles are lined up.
4) Used qualified_name instead of makeRangeVarFromAnyName.
5) Throw appropriate error if user tries to alter rename rule on irrelavent
object(e.g index).
6) Psql tab support added
7) Regression test cases added.
8) Documentation added.

Regards,
Ali Dar

On Mon, Jan 21, 2013 at 12:34 AM, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>wrote:

> On 3 January 2013 13:49, Ali Dar <ali(dot)munir(dot)dar(at)gmail(dot)com> wrote:
> > Find attached an initial patch for ALTER RENAME RULE feature. Please note
> > that it does not have any documentation yet.
> >
>
> Hi,
>
> I just got round to looking at this. All-in-all it looks OK. I just
> have a few more review comments, in addition to Stephen's comment
> about renaming SELECT rules...
>
> This compiler warning should be fixed with another #include:
> alter.c:107:4: warning: implicit declaration of function
> ‘RenameRewriteRule’
>
> In gram.y, I think you can just use qualified_name instead of
> makeRangeVarFromAnyName().
>
> In RenameRewriteRule(), I think it's worth doing a check to ensure
> that the relation actually is a table or a view (you might have some
> other relation kind at that point in the code). If the user
> accidentally types the name of an index, say, instead of a table, then
> it is better to throw an error saying "xxx is not a table or a view"
> rather than reporting that the rule doesn't exist.
>
> I think this could probably use some simple regression tests to test
> both the success and failure cases.
>
> It would be nice to extend psql tab completion to support this too,
> although perhaps that could be done as a separate patch.
>
> Don't forget the docs!
>
> Regards,
> Dean
>

Attachment Content-Type Size
alter-rule-rename_complete.patch application/octet-stream 13.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2013-01-29 15:54:26 Re: Back-branch update releases coming in a couple weeks
Previous Message Tom Lane 2013-01-29 15:34:43 Re: psql \l to accept patterns