Skip to content

Tag: postgresql

Grant on dynamic database name in Postgresql

I am trying to grant a new user permissions on the current database (whose name I do not know). Basically I want to archive something like this: Any hints how this could be achieved? Answer You cannot combine GRANTs with queries directly, but you may write a small block to achieve that. Since GRANT allows onl…

PostgreSQL conditional ENUM

Let’s say I have a table inventory with columns item_id, category and size. item_id is auto incremented integer (primary key) category is ENUM size is ENUM I want size to be a conditional ENUM. …