Обсуждение: Re: can postgres do this?

Поиск
Список
Период
Сортировка

Re: can postgres do this?

От
Thomas Lockhart
Дата:
(on list; interesting topic)

> Tom, I'm looking at an oracle script and seeing something I haven't seen
> before.  Is this something oracle specific?  Can Postgres do it?
> CREATE OR REPLACE procedure inc_char_for_sort_key (old_char IN OUT CHAR,
> carry_p OUT INTEGER)
> It goes on, but it's the CREATE OR REPLACE part that I'm interested in.

That's interesting. In our case, you would do a "drop function" and
then the "create function" as a two step process. Oracle simplifies it
a bit for you. I'm not sure why we throw an error if you drop a
function which does not exist, since that makes it tough to blindly do
the "drop/create" pair. Why don't we just signal a warning or notice
instead?
                    - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


Re: [HACKERS] Re: can postgres do this?

От
Tom Lane
Дата:
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> I'm not sure why we throw an error if you drop a
> function which does not exist, since that makes it tough to blindly do
> the "drop/create" pair. Why don't we just signal a warning or notice
> instead?

It doesn't matter unless you are inside a transaction --- but I can
see the value of replacing a function definition inside a transaction.

Perhaps "no such <whatever>" should be downgraded from ERROR to NOTICE
for all DROP-type commands.  Another TODO item...
        regards, tom lane