Re: how to make functions multi-user safe?

Поиск
Список
Период
Сортировка
От Christoph Dalitz
Тема Re: how to make functions multi-user safe?
Дата
Msg-id 20021205093039.48675e84.christoph.dalitz@hs-niederrhein.de
обсуждение исходный текст
Ответ на how to make functions multi-user safe?  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-general
> Date: 04 Dec 2002 15:53:07 -0500
> From: Robert Treat <xzilla@users.sourceforge.net>
>
> Our goal: To have a multiuser-safe function that checks for the existence of a table.  If the table
> exists, it should return the name of the table.  If it does not exist, it will call another
> function that creates the table and then it should return the name of the table after it's been created.
>
The most basic rule in database design is that applications must not change the
database schema but only the database contents. According to this rule a function
that changes the schema and is called by several application users parallel is a
bad idea.

It is generally a wrong assumption that DDL statements can be run "multi user safe"
at all: eg. in Oracle DDL statements are not run in transactions (sorry, no rollback
for a "drop table") and are not allowed in stored procedures.

So what is the reasoning behind your odd function?
It is most probably a design flaw.

Christoph Dalitz

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

Предыдущее
От: "帅猛"
Дата:
Сообщение: install postgresql on cygwin error
Следующее
От: Hiroshi Inoue
Дата:
Сообщение: Re: passwords in pg_shadow (duplicate).