Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > Here's a patch I put together. I thought the Oracle-style 'CREATE OR
> > REPLACE FUNCTION' syntax might be useful to those doing lots of function
> > creation/development. It is against the 7.1.3 source.
> BTW, I've been assuming that when we got around to providing a
> capability like this, it'd be via an "ALTER FUNCTION" kind of
> statement. Does anyone have a strong feeling pro or con on whether
> "CREATE OR REPLACE" is a preferable approach? It doesn't seem to
> fit with the spirit of our other maintenance commands, but maybe
> we should just bow down before the Oracle and do it their way...
ALTER FUNCTION seems strange to me, since the point of CREATE OR
REPLACE FUNCTION really is to create the function. OR REPLACE is a
convenience feature when loading PL/SQL (or PL/pgSQL) files into the
database: you don't have to add a DROP FUNCTION command before each
CREATE FUNCTION command, and you don't have to look at all the
comments or warnings about dropping functions.
We actually have an implementation of CREATE OR REPLACE FUNCTION at
Zembu which I've never bothered rolling up and sending in. It simply
drops the function first.
In response to
pgsql-patches by date
|Next:||From: Marko Kreen||Date: 2001-09-22 01:10:05|
|Subject: pgcrypto update|
|Previous:||From: Liam Stewart||Date: 2001-09-20 20:24:45|
|Subject: JDBC test suite patch|