Re: Views - Under the Hood

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Chris Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Views - Under the Hood
Date: 2010-11-04 20:46:05
Message-ID: 4CD31B8D.7030808@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/11/2010 19:58, Chris Browne wrote:
> Under the hood, views represent a rewriting of the query.
>
> http://www.postgresql.org/docs/8.4/static/rules-views.html
>
> If you have two tables that are joined together, in a view, then when
> you query the view, you're really running a more complex query than
> you're seeing, namely one that joins together the two tables, and does
> whatever else you put into your query.
>
> It *looks* like a table, for almost all intents and purposes, but what
> it is, really, is a structure that leads to your queries being rewritten
> to access the *real* tables that underly the view.

Besides not being able to write to views without adding extra rules, are
there are other intents and purposes for which a view doesn't look like
a table?

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Kerr 2010-11-04 20:54:42 pg_hba LDAP Authentication syntax
Previous Message Ivano Luberti 2010-11-04 20:43:49 Re: Views - Under the Hood