Re: Was: Triggers, Stored Procedures, PHP

From: Shane D <shane(dot)dawalt(at)wright(dot)edu>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Was: Triggers, Stored Procedures, PHP
Date: 2003-11-30 02:48:40
Message-ID: 3FC95A88.3020708@wright.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Doug McNaught wrote:

> It's false. You can treat a view just like a table and add clauses to
> your query that restrict it beyond what the view gives you. I think
> that's what you're asking about...

Thanks for your reply.

I found an example in the postgresql reference manual in the "CREATE
VIEW" section that shows exactly what you said (reproduced below).

CREATE VIEW kinds AS
SELECT *
FROM films
WHERE kind = ’Comedy’;

The manual uses the view thusly:

SELECT * FROM kinds;

But what if the films table also had a field for the production
company. This implies based on the view definition that it too, has the
field (call it prod_co). Could I use the following query to select all
Comedy films distributed by the 'Small Company' production company?

SELECT * FROM kinds WHERE prod_co = 'Small Company';

Yes this is contribed, but humor me please.

Shane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2003-11-30 03:17:01 Re: PostgreSQL, MySQL, etc., was Re: PostgreSQL is much
Previous Message Alex Satrapa 2003-11-30 01:15:05 Re: [GENERAL] PostgreSQL certifications?

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2003-11-30 03:28:39 Re: Was: Triggers, Stored Procedures, PHP
Previous Message Gaetano Mendola 2003-11-30 02:21:23 Re: *sigh*