Re: Schema search_path and views

From: "Just Someone" <just(dot)some(at)gmail(dot)com>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Schema search_path and views
Date: 2006-11-06 18:29:28
Message-ID: 36932f270611061029ncddd52ej322216a71be2c4f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cool!

That explains it fully. So i guess there will be a better performance
to the pre-generated views at the price of more views.

Thanks!

On 11/6/06, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:
> On 11/6/06, Just Someone <just(dot)some(at)gmail(dot)com> wrote:
> > I have a database with multiple schemas all with the same structure
> > (but of course different data...).
> >
> > I want to create a view that will be created in a shared schema, and
> > when executed will be executed against the current schema. Whenever I
> > try it, it seems the view is linked to a specific schema used when
> > creating it, and doesn't reevaluates based on the current schema.
>
> no, or not exactly. views resolve the search path when they are
> generated. this is a fundemental part of how they work. functions,
> however, are a bit different. the plans are lazily generated and
> 'stick' to the tables that are resolved in the search path when the
> plan is generated, which is basically the first time you run them in a
> session. so, you could in theory do what you want with a view if it
> called functions for all the switchable parts.
>
> merlin
>

--
Family management on rails: http://www.famundo.com - coming soon!
My development related blog: http://devblog.famundo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-11-06 18:56:20 Re: timezone difference in timestamp?
Previous Message Matt Miller 2006-11-06 18:25:09 cvs HEAD initdb: vacuuming database template1 ... FATAL: could not identify a comparison function for type aclitem