pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brian Powell <brian@owlscreech.com>
To: pgsql-sql@postgresql.org
Subject: 7.1.1 Lock Problems on Views
Date: Thu, 31 May 2001 09:33:11 -0600
Message-ID: <200105311532.JAA16968@sisyphus.owlscreech.com> (raw)

Greetings,

I am investigating whether our application will run on 7.1.1 (from 
7.0.3), and our client software only accesses the database through views 
for security and convenience.

In our client app, we lock our table before doing something to it.  
Fortunately, in 7.0.3, a view looked like a table and we could perform:

lock v_whatever in share row exclusive mode;

However, in 7.1.1, it comes back and tells me that:

ERROR:  LOCK TABLE: v_whatever is not a table

The HUGE advantage in 7.0.3 was that we could present our db through 
views and the client didn't have to know.

I tried to put the lock statements into the rule of each view when the 
rule does the actual work, such as:

create rule v_whatever_insert as on insert to v_whatever
   do instead (
     lock whatever in share row exclusive mode;
     insert into whatever (blah) values (new.blah);
   );

However, the view won't be created, it claims there is a syntax error.

So, with 7.1.1, how can I create views and lock the data when modifying 
the table?

Thanks,

--Brian



view thread (3+ messages)  latest in thread

Message-ID: <200105311532.JAA16968@sisyphus.owlscreech.com>
Permalink:  ../200105311532.JAA16968@sisyphus.owlscreech.com/
Also on:    postgresql.org/message-id/200105311532.JAA16968@sisyphus.owlscreech.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: brian@owlscreech.com
  Subject: Re: 7.1.1 Lock Problems on Views
  In-Reply-To: <200105311532.JAA16968@sisyphus.owlscreech.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox