pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedcreate rule syntax
6+ messages / 4 participants
[nested] [flat]
* create rule syntax
@ 2005-05-11 19:23 Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Jurka @ 2005-05-11 19:23 UTC (permalink / raw)
To: pgsql-docs
The manual shows slightly different variations for the create rule
syntax here and here:
http://www.postgresql.org/docs/8.0/static/rules-update.html
http://www.postgresql.org/docs/8.0/static/sql-createrule.html
The attached patches makes the first look like the second. The key change
is that it shows how multiple actions are delimited:
(actions) vs. (command ; command ...)
Kris Jurka
Attachments:
rule-syntax.patch (text/plain, 1.2K) download
Index: doc/src/sgml/rules.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/rules.sgml,v
retrieving revision 1.41
diff -c -r1.41 rules.sgml
*** doc/src/sgml/rules.sgml 29 Jan 2005 23:45:36 -0000 1.41
--- doc/src/sgml/rules.sgml 11 May 2005 19:19:59 -0000
***************
*** 902,910 ****
Keep the syntax
<programlisting>
! CREATE RULE <replaceable>rule_name</> AS ON <replaceable>event</>
! TO <replaceable>object</> [WHERE <replaceable>rule_qualification</>]
! DO [ALSO|INSTEAD] [<replaceable>action</> | (<replaceable>actions</>) | NOTHING];
</programlisting>
in mind.
--- 902,910 ----
Keep the syntax
<programlisting>
! CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
! TO <replaceable class="parameter">table</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> ... ) }
</programlisting>
in mind.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: create rule syntax
@ 2005-05-20 01:37 Neil Conway <neilc@samurai.com>
parent: Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: Neil Conway @ 2005-05-20 01:37 UTC (permalink / raw)
To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-docs
Kris Jurka wrote:
> The manual shows slightly different variations for the create rule
> syntax here and here:
>
> http://www.postgresql.org/docs/8.0/static/rules-update.html
> http://www.postgresql.org/docs/8.0/static/sql-createrule.html
>
> The attached patches makes the first look like the second.
Applied, thanks.
-Neil
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: create rule syntax
@ 2005-05-20 11:56 Robert Treat <xzilla@users.sourceforge.net>
parent: Neil Conway <neilc@samurai.com>
0 siblings, 1 reply; 6+ messages in thread
From: Robert Treat @ 2005-05-20 11:56 UTC (permalink / raw)
To: Neil Conway <neilc@samurai.com>; +Cc: Kris Jurka <books@ejurka.com>; pgsql-docs
On Thursday 19 May 2005 21:37, Neil Conway wrote:
> Kris Jurka wrote:
> > The manual shows slightly different variations for the create rule
> > syntax here and here:
> >
> > http://www.postgresql.org/docs/8.0/static/rules-update.html
> > http://www.postgresql.org/docs/8.0/static/sql-createrule.html
> >
> > The attached patches makes the first look like the second.
>
> Applied, thanks.
Sorry I missed this before, but the first examples use of create rule on
*object* rather than *table* seems like something important enough to keep,
since obviously rules can be on more than just tables.
--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: create rule syntax
@ 2005-05-20 12:31 Neil Conway <neilc@samurai.com>
parent: Robert Treat <xzilla@users.sourceforge.net>
0 siblings, 0 replies; 6+ messages in thread
From: Neil Conway @ 2005-05-20 12:31 UTC (permalink / raw)
To: Robert Treat <xzilla@users.sourceforge.net>; +Cc: Kris Jurka <books@ejurka.com>; pgsql-docs
Robert Treat wrote:
> Sorry I missed this before, but the first examples use of create rule on
> *object* rather than *table* seems like something important enough to keep,
> since obviously rules can be on more than just tables.
I can't get too excited about this. CREATE RULE uses "table" as well,
and specifies that "table" really means "table or view". Similarly, the
INSERT syntax summary talks about "INSERT INTO table ...", although of
course you can insert into a view if the appropriate rule exists. A view
is a table in more ways than one...
-Neil
^ permalink raw reply [nested|flat] 6+ messages in thread
* Create Rule syntax.
@ 2006-03-17 06:05 Richard Broersma Jr <rabroersma@yahoo.com>
0 siblings, 1 reply; 6+ messages in thread
From: Richard Broersma Jr @ 2006-03-17 06:05 UTC (permalink / raw)
To: pgsql-docs
Hopefully this is the correct list to post this message.
I was comparing the rendering of the Create Rule Syntax regarding "(actions)" from the page:
http://www.postgresql.org/docs/8.0/interactive/rules-update.html
CREATE RULE rule_name AS ON event
TO object [WHERE rule_qualification]
DO [ALSO|INSTEAD] [action | (actions) | NOTHING];
^^^^^^^^^
to the syntax from the psql \h create rule.
Syntax:
CREATE [ OR REPLACE ] RULE name AS ON event
TO table [ WHERE condition ]
DO [ ALSO | INSTEAD ] { NOTHING | command | ( command ; command ... ) }
^^^^^^^^^^^^^^^^^^^^^^^^^
The diffences are not major. However, for a newbie like myself I felt the syntax of "(actions)"
was a little vague.
Regards,
Richard Broersma Jr.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Create Rule syntax.
@ 2006-03-17 06:24 Kris Jurka <books@ejurka.com>
parent: Richard Broersma Jr <rabroersma@yahoo.com>
0 siblings, 0 replies; 6+ messages in thread
From: Kris Jurka @ 2006-03-17 06:24 UTC (permalink / raw)
To: Richard Broersma Jr <rabroersma@yahoo.com>; +Cc: pgsql-docs
On Thu, 16 Mar 2006, Richard Broersma Jr wrote:
> Hopefully this is the correct list to post this message.
>
> I was comparing the rendering of the Create Rule Syntax regarding
> "(actions)" from the page:
>
> The diffences are not major. However, for a newbie like myself I felt
> the syntax of "(actions)" was a little vague.
>
This has been fixed in the 8.1 docs.
Kris Jurka
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2006-03-17 06:24 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-05-11 19:23 create rule syntax Kris Jurka <books@ejurka.com>
2005-05-20 01:37 ` Neil Conway <neilc@samurai.com>
2005-05-20 11:56 ` Robert Treat <xzilla@users.sourceforge.net>
2005-05-20 12:31 ` Neil Conway <neilc@samurai.com>
2006-03-17 06:05 Create Rule syntax. Richard Broersma Jr <rabroersma@yahoo.com>
2006-03-17 06:24 ` Re: Create Rule syntax. Kris Jurka <books@ejurka.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox