Re: [HACKERS] patch for type privileges

2012-05-20 Thread Peter Eisentraut
On lör, 2011-12-10 at 16:16 +0100, Yeb Havinga wrote: > > * Cannot restrict access to array types. After revoking usage from the > element type, the error is perhaps a bit misleading. (smallint[] vs > smallint) > > postgres=> create table a (a int2[]); > ERROR: permission denied for type small

Re: [HACKERS] patch for type privileges

2011-12-16 Thread Greg Smith
On 12/13/2011 01:13 PM, Yeb Havinga wrote: On 2011-12-12 20:53, Peter Eisentraut wrote: postgres=> create table a (a int2[]); ERROR: permission denied for type smallint[] OK, that error message should be improved. Fixing this is easy, but I'd like to look into refactoring this a bit. Let's

Re: [HACKERS] patch for type privileges

2011-12-13 Thread Yeb Havinga
On 2011-12-12 20:53, Peter Eisentraut wrote: On sön, 2011-12-11 at 21:21 +0200, Peter Eisentraut wrote: * Cannot restrict access to array types. After revoking usage from the element type, the error is perhaps a bit misleading. (smallint[] vs smallint) postgres=> create table a (a int2[]); ERR

Re: [HACKERS] patch for type privileges

2011-12-11 Thread Peter Eisentraut
On lör, 2011-12-10 at 16:16 +0100, Yeb Havinga wrote: > * ExecGrant_type() prevents 'grant usage on domain' on a type, but the > converse is possible. > > postgres=# create domain myint as int2; > CREATE DOMAIN > postgres=# grant usage on type myint to public; > GRANT This is the same as how we

Re: [HACKERS] patch for type privileges

2011-12-10 Thread Yeb Havinga
On 2011-12-07 19:59, Peter Eisentraut wrote: Two excellent finds. Here is an updated patch with fixes. Thanks.. I'm sorry I cannot yet provide a complete review, but since the end of the commitfest is near, I decided to mail them anyway instead of everything on dec 15. * ExecGrant_type() pr

Re: [HACKERS] patch for type privileges

2011-12-02 Thread Yeb Havinga
On 2011-12-01 22:14, Peter Eisentraut wrote: On tor, 2011-12-01 at 14:37 +0100, Yeb Havinga wrote: On 2011-11-29 18:47, Peter Eisentraut wrote: On tis, 2011-11-29 at 07:07 +0200, Peter Eisentraut wrote: On mån, 2011-11-28 at 11:41 +0100, Yeb Havinga wrote: On 2011-11-15 21:50, Peter Eisentrau

Re: [HACKERS] patch for type privileges

2011-12-01 Thread Peter Eisentraut
On mån, 2011-11-28 at 14:25 -0600, Merlin Moncure wrote: > On Tue, Nov 15, 2011 at 2:23 PM, Peter Eisentraut wrote: > > The basics here are mainly informed by the SQL standard. One thing from > > there I did not implement is checking for permission of a type used in > > CAST (foo AS type). This

Re: [HACKERS] patch for type privileges

2011-12-01 Thread Peter Eisentraut
On tor, 2011-12-01 at 14:37 +0100, Yeb Havinga wrote: > On 2011-11-29 18:47, Peter Eisentraut wrote: > > On tis, 2011-11-29 at 07:07 +0200, Peter Eisentraut wrote: > >> On mån, 2011-11-28 at 11:41 +0100, Yeb Havinga wrote: > >>> On 2011-11-15 21:50, Peter Eisentraut wrote: > Patch attached. >

Re: [HACKERS] patch for type privileges

2011-12-01 Thread Yeb Havinga
On 2011-11-29 18:47, Peter Eisentraut wrote: On tis, 2011-11-29 at 07:07 +0200, Peter Eisentraut wrote: On mån, 2011-11-28 at 11:41 +0100, Yeb Havinga wrote: On 2011-11-15 21:50, Peter Eisentraut wrote: Patch attached. I cannot get the patch to apply, this is the output of patch -p1 --dry-run

Re: [HACKERS] patch for type privileges

2011-11-28 Thread Peter Eisentraut
On mån, 2011-11-28 at 11:41 +0100, Yeb Havinga wrote: > On 2011-11-15 21:50, Peter Eisentraut wrote: > > Patch attached. > > I cannot get the patch to apply, this is the output of patch -p1 > --dry-run on HEAD. > > patching file src/include/catalog/pg_type.h > Hunk #1 succeeded at 217 (offset 1

Re: [HACKERS] patch for type privileges

2011-11-28 Thread Merlin Moncure
On Tue, Nov 15, 2011 at 2:23 PM, Peter Eisentraut wrote: > The basics here are mainly informed by the SQL standard.  One thing from > there I did not implement is checking for permission of a type used in > CAST (foo AS type).  This would be doable but relatively complicated, > and in practice som

Re: [HACKERS] patch for type privileges

2011-11-28 Thread Yeb Havinga
On 2011-11-15 21:50, Peter Eisentraut wrote: Patch attached. I cannot get the patch to apply, this is the output of patch -p1 --dry-run on HEAD. patching file src/include/catalog/pg_type.h Hunk #1 succeeded at 217 (offset 1 line). Hunk #2 succeeded at 234 (offset 1 line). Hunk #3 succeeded a

Re: [HACKERS] patch for type privileges

2011-11-15 Thread Thom Brown
On 15 November 2011 20:23, Peter Eisentraut wrote: > Here is the patch to implement type privileges that I alluded to > earlier.  To recall, this is mainly so that owners can prevent others > from using their types because that would in some cases prevent owners > from changing the types.  That wo