Re: CREATE OR REPLACE VIEW/TRIGGER - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CREATE OR REPLACE VIEW/TRIGGER
Date
Msg-id 17056.1003899194@sss.pgh.pa.us
Whole thread Raw
In response to Re: CREATE OR REPLACE VIEW/TRIGGER  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: CREATE OR REPLACE VIEW/TRIGGER
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Our current CREATE OR REPLACE FUNCTION perserves the OID of the
> function.  Is there similar functionality you need where a simple
> DROP (ignore the error), CREATE will not work?
>>
>> If possible, it's nice to not have commands whose error codes you ignore.
>> That way if you see an error, you know you need to do something about it.

> Folks, is this a valid reason for adding OR REPLACE to all CREATE object
> commands?

Not until we do the necessary legwork.  I spent a good deal of time over
the past week making the various PL modules react to replacement of
pg_proc entries by CREATE OR REPLACE FUNCTION (cf. complaint from Peter
a week or so back).  CREATE OR REPLACE VIEW implies updating cached
query plans, and I'm not sure what CREATE OR REPLACE TRIGGER implies.
But I am pretty sure it's not a trivial question.

In short: put it on the todo list, but note that there are some
implications...

            regards, tom lane

pgsql-hackers by date:

Previous
From: bpalmer
Date:
Subject: Re: autoconf taking forever?
Next
From: Bill Studenmund
Date:
Subject: Re: CREATE OR REPLACE VIEW/TRIGGER