Can somebody let me know how I would remove an account from the posgreSQL database?

I can see the tables, but don’t know where the accounts are held or the sql statement to delete them.

Thank you.

  • ds12@beehaw.org
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    1 year ago

    This probably needs verification, so run at your own risk!

    The SQL statement to delete would be: DELETE from person where name = '...'

    person is the table of users.

    name = '...' is the condition for the row that is to be deleted.

    You can also modify the condition to, for example, delete a user using the id instead of their name (username).

    Here’s a link to the “schema” of the person table as generated by the backend code.

    • grant 🍞@toast.ooo
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      With federated services it’s generally a bad idea to fully delete an account, it’s better to mark the account as “deleted” so future requests can be notified of the deletion

      This also prevents people from impersonating others

  • BlueÆther@no.lastname.nz
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    I have used

    UPDATE person
    SET deleted = 't'
    WHERE id =nnnn;
    

    You can get the id’s from:

    SELECT id, name, published
    FROM person
    WHERE instance_id= 1 and deleted = 'f'
    ORDER by id;
    
  • lowleveldata
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    I have not searched but shouldn’t they have some database schema documentations such as ER diagrams?