Temporary Views

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Temporary Views
Date: 2002-08-13 11:38:05
Message-ID: Pine.LNX.4.21.0208132105360.4471-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I'm thinking that temporary views should be pretty trivial to
implement.

* Allow temporary views

This should be as simple as modifying gram.y (to set
ViewStmt->view->istemp) and some logic in RemoveTempRelations() to remove
the view's rule

* Require view using temporary tables to be temporary views

This is the non-trivial part. If you are creating a view on just a
temporary table there's no problem. But what happens when do the
following?

CREATE VIEW abc AS select * from tab1,tab2,temp_tab3 ...

SQL99 avoids this with syntax rule 6 of 11.21 <view definition>

No <table reference> generally contained in the <query expression> shall
identify any declared local temporary table.

There are a few ways it could be implemented:

1) SQL99
2) Views whose <query epression> contains one or more <table references>
to temporary tables are created as temporary views
3) Views whose <query epression> contains one or more <table references>
to temporary tables must be explicitly include the TEMP[ORARY] syntax.

Thoughts?

Gavin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-08-13 11:38:40 Re: anoncvs currently broken
Previous Message Zeugswetter Andreas SB SD 2002-08-13 10:45:37 Re: [COMMITTERS] pgsql-server/src backend/tcop/postgres.cbacke