%type <str> constraints_set_mode comment_type comment_cl comment_ag
%type <str> CreateGroupStmt AlterGroupStmt DropGroupStmt key_delete
%type <str> opt_force key_update CreateSchemaStmt PosIntStringConst
-%type <str> IntConst PosIntConst
+%type <str> IntConst PosIntConst grantee_list func_type
%type <str> select_limit opt_for_update_clause CheckPointStmt
%type <str> ECPGWhenever ECPGConnect connection_target ECPGOpen
{
$$ = make_str("show time zone");
}
+ | SHOW ALL
+ {
+ $$ = make_str("show all");
+ }
| SHOW TRANSACTION ISOLATION LEVEL
{
$$ = make_str("show transaction isolation level");
{
$$ = make_str("reset transaction isolation level");
}
+ | RESET ALL
+ {
+ $$ = make_str("reset all");
+ }
;
ConstraintsSetStmt: SET CONSTRAINTS constraints_set_list constraints_set_mode
/*****************************************************************************
*
* QUERY:
- * GRANT [privileges] ON [relation_name_list] TO [GROUP] grantee
+ * GRANT [privileges] ON [TABLE] relation_name_list TO [GROUP] grantee, ...
*
*****************************************************************************/
-GrantStmt: GRANT privileges ON opt_table relation_name_list TO grantee opt_with_grant
+GrantStmt: GRANT privileges ON opt_table relation_name_list TO grantee_list opt_with_grant
{
$$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5, make_str("to"), $7);
}
}
;
+grantee_list: grantee { $$ = $1; }
+ | grantee_list ',' grantee { $$ = cat_str(3, $1, make_str(","), $3); }
+ ;
+
opt_with_grant: WITH GRANT OPTION
{
mmerror(ET_ERROR, "WITH GRANT OPTION is not supported. Only relation owners can set privileges");
/*****************************************************************************
*
* QUERY:
- * REVOKE [privileges] ON [relation_name] FROM [user]
+ * REVOKE privileges ON [TABLE relation_name_list FROM [user], ...
*
*****************************************************************************/
-RevokeStmt: REVOKE privileges ON opt_table relation_name_list FROM grantee
+RevokeStmt: REVOKE privileges ON opt_table relation_name_list FROM grantee_list
{
$$ = cat_str(8, make_str("revoke"), $2, make_str("on"), $4, $5, make_str("from"), $7);
}
{ $$ = cat_str(3, $1, make_str(","), $3); }
;
-func_arg: opt_arg Typename
+func_arg: opt_arg func_type
{
/* We can catch over-specified arguments here if we want to,
* but for now better to silently swallow typmod, etc.
*/
$$ = cat2_str($1, $2);
}
- | Typename
+ | func_type
{
$$ = $1;
}
func_as: StringConst { $$ = $1; }
| StringConst ',' StringConst { $$ = cat_str(3, $1, make_str(","), $3); }
-func_return: Typename
+func_return: func_type
{
/* We can catch over-specified arguments here if we want to,
* but for now better to silently swallow typmod, etc.
}
;
+func_type: Typename
+ {
+ $$ = $1;
+ }
+ | IDENT '.' ColId '%' TYPE_P
+ {
+ $$ = cat_str(4, $1, make_str("."), $3, make_str("% type"));
+ }
+ ;
+
/*****************************************************************************
*
* QUERY:
/* old style: dbname[@server][:port] */
if (strlen($2) > 0 && *($2) != '@')
{
- sprintf(errortext, "parse error at or near '%s'", $2);
+ sprintf(errortext, "Expected '@', found '%s'", $2);
mmerror(ET_ERROR, errortext);
}
/* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
if (strncmp($3, "//", strlen("//")) != 0)
{
- sprintf(errortext, "parse error at or near '%s'", $3);
+ sprintf(errortext, "Expected '://', found '%s'", $3);
mmerror(ET_ERROR, errortext);
}
{
if (strcmp($2, "postgresql") != 0 && strcmp($2, "postgres") != 0)
{
- sprintf(errortext, "parse error at or near '%s'", $2);
+ sprintf(errortext, "Expected 'postgresql', found '%s'", $2);
mmerror(ET_ERROR, errortext);
}
{
if (strcmp($1, "@") != 0 && strcmp($1, "//") != 0)
{
- sprintf(errortext, "parse error at or near '%s'", $1);
+ sprintf(errortext, "Expected '@' or '://', found '%s'", $1);
mmerror(ET_ERROR, errortext);
}
opt_options: Op ColId
{
if (strlen($1) == 0)
- mmerror(ET_ERROR, "parse error");
+ mmerror(ET_ERROR, "incomplete statement");
if (strcmp($1, "?") != 0)
{
- sprintf(errortext, "parse error at or near %s", $1);
+ sprintf(errortext, "unrecognised token '%s'", $1);
mmerror(ET_ERROR, errortext);
}