Re: Proposal: Store "timestamptz" of database creation on "pg_database" - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Proposal: Store "timestamptz" of database creation on "pg_database"
Date
Msg-id m2wqw1ne14.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Proposal: Store "timestamptz" of database creation on "pg_database"  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: Proposal: Store "timestamptz" of database creation on "pg_database"
List pgsql-hackers
Fabrízio de Royes Mello <fabriziomello@gmail.com> writes:
> Event triggers don't cover "CREATE DATABASE" statement.

The reason why is because you create Event Triggers in a specific
database and they only get run when you happen to be connected to that
specific database.

So for example say you install your Event Trigger in the "postgres"
database but then do a CREATE DATABASE while connected to "mydb", the
Event Trigger is not installed and will not fire.

It's the same analysis about tablespaces and roles, for all global
objects in fact. I don't think there's much of a technical
implementation reason why not supporting Event Triggers on those, it's
all about POLA violation.

I personnaly think that given a good documentation coverage having Event
Trigger on global objects could be useful enough, even if you would have
to install them in every database when you want them to fire no matter
what.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: ILIKE vs indices
Next
From: Greg Stark
Date:
Subject: Re: ILIKE vs indices