How to Drop User or Role in PostgreSQL Instance on Google Cloud Platform | GCP Tutorials 2022

Topic: How to Drop User or Role in PostgreSQL Instance on Google Cloud Platform


How to Drop User or Role in PostgreSQL Instance on Google Cloud Platform | GCP SQL Tutorial 2022, in this video we are going to learn How to Drop User or Role in PostgreSQL Instance on Google Cloud Platform | GCP SQL Tutorial 2022

Script: ERROR: role "aamir" cannot be dropped because some objects depend on it DETAIL: owner of database test 1 object in database test SQL state: 2BP01 Error Invalid request: failed to delete user aamir: . role "aamir" cannot be dropped because some objects depend on it Details: owner of database test 1 object in database test. 0) Prepare the scenario Create user aamir and then create some objects create database Test create table public.mytable(id int, name varchar(100)); insert into public.mytable values(1,'aamir'); Select * from public.mytable; 1) -- Let's think about a user who has left the company and you need to drop the user. If you don't know the --password for the user, login by using postgres user and change the password of user. --How to change the password for role Alter role aamir LOGIN password 'Test123$'; 2) -- Tried to drop the role by using postgres user session drop role aamir -- you will get errot that objects are owened by user aamir GRANT postgres to aamir; --2 -- login by aamir user and run below command to assign all objects to postgres user REASSIGN OWNED BY aamir TO postgres; --3 login back to postgres and run below drop role aamir --4 Check if Objects are not dropped by dropping user.


 

Video Demo: How to Drop User or Role in PostgreSQL Instance on Google Cloud Platform

9 comments:

  1. To remove a user or role from PostgreSQL, use the DROP ROLE or DROP USER commands. This deletes the user or role from the database, as well as any related rights. Dropping users and roles should be done with caution because this action cannot be reversed. https://www.helpwithdissertation.co.uk/research-topics/google-scholar-research-topics/

    ReplyDelete
    Replies
    1. Thank you for a short explanation, The post was too difficult for me to understand the errors. I have many encountered few problems in SQL that I need to solve urgently but I guess I need to let someone do my MBA assignment to detect the errors.

      Delete
  2. Victim of a BTC Scam? Contact Ultimate Hacker Jerry to recover your Lost Bitcoin.

    Have you ever been a victim of a scam? or have you Suffered a loss from a Fraudulent Ponzi Scheme? I implore you to Contact Ultimate Hacker Jerry, A Certified hacker and Lost Crypto Recovery Expert. I once fell victim to an online imposter who convinced me to invest in a phoney Cryptocurrency scheme by claiming to have made large profits from the plan. My Trezor wallet contained $219,100 in Crypto that I lost, I had been reporting to the Authorities tirelessly for a longtime without getting assistance before I finally got in touch with Ultimate Hacker Jerry. Fortunately after a serious conversation with Ultimate Hacker Jerry all my funds were recovered back.
    I recommend this Expert to any victim who has lost Crypto to any fake online Ponzi Scheme..

    Get in touch with ULTIMATE HACKER JERRY
    Through ; Mail (Ultimatehackerjerry@seznam. cz)
    WhatsAp, (+1,5/20,2827,15,1)

    ReplyDelete
  3. Ich habe beschlossen, meine Erfahrungen mit dem Online-Casino https://zetcasinos.de/ zu teilen. Mir fällt sofort die Bequemlichkeit der Website auf - alles ist intuitiv, ohne unnötige Fummeleien. Sehr zufrieden mit der Vielfalt der Spiele - hier findet jeder etwas nach seinem Geschmack, ob es Slots oder klassische Tischspiele sind. Übrigens sind auch die Boni hier top, vor allem für Anfänger. Und um ehrlich zu sein, die Auszahlung des Geldes verlief reibungslos, ohne unnötigen Ärger.Wenn Sie also Ihr Glück versuchen wollen, empfehle ich Ihnen, ZetCasinos eine Chance zu geben.

    ReplyDelete
  4. Thanks for sharing this informative tutorial on dropping users or roles in PostgreSQL on Google Cloud Platform! For further insights into database management and related topics, I recommend checking out the Pangea Global blog. Their expertise in multilingual communication could offer valuable perspectives for enhancing your database administration skills. Keep up the great work!

    ReplyDelete
  5. 论文代写润色机构是否可靠,取决于多种因素。选择一个正规且可信赖的机构需要学生投入时间和精力去考察机构的信誉、团队背景、客户反馈以及服务合同等细节。此外,收费标准也因多种因素而异,如学术水平、专业领域、字数和紧急程度等。学生在选择代写https://www.lunwentop.net/润色服务时,应根据自身需求和预算选择合适的服务,同时保持警惕,避免选择低价低质或不具备合法资质的机构。最终,通过合理选择,学生可以有效提高论文质量,确保顺利完成学业。

    ReplyDelete
  6. One of the key reasons players flock to Royal Reels Casino https://royalreels8.xyz/ is its commitment to fairness and security. The platform is fully licensed and uses advanced encryption technology to ensure that all transactions and personal data remain protected. Additionally, all games are powered by certified Random Number Generators (RNGs), guaranteeing fair and transparent outcomes.

    ReplyDelete
  7. SELLING FRESH LEADS, FULLZ, DATABASE
    USA SSN – UK NIN – CANADA SIN
    verified and freshly updated 2025

    USA FULLZ | UK FULLZ | CANADA FULLZ
    =SSN DL front back with Selfie
    =Passport photo
    =UK DL
    =Canada DL
    =EIN INFO
    =Business owner Leads
    =Payday & Personal loan Leads
    =First hit Sweepstakes Leads
    =Casinos database
    =Home owners Leads
    =Employee Leads
    =USA Bank Leads
    =Phone numbers & Email leads
    =Mortgage Leads
    =Crypto & Forex Leads
    =Stock Market Trader Leads
    =Education Leads
    =Cars data base with registration number
    =Loan Method & Carding Method
    Many other stuff available…

    All info will be fresh and updated
    Wrong and invalid data will be replaced
    Stuff delivery after payment proof
    Payment mode only crypto
    Available 24/7

    For deals & discounts contact us
    What’s APP = +1.. 605.. 8461… 870
    TELE GRAM = @ lead_pro20
    E-mail = datatrader 3 at Gmail dot com

    ReplyDelete
  8. I’m genuinely impressed by how your topics always pull me in! Your writing is clear, relatable, and packed with helpful info, making every piece a joy to read. It's easy to see the heart and hard work you put into your content — and it truly shows! brown leather jacket

    ReplyDelete