Parsing of VIEW definitions - Mailing list pgsql-general

From Eric B.Ridge
Subject Parsing of VIEW definitions
Date
Msg-id 91FC7D98-3B1B-11D7-9ECF-0003937E3354@tcdi.com
Whole thread Raw
Responses Re: Parsing of VIEW definitions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-general by date:

Previous
From: "Ricardo Ryoiti S. Junior"
Date:
Subject: Re: Soft Updates/FFS and Postgresql
Next
From: will trillich
Date:
Subject: Re: inherited, unique serial field...