Re: triggers using the correct schema ..

Поиск
Список
Период
Сортировка
От GIROIRE, Nicolas (COFRAMI)
Тема Re: triggers using the correct schema ..
Дата
Msg-id 5C40CD1E4697424ABDE3AC57CF1B22C62773B8@FR0-MAILMB20.res.airbus.corp
обсуждение исходный текст
Ответ на triggers using the correct schema ..  ("Paul Newman" <pnewman@tripoint.co.uk>)
Список pgsql-general
Hi,
you can use
SET search_path TO :"defaultSchema";
with replacing "defaultSchema" by the name of schema you want as default.
 
Then all create are automatically done in this schema.
 
Nicolas

 -----Message d'origine-----
De : pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org]De la part de Paul Newman
Envoyé : vendredi 20 mai 2005 13:04
À : pgsql-general@postgresql.org
Objet : [GENERAL] triggers using the correct schema ..

Hi,

We have lots of schemas .. one of which is public. They all have the same set of tables and some of these have triggers. However when a trigger is fired in a schema it works on tables in the public schema instead of the “current” schema. We can put a statement similar to set search_path = “schema_x”; in the front of each trigger … but we use a script to generate these schemas so means doing a search and replace for each creation that we do. Is there a CURRENT SCHEMA type of command such that we could do …. Set search_path = CURRENT SCHEMA ?????

 

Thanks

Paul Newman

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] Inherited constraints and search paths (was Re:
Следующее
От: Neil Conway
Дата:
Сообщение: Re: guids / bytea and index use ?