pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Column-level triggers in docs
3+ messages / 2 participants
[nested] [flat]

* Column-level triggers in docs
@ 2010-08-29 13:29  Thom Brown <thom@linux.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Thom Brown @ 2010-08-29 13:29 UTC (permalink / raw)
  To: pgsql-docs

I notice that the 9.0 docs page for CREATE TRIGGER doesn't indicate
column-level syntax in the synopsis:
http://www.postgresql.org/docs/9.0/static/sql-createtrigger.html

It does detail the additional syntax required for specifying a column
in the "event" parameter detail, but shouldn't this also be in the
synopsis?

So it would read something like:

CREATE TRIGGER name { BEFORE | AFTER } { event [ OF column_name [, ...
] ] [ OR ... ] }
    ON table [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments )

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Column-level triggers in docs
@ 2010-08-29 14:35  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Thom Brown <thom@linux.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2010-08-29 14:35 UTC (permalink / raw)
  To: Thom Brown <thom@linux.com>; +Cc: pgsql-docs

Thom Brown <thom@linux.com> writes:
> I notice that the 9.0 docs page for CREATE TRIGGER doesn't indicate
> column-level syntax in the synopsis:
> http://www.postgresql.org/docs/9.0/static/sql-createtrigger.html

My recollection is that we did it that way deliberately.  The originally
submitted patch tried to explain this as part of the syntax diagram,
but it was (a) confusing and (b) not correct in detail.

> So it would read something like:

> CREATE TRIGGER name { BEFORE | AFTER } { event [ OF column_name [, ...
> ] ] [ OR ... ] }

If you do this then it looks like "OF column_name" can be attached to
all four event types, which is wrong.  So you end up needing just as
much verbal annotation as in the current arrangement.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Column-level triggers in docs
@ 2010-08-29 14:42  Thom Brown <thom@linux.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Thom Brown @ 2010-08-29 14:42 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

On 29 August 2010 15:35, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thom Brown <thom@linux.com> writes:
>> I notice that the 9.0 docs page for CREATE TRIGGER doesn't indicate
>> column-level syntax in the synopsis:
>> http://www.postgresql.org/docs/9.0/static/sql-createtrigger.html
>
> My recollection is that we did it that way deliberately.  The originally
> submitted patch tried to explain this as part of the syntax diagram,
> but it was (a) confusing and (b) not correct in detail.

I missed the discussion is seems.

>> So it would read something like:
>
>> CREATE TRIGGER name { BEFORE | AFTER } { event [ OF column_name [, ...
>> ] ] [ OR ... ] }
>
> If you do this then it looks like "OF column_name" can be attached to
> all four event types, which is wrong.  So you end up needing just as
> much verbal annotation as in the current arrangement.

Ah, yes, I didn't consider that.  Fair enough.

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2010-08-29 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-08-29 13:29 Column-level triggers in docs Thom Brown <thom@linux.com>
2010-08-29 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-08-29 14:42   ` Thom Brown <thom@linux.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