Thread: DDL Triggers

DDL Triggers

From
"Bob Pawley"
Date:
Could someone point me to documentation regarding DDL triggers in Postgresql?
 
Bob

Re: DDL Triggers

From
Steve Crawford
Date:
On 02/15/2012 08:25 AM, Bob Pawley wrote:
> Could someone point me to documentation regarding DDL triggers in
> Postgresql?
> Bob

No, because PostgreSQL does not have them (basically triggers on system
tables). There is a sparse wiki page to discuss the issue at
http://wiki.postgresql.org/wiki/DDL_Triggers and you can find plenty of
discussions of the issue in the mailing list archives.

Cheers,
Steve


Re: DDL Triggers

From
Adrian Klaver
Date:
On 02/15/2012 08:25 AM, Bob Pawley wrote:
> Could someone point me to documentation regarding DDL triggers in
> Postgresql?

You are going to need to be more specific. Are you talking triggers that
are activated by a DDL statement or a trigger that creates a DDL
statement? Also what pl language(s) are you using?

> Bob


--
Adrian Klaver
adrian.klaver@gmail.com

Re: DDL Triggers

From
"Bob Pawley"
Date:
I have a table that is generated through ogr2ogr.

To get ogr2ogr working the way I want, I need to use the -overwrite
function. If I use the append function information is lost. Something to do
with the way the switches work.

Overwrite drops the existing table and also the attached trigger .

I am attempting to have the dropped table trigger a function as it is being
populated by insert commands.

DDL trigger was mentioned as a possibility on the GDAL list.

Any suggestions will be welcome.

Bob


-----Original Message-----
From: Adrian Klaver
Sent: Wednesday, February 15, 2012 8:36 AM
To: Bob Pawley
Cc: Postgresql
Subject: Re: [GENERAL] DDL Triggers

On 02/15/2012 08:25 AM, Bob Pawley wrote:
> Could someone point me to documentation regarding DDL triggers in
> Postgresql?

You are going to need to be more specific. Are you talking triggers that
are activated by a DDL statement or a trigger that creates a DDL
statement? Also what pl language(s) are you using?

> Bob


--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: DDL Triggers

From
Adrian Klaver
Date:
On 02/15/2012 09:42 AM, Bob Pawley wrote:
> I have a table that is generated through ogr2ogr.
>
> To get ogr2ogr working the way I want, I need to use the -overwrite
> function. If I use the append function information is lost. Something to
> do with the way the switches work.
>
> Overwrite drops the existing table and also the attached trigger .
>
> I am attempting to have the dropped table trigger a function as it is
> being populated by insert commands.

How could you even hope to accomplish the above? If the table is dropped
there would be nothing to insert into.

>
> DDL trigger was mentioned as a possibility on the GDAL list.
>
> Any suggestions will be welcome.
>
> Bob
>


--
Adrian Klaver
adrian.klaver@gmail.com

Re: DDL Triggers

From
Lee Hachadoorian
Date:
On Wed, Feb 15, 2012 at 12:42 PM, Bob Pawley <rjpawley@shaw.ca> wrote:
I have a table that is generated through ogr2ogr.

To get ogr2ogr working the way I want, I need to use the -overwrite function. If I use the append function information is lost. Something to do with the way the switches work.

Overwrite drops the existing table and also the attached trigger .

I am attempting to have the dropped table trigger a function as it is being populated by insert commands.

DDL trigger was mentioned as a possibility on the GDAL list.

Any suggestions will be welcome.

Bob

Are you sure ogr2ogr is the right tool for what you want to accomplish? Reading between the lines, it *seems* like you intend to do an append (SQL INSERT), but ogr2ogr isn't working the way you want, forcing you to use overwrite (DROP/CREATE TABLE). Trying to use a DDL trigger seems like a roundabout way to get what you want when the problem is ogr2ogr.

So, I would back up and ask, what are you trying to do, and what information is being lost using -append?

Also, you mentioned asking this on the GDAL list, did you try the PostGIS list?

--Lee

--
Lee Hachadoorian
PhD, Earth & Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu/