I have large database and with this DB work more users and I very need
Bruce Momjian <bruce@momjian.us>
I have large database and with this DB work more users and I very need
more restriction for fretful users. The current PG allow define only
NO-CREATE-DB and NO-CREATE-USER restriction, but for some users I need
NO-CREATE-TABLE and NO-LOCK-TABLE.
This patch add to current code NOCREATETABLE and NOLOCKTABLE feature:
CREATE USER username
[ WITH
[ SYSID uid ]
[ PASSWORD 'password' ] ]
[ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]
-> [ CREATETABLE | NOCREATETABLE ] [ LOCKTABLE | NOLOCKTABLE ]
...etc.
If CREATETABLE or LOCKTABLE is not specific in CREATE USER command,
as default is set CREATETABLE or LOCKTABLE (true).
A user with NOCREATETABLE restriction can't call CREATE TABLE or
SELECT INTO commands, only create temp table is allow for him.
Karel
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/command.c | modified | +17 −1 |
| src/backend/commands/creatinh.c | modified | +20 −2 |
| src/backend/commands/user.c | modified | +35 −4 |
| src/backend/parser/gram.y | modified | +47 −20 |
| src/backend/parser/keywords.c | modified | +6 −2 |
| src/backend/tcop/pquery.c | modified | +21 −1 |
| src/bin/initdb/initdb.sh | modified | +3 −1 |
| src/bin/scripts/createuser | modified | +45 −1 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_attribute.h | modified | +9 −7 |
| src/include/catalog/pg_class.h | modified | +2 −2 |
| src/include/catalog/pg_shadow.h | modified | +12 −8 |
| src/include/nodes/parsenodes.h | modified | +6 −2 |