Re: GRANT ON ALL IN schema

From: Petr Jelinek <pjmodos(at)pjmodos(dot)net>
To: Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GRANT ON ALL IN schema
Date: 2009-07-17 11:00:04
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Nikhil Sontakke wrote:
> grant.sgml
> * Maybe we should use
> <replaceable class="parameter">schemaname</replaceable> in the sgml
> references instead of just <replaceable>schemaname</replaceable>
> + There is also the posibility of granting permissions to all objects of
> + given type inside one or multiple schemas. This functionality is supported
> + for tables, views, sequences and functions and can done by using
> + ALL TABLES IN schemanema syntax in place of object name.
> + </para>
> +
> + <para>
> typo "posibility"
> (note the other typo here) syntax to be precise IMHO.
Right, fixed.

> aclchk.c
> + elog(ERROR, "unrecognized GrantStmt.objtype: %d",
> + (int) objtype);
> Kinda funny to mention the C structure name in the error. But I see
> that the other functions in the file do the same, so should be ok. I
> doubt if the syntax allows any other object type to reach upto this
> function anyways :)
It's copy paste :)
But it seemed a bit strange to me too as this kind of thing is not
recommended in developer "guide". On the other hand ordinary user should
not ever see this unless something is horribly wrong with bison.

> parsenodes.h
> GrantObjectType objtype; /* kind of object being operated on */
> + bool is_schema; /* if true we want all objects
> + * of objtype in schema */
> You forgot to make changes in _copyGrantStmt and _equalGrantStmt to
> account for this new field.

> As an aside, I was just wondering the behaviour for RELKIND_INDEX?
Indexes don't have permissions afaik so nothing.

I attached modified patch per your comments and also updated to current

Thanks for your review.

Petr Jelinek (PJMODOS)

Attachment Content-Type Size
grant-on-all.diff text/plain 32.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Smith 2009-07-17 12:09:43 'Could not attach to shared memory' bug in Windows
Previous Message Petr Jelinek 2009-07-17 10:28:37 Re: [PATCH] DefaultACLs