Re: Alter Columns with Triggers

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Adrian Parker <adrian(dot)l(dot)parker(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Alter Columns with Triggers
Date: 2011-07-13 00:09:38
Message-ID: 4E1CE242.2000506@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/07/2011 9:23 AM, Adrian Parker wrote:
> Is there a quick and easy fix? Currently I'm copying/pasting the
> drop/create statements from pgadmin (its very slow and error prone)
> and putting them in my python source.
>
I don't know about "quick and easy", but you can get the trigger
function sources from pg_catalog using your Python program. The
argument types and function names are also there, which gives you enough
information to programmatically generate CREATE and DROP statements for
the functions, as well as ALTER TABLE functions to add and remove the
triggers.

As for dependencies: doesn't PL/PgSQL only check the existence of
functions called, etc, once a procedure is actually executed? I can't
remember for sure, but it might not prove to be an issue.

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088 Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-07-13 00:33:56 Re: No suitable driver found for jdbc:postgresql [error]
Previous Message Craig Ringer 2011-07-13 00:00:50 Re: help for xml create in postgresql