@@ -184,7 +184,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
184
184
prefix , privs -> data , type );
185
185
if (nspname && * nspname )
186
186
appendPQExpBuffer (firstsql , "%s." , fmtId (nspname ));
187
- appendPQExpBuffer (firstsql , "%s FROM " , name );
187
+ if (name && * name )
188
+ appendPQExpBuffer (firstsql , "%s " , name );
189
+ appendPQExpBufferStr (firstsql , "FROM " );
188
190
if (grantee -> len == 0 )
189
191
appendPQExpBufferStr (firstsql , "PUBLIC;\n" );
190
192
else
@@ -253,7 +255,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
253
255
prefix , privs -> data , type );
254
256
if (nspname && * nspname )
255
257
appendPQExpBuffer (thissql , "%s." , fmtId (nspname ));
256
- appendPQExpBuffer (thissql , "%s TO " , name );
258
+ if (name && * name )
259
+ appendPQExpBuffer (thissql , "%s " , name );
260
+ appendPQExpBufferStr (thissql , "TO " );
257
261
if (grantee -> len == 0 )
258
262
appendPQExpBufferStr (thissql , "PUBLIC;\n" );
259
263
else
@@ -265,7 +269,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
265
269
prefix , privswgo -> data , type );
266
270
if (nspname && * nspname )
267
271
appendPQExpBuffer (thissql , "%s." , fmtId (nspname ));
268
- appendPQExpBuffer (thissql , "%s TO " , name );
272
+ if (name && * name )
273
+ appendPQExpBuffer (thissql , "%s " , name );
274
+ appendPQExpBufferStr (thissql , "TO " );
269
275
if (grantee -> len == 0 )
270
276
appendPQExpBufferStr (thissql , "PUBLIC" );
271
277
else
0 commit comments