Parsing of VIEW definitions

From: Eric B(dot)Ridge <ebr(at)tcdi(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Parsing of VIEW definitions
Date: 2003-02-08 04:12:43
Message-ID: 91FC7D98-3B1B-11D7-9ECF-0003937E3354@tcdi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm just curious...

If you have a view:
create foo_view as select * from foo;

Then you query it:
select * from foo_view;

What, behind the scenes, actually happens?

Is the definition of "foo_view" looked up in the system catalog, query
rewritten, parsed, then executed?

In other words, does the query *literally* get rewritten as:
select * from (select * from foo) as foo;
before it is parsed?

eric

Responses

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2003-02-08 05:53:50 Re: inherited, unique serial field...
Previous Message John Smith 2003-02-08 01:07:43 Re: selects with large offset really slow