Re: [PATCHES] "ALSO" keyword to "CREATE RULE" patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: [PATCHES] "ALSO" keyword to "CREATE RULE" patch
Date: 2004-03-04 14:40:13
Message-ID: 200403041440.i24EeDi28025@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-patches

Fabien COELHO wrote:
>
> Dear Bruce,
>
> > Is ALSO part of the SQL standard? I can't imagine it is because there
> > is no rule mention.
>
> As RULE is not in the SQL standard, ALSO is sure no part of it.
>
> > I guess if we were coding from scratch, we could make the syntax INSTEAD
> > or ALSO, but at this point, I don't see adding ALSO as a useful change.
>
> It depends on what you mean by "useful". It is certainly non essential.
> I just think it is "user-friendly".
>
> It took me some time to understand that rules were appended by default.
> With the "ALSO" keyword it would have been instantaneous.
>
> When I first looked at the syntax with the "INSTEAD" which is optionnal
> and without alternative, I thought that it was one of those useless
> keywords that are allowed so as to make SQL more English-like, as the
> "COLUMN" keyword in the ALTER TABLE syntax. You may argue that I did
> not read the documentation in depth, but I'm not sure I'm the only one;-)
>
> The change is very small (2 lines added, 2 lines changed), and upward
> compatible, provided that the user has not used ALSO as an object name,
> what seems rather unlikely IMVVHO.
>
> Most of the patch deals with the documentation, which is rather ugly
> because it keeps telling about "INSTEAD" vs "non-INSTEAD" rules, as there
> is no name for the default behavior. I think "ALSO" fixes this issue as it
> clarifies the explanations.

Actually, our real problem is that the INSTEAD keyword wasn't mentioned
as part of instead rules (second paragraph), and there was no mention of
INSTEAD in the parameter section. I just fixed this in current CVS:

http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-createrule.html

This should prevent misunderstanding in the future without adding an
additional keyword.

If we were starting from scratch, we would perhaps require either ALSO
or INSTEAD, but since we already have existing users, clarifiying it
seems better.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2004-03-04 14:46:48 Re: "ALSO" keyword to "CREATE RULE" patch
Previous Message Fabien COELHO 2004-03-04 08:40:04 Re: "ALSO" keyword to "CREATE RULE" patch

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-03-04 14:46:48 Re: "ALSO" keyword to "CREATE RULE" patch
Previous Message Fabien COELHO 2004-03-04 08:40:04 Re: "ALSO" keyword to "CREATE RULE" patch