[GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Paul Newman
Hi, We run with multiple identical schemas in our db. Each schema actually represents a clients db. What wed like to do is have a common schema where trigger functions and the like are held whilst each trigger defined against the tables is in there own particular schema. This would mean

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Louis Gonzales
Paul Newman wrote: Hi, We run with multiple identical schemas in our db. Each schema actually represents a clients db. What wed like to do is have a common schema where trigger functions and the like are held whilst each trigger defined against the tables is in there own

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Scott Marlowe
On Wed, 2006-03-08 at 14:19, Louis Gonzales wrote: Paul, When you say multiple identical schemas are they all separate explicit schemas? Or are they all under a general 'public' schema. From my understanding, when you create a new db instance, it's under the public level schema by

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Louis Gonzales
Scott Marlowe wrote: On Wed, 2006-03-08 at 14:19, Louis Gonzales wrote: Paul, When you say "multiple identical schemas" are they all separate explicit schemas? Or are they all under a general 'public' schema. >From my understanding, when you create a new db instance, it's under

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Scott Marlowe
On Wed, 2006-03-08 at 14:32, Louis Gonzales wrote: Scott Marlowe wrote: On Wed, 2006-03-08 at 14:19, Louis Gonzales wrote: Paul, When you say multiple identical schemas are they all separate explicit schemas? Or are they all under a general 'public' schema. From my

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Michael Fuhr
On Tue, Mar 07, 2006 at 06:34:33AM -, Paul Newman wrote: However at the moment we are placing the trigger functions within each schema along with trigger itself. The reason is that we don't know of a function or a variable that says Give me the schema of the trigger that is calling this

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Louis Gonzales
Paul, What is the current schema layout for your db instances? I don't think it's possible to share across db instances like this: dbname1.myschema.sometable dbname2.myschema.sometable But you can share resources of the following type: dbname.myschema1.sometable dbname.myschema2.sometable

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Richard Huxton
Paul Newman wrote: Hi, We run with multiple identical schemas in our db. Each schema actually represents a clients db. What we'd like to do is have a common schema where trigger functions and the like are held whilst each trigger defined against the tables is in there own particular schema.

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Paul Newman
-Original Message- From: Louis Gonzales [mailto:[EMAIL PROTECTED] Sent: 08 March 2006 20:43 To: Scott Marlowe Cc: Paul Newman; pgsql general Subject: Re: [GENERAL] Triggers and Multiple Schemas. Paul, What is the current schema layout for your db instances? I don't think it's possible to share

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Michael Fuhr
On Wed, Mar 08, 2006 at 11:16:55PM -, Paul Newman wrote: So how can I get the schema name of the calling table trigger and use it in the form of set Search_path at the beginning of the function ? Here's an example: CREATE FUNCTION trigfunc() RETURNS trigger AS $$ DECLARE schemaname

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Paul Newman
; Scott Marlowe; pgsql general Subject: Re: [GENERAL] Triggers and Multiple Schemas. On Wed, Mar 08, 2006 at 11:16:55PM -, Paul Newman wrote: So how can I get the schema name of the calling table trigger and use it in the form of set Search_path at the beginning of the function ? Here's