Thread: Preventing DELETEs
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.
> 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
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
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 | postgrestemplate1 | postgrestradein_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.
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.
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 >
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.