@@ -227,10 +227,6 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
227
227
appendPQExpBuffer (firstsql , "%s FROM " , name );
228
228
if (grantee -> len == 0 )
229
229
appendPQExpBufferStr (firstsql , "PUBLIC;\n" );
230
- else if (strncmp (grantee -> data , "group " ,
231
- strlen ("group " )) == 0 )
232
- appendPQExpBuffer (firstsql , "GROUP %s;\n" ,
233
- fmtId (grantee -> data + strlen ("group " )));
234
230
else
235
231
appendPQExpBuffer (firstsql , "%s;\n" ,
236
232
fmtId (grantee -> data ));
@@ -247,14 +243,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
247
243
* public privileges are added in new versions: the REVOKE ALL will revoke
248
244
* them, leading to behavior different from what the old version had,
249
245
* which is generally not what's wanted. So add back default privs if the
250
- * source database is too old to have had that particular priv.
246
+ * source database is too old to have had that particular priv. (As of
247
+ * right now, no such cases exist in supported versions.)
251
248
*/
252
- if (remoteVersion < 80200 && strcmp (type , "DATABASE" ) == 0 )
253
- {
254
- /* database CONNECT priv didn't exist before 8.2 */
255
- appendPQExpBuffer (firstsql , "%sGRANT CONNECT ON %s %s TO PUBLIC;\n" ,
256
- prefix , type , name );
257
- }
258
249
259
250
/*
260
251
* Scan individual ACL items to be granted.
@@ -306,10 +297,6 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
306
297
appendPQExpBuffer (thissql , "%s TO " , name );
307
298
if (grantee -> len == 0 )
308
299
appendPQExpBufferStr (thissql , "PUBLIC;\n" );
309
- else if (strncmp (grantee -> data , "group " ,
310
- strlen ("group " )) == 0 )
311
- appendPQExpBuffer (thissql , "GROUP %s;\n" ,
312
- fmtId (grantee -> data + strlen ("group " )));
313
300
else
314
301
appendPQExpBuffer (thissql , "%s;\n" , fmtId (grantee -> data ));
315
302
}
@@ -322,10 +309,6 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
322
309
appendPQExpBuffer (thissql , "%s TO " , name );
323
310
if (grantee -> len == 0 )
324
311
appendPQExpBufferStr (thissql , "PUBLIC" );
325
- else if (strncmp (grantee -> data , "group " ,
326
- strlen ("group " )) == 0 )
327
- appendPQExpBuffer (thissql , "GROUP %s" ,
328
- fmtId (grantee -> data + strlen ("group " )));
329
312
else
330
313
appendPQExpBufferStr (thissql , fmtId (grantee -> data ));
331
314
appendPQExpBufferStr (thissql , " WITH GRANT OPTION;\n" );
@@ -420,16 +403,12 @@ buildDefaultACLCommands(const char *type, const char *nspname,
420
403
/*
421
404
* This will parse an aclitem string, having the general form
422
405
* username=privilegecodes/grantor
423
- * or
424
- * group groupname=privilegecodes/grantor
425
- * (the "group" case occurs only with servers before 8.1).
426
406
*
427
407
* Returns true on success, false on parse error. On success, the components
428
408
* of the string are returned in the PQExpBuffer parameters.
429
409
*
430
- * The returned grantee string will be the dequoted username or groupname
431
- * (preceded with "group " in the latter case). Note that a grant to PUBLIC
432
- * is represented by an empty grantee string. The returned grantor is the
410
+ * The returned grantee string will be the dequoted username, or an empty
411
+ * string in the case of a grant to PUBLIC. The returned grantor is the
433
412
* dequoted grantor name. Privilege characters are translated to GRANT/REVOKE
434
413
* comma-separated privileges lists. If "privswgo" is non-NULL, the result is
435
414
* separate lists for privileges with grant option ("privswgo") and without
@@ -522,8 +501,7 @@ do { \
522
501
{
523
502
CONVERT_PRIV ('d' , "DELETE" );
524
503
CONVERT_PRIV ('t' , "TRIGGER" );
525
- if (remoteVersion >= 80400 )
526
- CONVERT_PRIV ('D' , "TRUNCATE" );
504
+ CONVERT_PRIV ('D' , "TRUNCATE" );
527
505
}
528
506
}
529
507
0 commit comments