DDL triggers [was Re: database constraints]

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Ben <bench(at)silentmedia(dot)com>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: DDL triggers [was Re: database constraints]
Date: 2004-10-07 19:40:38
Message-ID: 20041007194038.GD27640@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Oct 07, 2004 at 11:47:55AM +0700, David Garamond wrote:
> Joshua D. Drake wrote:
> >>This brings up an interesting idea. What if it were possible to set
> >>some kind of rules on DDL at database creation time? For example, I'd
> >>like to be able to throw an error if somebody tries to name an object
> >>any of the SQL keywords.
> >>
> >>Other possible rules:
> >>
> >>* Every table must have a comment
> >>* noCamelCaps
> >>* downcase all entities
> >>* underbar_separators_required
> >>* abbrev_w_beg, nt_by_rmvng_vwls
> >>* Your favorite algorithmic coding standard here
> >
> >Hmmm.. like a PostgreSQL syntax mode... in the PostgreSQL.conf:
> >
> >syntax_mode = lazy, standard, strict
> >
> >Where lazy is the current , standard would throw exceptions if you
> >try to use a reserved word or use uppercase, and strict would do
> >things like force a comment.
>
> I'd much prefer if PostgreSQL had a generalized event or trigger
> system. That way, one can install a trigger (or a plugin, or
> whatever) to trap CREATE TABLE, CREATE VIEW, etc.
>
> IMO, your proposed solution is too specific. There are too many
> coding styles that people might want to enforce in their
> environment.

Forwarding to -hackers...

Folks,

How big a project would it be to have generalized DDL triggers? Apart
from resource allocation, what are some downsides of providing such a
facility?

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steven Klassen 2004-10-07 19:52:59 Re: PSQL undesired transaction behavior when connection is lost.
Previous Message Steven Klassen 2004-10-07 19:33:34 Re: PSQL undesired transaction behavior when connection is lost.

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2004-10-07 19:47:27 Re: [HACKERS] Call for BOFs Linux World Expo Boston
Previous Message Tom Lane 2004-10-07 19:32:16 Re: [PATCHES] HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX