Skip to content

Commit 3d7601f

Browse files
committed
Merge pull request #171 from Tommi2Day/fix/grant_function
remove prokind selection as is not available before PGSQL 11, fix #159
2 parents d9b0d9f + 3071ecc commit 3d7601f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
## 1.8.0 (Unreleased)
2+
## 1.7.2 (unreleased)
3+
4+
BUG FIXES:
5+
6+
* `postgresql_grant` : fix grant on function by removing prokind column selection,
7+
as is it not available on postgresql version < 11 and its not to
8+
expect to have a window(w) or aggregate function(a) with the same name as a normal function(f)
9+
210
## 1.7.1 (July 30, 2020)
311

412
BUG FIXES:

postgresql/resource_postgresql_grant.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,13 @@ JOIN pg_namespace ON pg_namespace.oid = pg_proc.pronamespace
257257
LEFT JOIN (
258258
select acls.*
259259
from (
260-
SELECT proname, prokind, pronamespace, (aclexplode(proacl)).* FROM pg_proc
260+
SELECT proname, pronamespace, (aclexplode(proacl)).* FROM pg_proc
261261
) acls
262262
JOIN pg_roles on grantee = pg_roles.oid
263263
WHERE rolname = $1
264264
) privs
265-
USING (proname, pronamespace, prokind)
266-
WHERE nspname = $2 AND prokind = $3
265+
USING (proname, pronamespace)
266+
WHERE nspname = $2
267267
GROUP BY pg_proc.proname
268268
`
269269
default:

0 commit comments

Comments
 (0)