Thread: Modifying triggers in database in use...

Modifying triggers in database in use...

From
Daniel Sjölie
Date:
I've sent this once before but it didn't seem to get through
(couldn't find it in the archive)

Hi...

What is the recommended way to make changes to a database in use?

The database is not critical, I can take it down for a day or so but I'd
rather not (or as little as possible anyway). What bothers me is how
hard it is to update functions (primarily triggers) in a nice way.

Using a procedural language is a lot easier but I find it a real pain to
edit functioins created in this way since they're only stored in the
database. You have to retrieve them, edit them and then update them.

Is there a nice way to keep the source elsewhere and reload it in some
simple way? I tried editing database dumps but that feels really bad.

Or would You reccomend that I just get a grip and code it all in C?
(I started but my lazy self really doesn't like it when I know it can be
done so much easier in a procedural language :)

/Daniel (not subscribed)

PS pl/perl doesn't seem to work in debian. Any tips?

--
Now take a deep breath, smile and don't take life so seriously... :)

Re: Modifying triggers in database in use...

From
Daniel Sjölie
Date:
> On Wed, 16 Aug 2000, Daniel Sjölie wrote:
>
> > What bothers me is how
> > hard it is to update functions (primarily triggers) in a nice way.
> >
> > Using a procedural language is a lot easier but I find it a real pain to
> > edit functioins created in this way since they're only stored in the
> > database. You have to retrieve them, edit them and then update them.
> >

On 2000-08-17 07:40:36, Bob Parkinson wrote:
> How about keeping the stuff in an external file, then drop the function
> and trigger, and do a psql -d the_database -f the_code to reload.
>
> If you drop functions you must also drop the trigger associated with it
> (it one exists).

Well, yeah, that's pretty much what I meant here:

> > Is there a nice way to keep the source elsewhere and reload it in some
> > simple way? I tried editing database dumps but that feels really bad.

I was hoping for a better way but I guess it works...
(I don't like to have to drop everything just to tune a variable in a
function, (I think) I've seen signs that some things (cached oids?) make
(some) trouble when You do this)
What I'd really like would be something like specifying the source file
where the function is stored when You create the function instead of the
actual code - kinda like You specify an object file when You define a C
function... It doesn't feel like an unreasonable feature to me...

> This bit has been in the archives recently.

I'm having trouble finding it... pointers?

/Daniel (not subscribed)

--
Now take a deep breath, smile and don't take life so seriously... :)