Skip to main content
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
Results tagged with
Search options not deleted user 6219

Privileges granted to an account or role through the security mechanism of an operating system, database manager or other system.

70 votes
Accepted

Permission denied in file trying to import

You've just run into a peculiarity of psql on Windows. In my comment I just wanted to exclude the possibility that you really didn't have the necessary permission. Then it turned out that even on …
András Váczi's user avatar
11 votes

ALTER DEFAULT PRIVILEGES - permission denied

The problem here is the ALTER DEFAULT PRIVILEGES statement you issued will apply only to tables that are created by user_name: You can change default privileges only for objects that will be created …
András Váczi's user avatar
11 votes
Accepted

How to prevent a login from 'listing' a table or view definition in PostgreSQL?

The documentation to the rescue: UPDATE [...] For schemas, allows access to objects contained in the specified schema (assuming that the objects' own privilege requirements are also met). Essentially …
András Váczi's user avatar
10 votes

Can a non-owner of a table be allowed to disable the table's triggers?

As the owner of the table, you can create a function (or, if you are on Postgres 11 or newer, a procedure) which disables the trigger of your choice like: CREATE OR REPLACE FUNCTION disable_this_trig …
András Váczi's user avatar
9 votes
Accepted

postgres create limited user that can select tables and columns of those tables

You can set column level privileges to very specifically (and narrowly) allow otherwise unprivileged users to access data. In your case, it is two catalogs: pg_attribute and pg_type. I have a user ca …
András Váczi's user avatar
8 votes

how do you revoke create table from a user on postgresql 9.4?

According to the documentation, what one needs for creating tables in a schema is CREATE on that schema. This you think you revoked, but as you experience it didn't really happen - the only plausible …
András Váczi's user avatar
8 votes
Accepted

What is the equivalent of SQL Server's db_datareader/db_datawriter in PostgreSQL?

There is no builtin role like that in PostgreSQL. However, you can set up one: CREATE ROLE db_datawriter; After this, you have to assign write privileges (usually INSERT, UPDATE, DELETE, maybe TRU …
András Váczi's user avatar
7 votes
Accepted

Find current owner of custom data type?

Up until 9.4 You can go and ask the system catalogs (pg_type, to be precise): SELECT rolname FROM pg_type t JOIN pg_authid r ON typowner = r.oid WHERE typname = 'bla'; usename ───────── …
András Váczi's user avatar
6 votes

Reg: Default Privileges on PostgreSQL Schemas

arwdDxt/bob ↵│ │ │ │ alice=r/bob │ As you can see, despite creating the table in alice's schema where she set the default privileges, bob's table doesn't have all those permissions
András Váczi's user avatar
5 votes
1 answer
1k views

User can drop table from a schema, but cannot create one

In an Azure Synapse dedicated SQL pool I have the following setup: -- a custom DB role to manage privileges CREATE ROLE [owner]; -- there is a schema owned by this role CREATE SCHEMA [myschema] AUTHO …
András Váczi's user avatar
4 votes

Limit access to specific database only, and restrict access to system tables

You can achieve this goal by revoking certain privileges. You might have the reasons to do so - the only scenario where I'd start thinking about it is multi-tenancy. Still, in this case, it is bette …
András Váczi's user avatar
4 votes
Accepted

Want to clone a role, but am getting "can't login" message after doing so

The reason is that GRANT only gives permissions, while LOGIN is an attribute of the user/role: CREATE USER rails; -- means it has LOGIN CREATE ROLE myuser; GRANT rails TO myuser; \du rails …
András Váczi's user avatar
4 votes
Accepted

Role, whose name doesn't match database name, can't access the database

As it sounds, the tables (not necessary the database) is owned by the app user. This is what the documentation tells about this: If the "Access privileges" column is empty for a given object, it …
András Váczi's user avatar
4 votes

Relation does not exist for some users

What you see typically happens when the non-privileged user doesn't have schema level privileges. In this case, they cannot list the objects inside the given schema - with the command you tried. See …
András Váczi's user avatar
4 votes
Accepted

PostgreSQL, How to keep only one schema?

The documentation of GRANT says the following: CREATE For databases, allows new schemas to be created within the database. For schemas, allows new objects to be created within the schema. To ren …
András Váczi's user avatar

15 30 50 per page