Subject: Patch for CREATE RULE sgml

From: Emanuel Calvo <[email-masked]>
Date: Thu, 20 Mar 2014 17:24:18 -0300

Hi guys,

I realized that the output of the CREATE RULE has not a detailed
output for the "events" parameter.

But the question here is that I'm not sure which format follow:

- --
{ INSERT | UPDATE | DELETE | SELECT}

or

    INSERT
    UPDATE
    DELETE
    SELECT
- --

I attach a patch for each one.

Regards,

- -- 
- --
Emanuel Calvo
Consultant // 2ndQuadrant
Bs. As., Argentina // (GMT-3)
diff --git a/doc/src/sgml/ref/create_rule.sgml b/doc/src/sgml/ref/create_rule.sgml
index d3212b5..22b46e2 100644
--- a/doc/src/sgml/ref/create_rule.sgml
+++ b/doc/src/sgml/ref/create_rule.sgml
@@ -24,6 +24,9 @@ PostgreSQL documentation
 CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
     TO <replaceable class="parameter">table_name</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
     DO [ ALSO | INSTEAD ] { NOTHING | <replaceable class="parameter">command</replaceable> | ( <replaceable class="parameter">command</replaceable> ; <replaceable class="parameter">command</replaceable> ... ) }
+
+<phrase>where <replaceable class="parameter">event</replaceable> can be one of:</phrase>
+    { INSERT | UPDATE | DELETE | SELECT}
 </synopsis>
  </refsynopsisdiv>
 
diff --git a/doc/src/sgml/ref/create_rule.sgml b/doc/src/sgml/ref/create_rule.sgml
index d3212b5..a4df024 100644
--- a/doc/src/sgml/ref/create_rule.sgml
+++ b/doc/src/sgml/ref/create_rule.sgml
@@ -24,6 +24,12 @@ PostgreSQL documentation
 CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
     TO <replaceable class="parameter">table_name</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
     DO [ ALSO | INSTEAD ] { NOTHING | <replaceable class="parameter">command</replaceable> | ( <replaceable class="parameter">command</replaceable> ; <replaceable class="parameter">command</replaceable> ... ) }
+
+<phrase>where <replaceable class="parameter">event</replaceable> can be one of:</phrase>
+    INSERT
+    UPDATE
+    DELETE
+    SELECT
 </synopsis>
  </refsynopsisdiv>

-- 
Sent via pgsql-docs mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

---

From: Emanuel Calvo <[email-masked]>
Date: Fri, 21 Mar 2014 12:56:01 -0300

Hi guys,

or

    INSERT
    UPDATE
    DELETE
    SELECT
- --

I sent a mail to pgsql-docs but no response has been received.

Thanks and regards,

-- 
Sent via pgsql-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

---

From: Michael Paquier <[email-masked]>
Date: Sat, 22 Mar 2014 10:15:28 +0900

> I sent a mail to pgsql-docs but no response has been received.
The list of events possible is already listed in the section
"Parameters" => "event":
Page: http://www.postgresql.org/docs/devel/static/sql-createrule.html
Quote: "The event is one of SELECT, INSERT, UPDATE, or DELETE."
Regards,
-- 
Michael

---

From: Jaime Casanova <[email-masked]>
Date: Fri, 21 Mar 2014 21:18:45 -0500

> The list of events possible is already listed in the section

AFAIU, the synopsis is used to build the help command (\h) in psql.
Currently in that help the events doesn't appear.
btw, CREATE TRIGGER already looks this way:
http://www.postgresql.org/docs/current/static/sql-createtrigger.html

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566         Cell: +593 987171157

---

From: Michael Paquier <[email-masked]>
Date: Sat, 22 Mar 2014 15:32:45 +0900

> http://www.postgresql.org/docs/current/static/sql-createtrigger.html
You are right, I forgot this one... In this case patch 2 could be backpatched...
-- 
Michael

---

From: Fujii Masao <[email-masked]>
Date: Mon, 24 Mar 2014 21:51:07 +0900

On Sat, Mar 22, 2014 at 12:56 AM, Emanuel Calvo
<[email-masked]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
>
>
> Hi guys,
>

Though I'm not sure the right policy of the format in synopsis, ISTM that
the following format is suitable in this case, i.e., if the value list
is very simple.
Patch attached.

    SELECT | INSERT | UPDATE | DELETE

Regards,

-- 
Fujii Masao
*** a/doc/src/sgml/ref/create_rule.sgml
--- b/doc/src/sgml/ref/create_rule.sgml
***************
*** 24,29 **** PostgreSQL documentation
--- 24,33 ----
  CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
      TO <replaceable class="parameter">table_name</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
      DO [ ALSO | INSTEAD ] { NOTHING | <replaceable class="parameter">command</replaceable> | ( <replaceable class="parameter">command</replaceable> ; <replaceable class="parameter">command</replaceable> ... ) }
+ 
+ <phrase>where <replaceable class="parameter">event</replaceable> can be one of:</phrase>
+ 
+     SELECT | INSERT | UPDATE | DELETE
  </synopsis>
   </refsynopsisdiv>

---

From: Bruce Momjian <[email-masked]>
Date: Tue, 22 Apr 2014 17:54:54 -0400

>     SELECT | INSERT | UPDATE | DELETE

Patch applied.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +