Re: Cross-schema view issue/question

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: Joshua Tolley <eggyknap(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cross-schema view issue/question
Date: 2011-04-25 16:17:31
Message-ID: 4DB59E9B.7050505@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joshua Tolley wrote:
> On Thu, Apr 14, 2011 at 07:33:17PM -0700, Bosco Rama wrote:
>> 1) a function that removes/creates the views, etc in the 'xyz' schema
>> that gets called as part of the replacement process for schema 'abc'
>>
>> 2) replacing the views, etc. with functions that return tables or
>> the results of dynamic queries.
>>
>> 3) have the user create the views, etc. as 'temp' items in their
>> session each time. Though this may still conflict with the
>> replacement since there will still be a tight coupling between
>> the temp objects and the 'abc' schema and the replacement occurs
>> regardless of the current state of user connections.
>
> #2 will screw up query planning substantially; I'd steer clear of it. The
> other two options are essentially deciding whether you or your user will
> recreate the xyz objects each time you replace abc. That's kinda a religious
> issue, and depends on things like how stable your user expects the objects in
> xyz to be.

Thanks Joshua. While not for the planner performance reason, we also ended up
rejecting #2. We tried a quick sample of both of the other two options and
decided to go with #1. It seemed to be the least intrusive upon the user. Even
though they have to maintain the function(s) to drop/create the views (we gave
them templates to work from) all other aspects of their application and schema
remained untouched. This weekend was the first true test of it and it seemed to
work just fine.

Thanks again,
Bosco.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-04-25 17:24:16 Re: Problem with sorting on PostgreSQL 9.0.3
Previous Message Phoenix Kiula 2011-04-25 16:16:17 Re: Help - corruption issue?