Re: triggers using the correct schema ..

From: "GIROIRE, Nicolas (COFRAMI)" <nicolas(dot)giroire(at)airbus(dot)com>
To: Paul Newman <pnewman(at)tripoint(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: triggers using the correct schema ..
Date: 2005-05-20 11:25:45
Message-ID: 5C40CD1E4697424ABDE3AC57CF1B22C62773B8@FR0-MAILMB20.res.airbus.corp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org]De la part de Paul Newman
Envoy : vendredi 20 mai 2005 13:04
: pgsql-general(at)postgresql(dot)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

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2005-05-20 11:45:11 Re: guids / bytea and index use ?
Previous Message Simon Riggs 2005-05-20 11:11:43 Re: [HACKERS] Inherited constraints and search paths (was Re: