Re: delay of function - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: delay of function
Date
Msg-id 20060301205316.GA82680@winnie.fuhr.org
Whole thread Raw
In response to Re: delay of function  (" Jaromír Kamler" <kamler@centrum.cz>)
Responses Re: delay of function  (" Jaromír Kamler" <kamler@centrum.cz>)
List pgsql-novice
On Wed, Mar 01, 2006 at 07:33:54PM +0100,  Jaromr Kamler wrote:
> This is not specific PostGIS question.

Then the purpose of the trigger on geometry_columns isn't clear.
PostGIS is a third-party extension that creates and maintains
geometry_columns for its own purposes; that table has no special
meaning to PostgreSQL.  Only PostGIS administrative functions would
ordinarily cause that trigger to fire.

> I do this, because I need collect some metadata about new tables(data
> about new spatial layer, like name, extend, time of creation, SRID, IP,
> owner, size and etc.). I know, that in the time, when is that trigger
> activated is not created that new table, ..., and this is my guestion.

Most of this metadata is available in the system catalogs or via
functions, so you needn't maintain it elsewhere.  Some of it can
be logged in the server's log files.  Here's some useful documentation:

http://www.postgresql.org/docs/8.1/interactive/catalogs.html
http://www.postgresql.org/docs/8.1/interactive/information-schema.html
http://www.postgresql.org/docs/8.1/interactive/functions-info.html
http://www.postgresql.org/docs/8.1/interactive/functions-admin.html
http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.html

(These links are to the 8.1 documentation; use the documentation
for whatever version you're running.)

> How I can call some function after creation that new table? I need wait
> until table is created and all records are inserted or I need find other
> way, but I do not know PostgreSQL so good.

PostgreSQL doesn't support triggers for actions like CREATE TABLE,
but it's still not clear that you need it.  Of the information you
listed above, only the time of creation and the IP address of the
creator (if that's what you mean) aren't available via functions
or the system catalogs, and they can be recorded in the server's
logs.  I'm not sure what you mean by "extend" as metadata.

Could you provide a high-level explanation of the problem you're
trying to solve?  The "what" instead of the "how."

--
Michael Fuhr

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Alternative to MS Access Last() function
Next
From: " Jaromír Kamler"
Date:
Subject: Re: delay of function