Re: Wishlist?

Поиск
Список
Период
Сортировка
От Roman Neuhauser
Тема Re: Wishlist?
Дата
Msg-id 20050722155735.GD16687@isis.sigpipe.cz
обсуждение исходный текст
Ответ на Re: Wishlist?  (Ezequiel Tolnay <mail@etolnay.com.ar>)
Ответы Re: Wishlist?  (Ezequiel Tolnay <mail@etolnay.com.ar>)
Список pgsql-general
# mail@etolnay.com.ar / 2005-07-22 12:41:25 +1000:
> Tom Lane wrote:
> >Bruno Wolff III <bruno@wolff.to> writes:
> >>What happens if there is more than one existing function with that name
> >>already. Do all of the old functions get deleted?
> >
> >What happens if there are existing references to the function using the
> >old parameter list?
> >
> >The current approach is that if you want to change the parameter list or
> >result type, you have to issue DROP FUNCTION, with the resulting cascade
> >of any dependent objects.  I think trying to change that would be a very
> >bad idea.  It'd create a real mess in terms of consistency of views, and
> >what does it really buy you notationally over DROP/CREATE?
>
> What I see is that the overloading is a very cool feature, but is not
> necessary in most cases, and it introduces unnecessary administration
> hassles. If there would be an attribute stating if a procedure has been
> created overlodable (enabled by default, for backwards-compabitility),
> then CREATE OR REPLACE would always replace the current one, regardless
> of the parameters, and DROP would not require any parameters at all, and
> a creation of a function with the NOOVERLOAD attribute would not be
> allowed if there is already a function marked for overloading.

    What would your hassle-free CREATE OR REPLACE do in this situation?
    What should the fiew look like after you replace foo() with
    foo(int4)?

    CREATE TYPE t1 AS (
     a INTEGER,
     b INTEGER,
     c INTEGER
    );
    CREATE TYPE t1 AS (
     a TEXT,
     c TEXT
    );

    CREATE FUNCTION foo() RETURNS SETOF t1 ...

    CREATE VIEW fiew AS SELECT a * b, c FROM SELECT foo();

    CREATE OR REPLACE FUNCTION foo(INTEGER) RETURNS SETOF t2 ...

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

В списке pgsql-general по дате отправления:

Предыдущее
От: Alex Stapleton
Дата:
Сообщение: Re: RAMFS with Postgres
Следующее
От: "Solange"
Дата:
Сообщение: PostgreSQL + windows xp + ipv6