Re: CREATE OR REPLACE AGGREGATE

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Robert James <srobertjames(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: CREATE OR REPLACE AGGREGATE
Date: 2011-12-15 17:56:31
Message-ID: CAHyXU0wnKG0MZ+FrKZmHLZYsKhZZcmR28Go6gOMf4y4uM_Ms+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Dec 15, 2011 at 11:29 AM, Robert James <srobertjames(at)gmail(dot)com> wrote:
> Is there anyway to do the equivalent of CREATE OR REPLACE AGGREGATE?
> Or - maybe even better - CREATE AGGREGATE if it doesn't already exist?

Well, you have DROP [IF EXISTS] which should cover at least some of
the use cases.

I'm not sure a OR REPLACE for aggreates is a good idea -- you can
already REPLACE the internal function (which is mostly what you need).
The aggregate itself mainly defines the input types, state, and
output types. The main advantage of replace is you get to preserve
the oid and avoid dependency issues -- if you are changing the
aggregate, it's pretty likely you'd have to go through that anyways.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tony Capobianco 2011-12-15 18:41:27 null tablespace?
Previous Message Robert James 2011-12-15 17:29:12 CREATE OR REPLACE AGGREGATE