Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Surprising syntax error

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Marc Munro <marc(at)bloodnok(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Surprising syntax error
Date: 2008-06-30 22:39:13
Message-ID: 200806302239.m5UMdDl16982@momjian.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Marc Munro wrote:
-- Start of PGP signed section.
> The statement:
> 
>   revoke all on view internal.all_objects from public;
> 
> yields a syntax error.  The docs show that the word "view" is not
> acceptable in this statement which is fine but the surprising thing is
> that:
> 
> ?  revoke all on table internal.all_objects from public;
> 
> works fine even though all_objects is a view and not a table.
> 
> Now that I know about it, this doesn't bother me but it was a surprise
> and I wonder whether the the parser/planner/whatever should be a bit
> smarter about allowing the word table to apply to non-tables, and
> whether the word view ought to be allowed.

Yes, I can confirm this behavior on CVS HEAD, and it is odd:

	test=> CREATE SCHEMA internal;
	CREATE SCHEMA
	test=> CREATE VIEW internal.all_objects AS SELECT 1;
	CREATE VIEW
	test=> REVOKE ALL ON VIEW internal.all_objects FROM PUBLIC;
	ERROR:  syntax ERROR AT OR near "internal"
	LINE 1: REVOKE ALL ON VIEW internal.all_objects FROM PUBLIC;
	                           ^
	test=> REVOKE ALL ON TABLE internal.all_objects FROM PUBLIC;
	REVOKE

Is there a downside to adding "VIEW" in parser/gram.y:privilege_target?

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2008-06-30 22:43:01
Subject: Re: [HACKERS] Hint Bits and Write I/O
Previous:From: Bruce MomjianDate: 2008-06-30 22:13:12
Subject: Re: odd output in restore mode

pgsql-general by date

Next:From: EBIHARA, YuichiroDate: 2008-07-01 01:05:33
Subject: Re: server log files
Previous:From: sheikh salmanDate: 2008-06-30 20:51:10
Subject: Query Fails

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group