Subject: | Small bug in Postgres parser for GRANT and REVOKE |
Hi there,
I've come across a small bug in the PostgreSQL parser, the TABLE part of the command syntax is optional according to the reference manual provided with PostgreSQL 7.3. The patch is attached.
Stephen Quinney
--- libsql-translator-perl-0.02.orig/lib/SQL/Translator/Parser/PostgreSQL.pm
+++ libsql-translator-perl-0.02/lib/SQL/Translator/Parser/PostgreSQL.pm
@@ -159,0 +159,0 @@
set : /SET/ /[^;]*/ ';'
-revoke : /revoke/i WORD(s /,/) /on/i /table/i table_name /from/i name_with_opt_quotes(s /,/) ';'
+revoke : /revoke/i WORD(s /,/) /on/i /(table)?/i table_name /from/i name_with_opt_quotes(s /,/) ';'
{
my $table_name = $item{'table_name'};
push @{ $tables{ $table_name }{'permissions'} }, {
@@ -169,2 +169,2 @@
}
}
-grant : /grant/i WORD(s /,/) /on/i /table/i table_name /to/i name_with_opt_quotes(s /,/) ';'
+grant : /grant/i WORD(s /,/) /on/i /(table)?/i table_name /to/i name_with_opt_quotes(s /,/) ';'
{
my $table_name = $item{'table_name'};
push @{ $tables{ $table_name }{'permissions'} }, {