Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Privileges granted to an account or role through the security mechanism of an operating system, database manager or other system.
2
votes
Accepted
Revoke delete from table for database owner
You cannot revoke privileges that are not granted.
The table (not database) owner implicitly has full rights on the table. They cannot be revoked, except by changing the owner of the table.
What you …
5
votes
Accepted
How to grant only functions while revoking tables?
You want to make your functions SECURITY DEFINER and have them owned by a user that does have the requisite rights.
Be very careful when coding SECURITY DEFINER functions. Don't make them owned by a …
13
votes
Accepted
Why is a new user able to create tables in PostgreSQL?
TL;DR: New users can create tables in the public schema because people complained that it was too hard when they couldn't.
If you dislike the defaults, you should probably create a new template datab …
3
votes
Accepted
DENY insert,update,delete to user (PostgreSQL)
PostgreSQL does not have DENY ACLs.
Instead you must REVOKE any rights you want them to be missing, leaving only the rights you want.
e.g.
REVOKE ALL ON TABLE blah FROM USER fred;
GRANT SELECT ON T …
3
votes
Adding new user in Postgres
You must grant a user:
CONNECT on the database (if public doesn't have it by default)
USAGE on any schemas like the public schema (again, if the public role doesn't have it by default)
... and the r …
33
votes
Why is a new user allowed to create a table?
For a schema, ALL means CREATE, USAGE:
CREATE: Create objects (including tables) within this schema
USAGE: List objects in the schema and access them if their permissions permit
If you do not specify …
2
votes
PostgreSQL user only drop some tables
DROP TABLE isn't a GRANTable right, it's held only by the table owner and the superuser.
Kassandry has already noted that event triggers are one option.
Another is to create a wrapper function, like …
13
votes
postgres: how can I allow index creation but no table mutations or table drops by the same u...
At the SQL level you can't, since all those tasks are governed by table ownership.
The CREATE on a tablespace is required but not sufficient to create an index on a table and store the index in that …
6
votes
Accepted
In Postgresql, after pg_dump the access privileges on the database itself are not restored
Why are the access privileges on the database itself not restored?
It's a bug, or a design oversight. Though the responder to that report doesn't think so.
pg_dumpall --globals-only doesn't dump …
4
votes
PostgreSQL: permission denied for relation
I just wrote about this in my answer to Granting rights on postgresql database to another user on ServerFault.
Basically, the best solution when you have a single user and you want to grant other use …
29
votes
Accepted
How to view the query of another session in pg_stat_activity without being super user?
For postgres 10+
Use the pg_read_all_stats role or pg_monitor for broader access. Just GRANT it to the user/role you wish to give the required access.
GRANT pg_read_all_stats TO myuser;
For old postg …
7
votes
Accepted
psql is not prompting me for a password, then denies access
Peer authentication
This means it's using a unix socket connection, and connections for unix sockets are set to use peer authentication in pg_hba.conf. It just checks that the unix user name is t …
11
votes
Accepted
PostgreSQL GRANT ALL on mutliple tables using LIKE
GRANT doesn't take wildcards in table identifiers.
You can use ON ALL TABLES IN SCHEMA, but that requires a single schema name.
If you want to do things with wildcard pattern table names you will need …