Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
857661ba
Commit
857661ba
authored
Apr 29, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce EXECUTE privilege for aggregate functions.
parent
ccfaf906
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
doc/src/sgml/ref/grant.sgml
doc/src/sgml/ref/grant.sgml
+2
-1
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+10
-1
No files found.
doc/src/sgml/ref/grant.sgml
View file @
857661ba
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/grant.sgml,v 1.2
3 2002/04/22 19:17:40
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/grant.sgml,v 1.2
4 2002/04/29 22:28:19
tgl Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -182,6 +182,7 @@ GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
...
@@ -182,6 +182,7 @@ GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
Allows the use of the specified function and the use of any
Allows the use of the specified function and the use of any
operators that are implemented on top of the function. This is
operators that are implemented on top of the function. This is
the only type of privilege that is applicable to functions.
the only type of privilege that is applicable to functions.
(This syntax works for aggregate functions, as well.)
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
...
src/backend/executor/nodeAgg.c
View file @
857661ba
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.8
2 2002/04/16 23:08:10
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.8
3 2002/04/29 22:28:19
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -58,11 +58,13 @@
...
@@ -58,11 +58,13 @@
#include "catalog/pg_operator.h"
#include "catalog/pg_operator.h"
#include "executor/executor.h"
#include "executor/executor.h"
#include "executor/nodeAgg.h"
#include "executor/nodeAgg.h"
#include "miscadmin.h"
#include "optimizer/clauses.h"
#include "optimizer/clauses.h"
#include "parser/parse_coerce.h"
#include "parser/parse_coerce.h"
#include "parser/parse_expr.h"
#include "parser/parse_expr.h"
#include "parser/parse_oper.h"
#include "parser/parse_oper.h"
#include "parser/parse_type.h"
#include "parser/parse_type.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "utils/syscache.h"
...
@@ -843,6 +845,7 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
...
@@ -843,6 +845,7 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
AggStatePerAgg
peraggstate
=
&
peragg
[
++
aggno
];
AggStatePerAgg
peraggstate
=
&
peragg
[
++
aggno
];
HeapTuple
aggTuple
;
HeapTuple
aggTuple
;
Form_pg_aggregate
aggform
;
Form_pg_aggregate
aggform
;
AclResult
aclresult
;
Oid
transfn_oid
,
Oid
transfn_oid
,
finalfn_oid
;
finalfn_oid
;
Datum
textInitVal
;
Datum
textInitVal
;
...
@@ -861,6 +864,12 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
...
@@ -861,6 +864,12 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
aggref
->
aggfnoid
);
aggref
->
aggfnoid
);
aggform
=
(
Form_pg_aggregate
)
GETSTRUCT
(
aggTuple
);
aggform
=
(
Form_pg_aggregate
)
GETSTRUCT
(
aggTuple
);
/* Check permission to call aggregate function */
aclresult
=
pg_proc_aclcheck
(
aggref
->
aggfnoid
,
GetUserId
(),
ACL_EXECUTE
);
if
(
aclresult
!=
ACLCHECK_OK
)
aclcheck_error
(
aclresult
,
get_func_name
(
aggref
->
aggfnoid
));
get_typlenbyval
(
aggref
->
aggtype
,
get_typlenbyval
(
aggref
->
aggtype
,
&
peraggstate
->
resulttypeLen
,
&
peraggstate
->
resulttypeLen
,
&
peraggstate
->
resulttypeByVal
);
&
peraggstate
->
resulttypeByVal
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment