Re: BUG #3628: Wrong schema picked

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG #3628: Wrong schema picked
Дата
Msg-id 46F78208.7040805@enterprisedb.com
обсуждение исходный текст
Ответ на BUG #3628: Wrong schema picked  ("Pedro Gimeno" <pgsql-001@personal.formauri.es>)
Ответы Re: BUG #3628: Wrong schema picked  (Pedro Gimeno <pgsql-001@personal.formauri.es>)
Re: BUG #3628: Wrong schema picked  (Pedro Gimeno <pgsql-001@personal.formauri.es>)
Список pgsql-bugs
Pedro Gimeno wrote:
> When a function has a SQL statement to execute that has an unqualified
> table, that SQL statement doesn't always pick the table from a schema in the
> search_path.

The first time the function is run, all the statements in it are planned
and the schema used for the insert is resolved. Subsequent calls will
reuse the same plan. The obvious fix is to always explicitly specify the
schema in the INSERT. Or if if you want it to depend on the search_path,
you can execute it dynamically using EXECUTE
(http://www.postgresql.org/docs/8.2/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN).

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: BUG #3627: Triple FK with ON DELETE SET NULL makes DELETE fail
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Memory Allocation Error