pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Preventing DELETEs
7+ messages / 4 participants
[nested] [flat]

* Preventing DELETEs
@ 2002-09-26 19:00  Rajesh Kumar Mallah. <mallah@trade-india.com>
  0 siblings, 3 replies; 7+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-09-26 19:00 UTC (permalink / raw)
  To: pgsql-sql

Hi ,

I have a created a database and a table in it,

I want to prevent "DELETES" on the table in this
database by everyone except superuser postgres.
even by me (the creator of this database and table)


I have tried in many ways (ALTER TABLE REVOKE DELETE .. etc etc)

but i  always end up with having the permission


can any one tell me how the prevention can be accomplished?

thanks in advance.

regds
mallah.



-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Preventing DELETEs
@ 2002-09-26 19:00  dima <_pppp@mail.ru>
  parent: Rajesh Kumar Mallah. <mallah@trade-india.com>
  2 siblings, 1 reply; 7+ messages in thread

From: dima @ 2002-09-26 19:00 UTC (permalink / raw)
  To: Rajesh Kumar Mallah. <mallah@trade-india.com>; +Cc: pgsql-sql

> I have a created a database and a table in it,
> 
> I want to prevent "DELETES" on the table in this
> database by everyone except superuser postgres.
> even by me (the creator of this database and table)
make superuser the database owner & grant the rights needed to the users





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Preventing DELETEs
@ 2002-09-26 19:09  Robert Treat <xzilla@users.sourceforge.net>
  parent: Rajesh Kumar Mallah. <mallah@trade-india.com>
  2 siblings, 1 reply; 7+ messages in thread

From: Robert Treat @ 2002-09-26 19:09 UTC (permalink / raw)
  To: Rajesh Kumar Mallah. <mallah@trade-india.com>; +Cc: pgsql-sql

In psuedo-code : create rule on mytable on delete return null

Robert Treat

On Thu, 2002-09-26 at 15:00, Rajesh Kumar Mallah. wrote:
> Hi ,
> 
> I have a created a database and a table in it,
> 
> I want to prevent "DELETES" on the table in this
> database by everyone except superuser postgres.
> even by me (the creator of this database and table)
> 
> 
> I have tried in many ways (ALTER TABLE REVOKE DELETE .. etc etc)
> 
> but i  always end up with having the permission
> 
> 
> can any one tell me how the prevention can be accomplished?
> 
> thanks in advance.
> 
> regds
> mallah.
> 
> 
> 
> -- 
> Rajesh Kumar Mallah,
> Project Manager (Development)
> Infocom Network Limited, New Delhi
> phone: +91(11)6152172 (221) (L) ,9811255597 (M)
> 
> Visit http://www.trade-india.com ,
> India's Leading B2B eMarketplace.
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Preventing DELETEs
@ 2002-09-26 19:17  Rajesh Kumar Mallah. <mallah@trade-india.com>
  parent: dima <_pppp@mail.ru>
  0 siblings, 0 replies; 7+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-09-26 19:17 UTC (permalink / raw)
  To: dima <_pppp@mail.ru>; +Cc: pgsql-sql



Hi Dima,

I currently have only one  user in the system
its me and superuser postgres.

every thing belongs to me currently.
and the programs connect as me. 


if make transfer the database ownership to postgres
will all the tables also get transfered to him?

it that case all programs will stop working.

can i transefer database ownership to postgres and 
allow myself ALL the PREVILEGES and selectively
REVOKE the DELETE permission from myself on the concerned
table?

If that is possible could you kindly tell me the commands

Current state is:

tradein_clients=> \l
     List of databases
      Name       |  Owner   
-----------------+----------
 template0       | postgres
 template1       | postgres
 tradein_clients | tradein (this is me)
(3 rows)
tradein_clients=> 


regds
Mallah.








On Friday 27 September 2002 00:30, dima wrote:
> > I have a created a database and a table in it,
> >
> > I want to prevent "DELETES" on the table in this
> > database by everyone except superuser postgres.
> > even by me (the creator of this database and table)
>
> make superuser the database owner & grant the rights needed to the users

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Preventing DELETEs
@ 2002-09-26 19:17  Dmitry Tkach <dmitry@openratings.com>
  parent: Rajesh Kumar Mallah. <mallah@trade-india.com>
  2 siblings, 1 reply; 7+ messages in thread

From: Dmitry Tkach @ 2002-09-26 19:17 UTC (permalink / raw)
  To: Rajesh Kumar Mallah. <mallah@trade-india.com>

I think this should work:

alter table mytable owner to postgres;
grant all on my table to public;
revoke delete on my table from public;

I hope, it helps...

Dima

Rajesh Kumar Mallah. wrote:
> Hi ,
> 
> I have a created a database and a table in it,
> 
> I want to prevent "DELETES" on the table in this
> database by everyone except superuser postgres.
> even by me (the creator of this database and table)
> 
> 
> I have tried in many ways (ALTER TABLE REVOKE DELETE .. etc etc)
> 
> but i  always end up with having the permission
> 
> 
> can any one tell me how the prevention can be accomplished?
> 
> thanks in advance.
> 
> regds
> mallah.
> 
> 
> 
> --=20
> Rajesh Kumar Mallah,
> Project Manager (Development)
> Infocom Network Limited, New Delhi
> phone: +91(11)6152172 (221) (L) ,9811255597 (M)
> 
> Visit http://www.trade-india.com ,
> India's Leading B2B eMarketplace.
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Preventing DELETEs
@ 2002-09-26 19:23  Rajesh Kumar Mallah. <mallah@trade-india.com>
  parent: Robert Treat <xzilla@users.sourceforge.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-09-26 19:23 UTC (permalink / raw)
  To: Robert Treat <xzilla@users.sourceforge.net>; +Cc: pgsql-sql

Hi Robert,

I will be obliged to receive the "real" code , if its
feasible  for you. I am not used RULEs before.


regds
mallah.

On Friday 27 September 2002 00:39, Robert Treat wrote:
> In psuedo-code : create rule on mytable on delete return null
>
> Robert Treat
>
> On Thu, 2002-09-26 at 15:00, Rajesh Kumar Mallah. wrote:
> > Hi ,
> >
> > I have a created a database and a table in it,
> >
> > I want to prevent "DELETES" on the table in this
> > database by everyone except superuser postgres.
> > even by me (the creator of this database and table)
> >
> >
> > I have tried in many ways (ALTER TABLE REVOKE DELETE .. etc etc)
> >
> > but i  always end up with having the permission
> >
> >
> > can any one tell me how the prevention can be accomplished?
> >
> > thanks in advance.
> >
> > regds
> > mallah.
> >
> >
> >
> > --
> > Rajesh Kumar Mallah,
> > Project Manager (Development)
> > Infocom Network Limited, New Delhi
> > phone: +91(11)6152172 (221) (L) ,9811255597 (M)
> >
> > Visit http://www.trade-india.com ,
> > India's Leading B2B eMarketplace.
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Preventing DELETEs
@ 2002-09-26 19:50  Rajesh Kumar Mallah. <mallah@trade-india.com>
  parent: Dmitry Tkach <dmitry@openratings.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-09-26 19:50 UTC (permalink / raw)
  To: Dmitry Tkach <dmitry@openratings.com>; +Cc: pgsql-sql



Hi Dmitry,

Got it working....
i made a small change.

On Friday 27 September 2002 00:47, you wrote:
> I think this should work:
>
> alter table mytable owner to postgres;
> grant all on my table to public;

instead of 
> revoke delete on my table from public;

i did :
 revoke delete on my table from tradein (which is me) ;

tradein_clients=> BEGIN WORK; delete from users  where userid=34866;
BEGIN
ERROR:  users: Permission denied.
tradein_clients=> ROLLBACK ;
ROLLBACK
tradein_clients=> UPDATE  users set password='mallah' where userid=34866;
UPDATE 1
tradein_clients=> 


does public not include me??

regds
mallah.





>
> I hope, it helps...
>
> Dima
>
> Rajesh Kumar Mallah. wrote:
> > Hi ,
> >
> > I have a created a database and a table in it,
> >
> > I want to prevent "DELETES" on the table in this
> > database by everyone except superuser postgres.
> > even by me (the creator of this database and table)
> >
> >
> > I have tried in many ways (ALTER TABLE REVOKE DELETE .. etc etc)
> >
> > but i  always end up with having the permission
> >
> >
> > can any one tell me how the prevention can be accomplished?
> >
> > thanks in advance.
> >
> > regds
> > mallah.
> >
> >
> >
> > --=20
> > Rajesh Kumar Mallah,
> > Project Manager (Development)
> > Infocom Network Limited, New Delhi
> > phone: +91(11)6152172 (221) (L) ,9811255597 (M)
> >
> > Visit http://www.trade-india.com ,
> > India's Leading B2B eMarketplace.
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2002-09-26 19:50 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-26 19:00 Preventing DELETEs Rajesh Kumar Mallah. <mallah@trade-india.com>
2002-09-26 19:00 ` dima <_pppp@mail.ru>
2002-09-26 19:17   ` Rajesh Kumar Mallah. <mallah@trade-india.com>
2002-09-26 19:09 ` Robert Treat <xzilla@users.sourceforge.net>
2002-09-26 19:23   ` Rajesh Kumar Mallah. <mallah@trade-india.com>
2002-09-26 19:17 ` Dmitry Tkach <dmitry@openratings.com>
2002-09-26 19:50   ` Rajesh Kumar Mallah. <mallah@trade-india.com>

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