disallow LOCK on a view - the Tom Lane remix
Here is a patch against CVS (without my earlier patch)
to disallow
LOCK x
if x is a view.
It does not use the SPI interface.
--
Mark Hollomon
mhh@mindspring.com
Attachments:
lock.patchtext/plain; charset=us-asciiDownload+101-33
* Mark Hollomon <mhh@mindspring.com> [000829 17:13] wrote:
On Tue, Aug 29, 2000 at 04:14:00PM -0700, Alfred Perlstein wrote:
Ok, I'm wondering if this patch will cause problems locking a table
that has had:CREATE RULE "_RETfoo" AS ON SELECT TO foo DO INSTEAD SELECT * FROM foo1;
I need to be able to lock the table 'foo' exclusively while I swap
out the underlying rule to forward to another table.Yes, it would. 'foo' would be seen as view.
Okay, this gives me a reason to to do it the hard way.
I will try to add a relisview attribute to pg_class.
That way, we can differentiate between tables with rules
and things created with 'CREATE VIEW'.Hmmm... guess I'll need to change the definition of the pg_views
view as well.
Ok, thanks I appreciate you taking my situation into consideration.
thanks,
--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
Import Notes
Reply to msg id not found: 20000829210300.B25366@mindspring.com
Tom Lane wrote:
BTW, this seems to be a counterexample for my prior suggestion that
pg_class should have a "relviewrule" OID column. If it did, you'd
have to update that field when doing something like the above.
Pain-in-the-neck factor looms large...
I was already considering the possiblity of a 'ALTER VIEW' command that
would effectively allow you do that.
CREATE VIEW bar as select * from foo1;
ALTER VIEW bar as select * from foo2;
It would update the "relviewrule" field.
--
Mark Hollomon
mhh@nortelnetworks.com
ESN 451-9008 (302)454-9008
OK, previous patch unapplied, and this patch was applied.
Here is a patch against CVS (without my earlier patch)
to disallowLOCK x
if x is a view.
It does not use the SPI interface.
--
Mark Hollomon
mhh@mindspring.com
[ Attachment, skipping... ]
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026