CHAPTER 29 (Post office web site) SECURING POSTGRESQL DROP USER username
CHAPTER 29 SECURING POSTGRESQL DROP USER username The DROP USER command eliminates the user from any and all databases within a cluster. If the user owns a database, an error will be raised and the user will not be deleted. The same is not true of other objects within a database, though. Dropping the user will leave any such objects within the database intact. However, you might end up with permission issues in the future should you need to manipulate the object in some way that requires you to be the object s owner. Working with PostgreSQL Groups While PostgreSQL s user system is flexible, it isn t always the most convenient system to work with when you are dealing with a large number of users and privileges. To help ease this task, PostgreSQL also provides a group system, similar to the group concept used in many operating systems. With groups, you can assign a number of users to a group, set permissions at the group level, and then manipulate these privileges for all users in a single go. Adding Groups Adding new groups to PostgreSQL is accomplished through the CREATE GROUP command, which has the following syntax: CREATE GROUP groupname [ WITH ] SYSID gid | USER username [, …] As with the CREATE USER command, the recommended practice is to leave the SYSID option blank so that it will be auto-generated. The USER field, which is optional, can contain one or more users. For example, if we wanted to create a group for users with full access, the command would look like this: CREATE GROUP fullaccess WITH USER howard, rob; Manipulating Groups When creating a group, it may not always be feasible to add all users into a group. We may be unsure of which users need to be members of a group, and over time new users will be added into the database after our group is created. In contrast to this, we will surely also have a need to remove users from groups as our database evolves. To accomplish these tasks, we use the ALTER GROUP command: ALTER GROUP groupname ADD USER username [,…] ALTER GROUP groupname DROP USER username [,…] There is also a form of the ALTER GROUP command for renaming groups: ALTER GROUP groupname RENAME TO newgroupname In all cases, these ALTER GROUP commands can be executed only by a database superuser.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.