Remove extra space from dumped ALTER DEFAULT PRIVILEGES.
Author: Nathan Bossart Discussion: https://postgr.es/m/20221206232744.GA3560301@nathanxps13
This commit is contained in:
parent
45f5c81ad2
commit
2af33369e7
|
@ -184,7 +184,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
|
||||||
prefix, privs->data, type);
|
prefix, privs->data, type);
|
||||||
if (nspname && *nspname)
|
if (nspname && *nspname)
|
||||||
appendPQExpBuffer(firstsql, "%s.", fmtId(nspname));
|
appendPQExpBuffer(firstsql, "%s.", fmtId(nspname));
|
||||||
appendPQExpBuffer(firstsql, "%s FROM ", name);
|
if (name && *name)
|
||||||
|
appendPQExpBuffer(firstsql, "%s ", name);
|
||||||
|
appendPQExpBufferStr(firstsql, "FROM ");
|
||||||
if (grantee->len == 0)
|
if (grantee->len == 0)
|
||||||
appendPQExpBufferStr(firstsql, "PUBLIC;\n");
|
appendPQExpBufferStr(firstsql, "PUBLIC;\n");
|
||||||
else
|
else
|
||||||
|
@ -253,7 +255,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
|
||||||
prefix, privs->data, type);
|
prefix, privs->data, type);
|
||||||
if (nspname && *nspname)
|
if (nspname && *nspname)
|
||||||
appendPQExpBuffer(thissql, "%s.", fmtId(nspname));
|
appendPQExpBuffer(thissql, "%s.", fmtId(nspname));
|
||||||
appendPQExpBuffer(thissql, "%s TO ", name);
|
if (name && *name)
|
||||||
|
appendPQExpBuffer(thissql, "%s ", name);
|
||||||
|
appendPQExpBufferStr(thissql, "TO ");
|
||||||
if (grantee->len == 0)
|
if (grantee->len == 0)
|
||||||
appendPQExpBufferStr(thissql, "PUBLIC;\n");
|
appendPQExpBufferStr(thissql, "PUBLIC;\n");
|
||||||
else
|
else
|
||||||
|
@ -265,7 +269,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname,
|
||||||
prefix, privswgo->data, type);
|
prefix, privswgo->data, type);
|
||||||
if (nspname && *nspname)
|
if (nspname && *nspname)
|
||||||
appendPQExpBuffer(thissql, "%s.", fmtId(nspname));
|
appendPQExpBuffer(thissql, "%s.", fmtId(nspname));
|
||||||
appendPQExpBuffer(thissql, "%s TO ", name);
|
if (name && *name)
|
||||||
|
appendPQExpBuffer(thissql, "%s ", name);
|
||||||
|
appendPQExpBufferStr(thissql, "TO ");
|
||||||
if (grantee->len == 0)
|
if (grantee->len == 0)
|
||||||
appendPQExpBufferStr(thissql, "PUBLIC");
|
appendPQExpBufferStr(thissql, "PUBLIC");
|
||||||
else
|
else
|
||||||
|
|
|
@ -563,7 +563,7 @@ my %tests = (
|
||||||
regexp => qr/^
|
regexp => qr/^
|
||||||
\QALTER DEFAULT PRIVILEGES \E
|
\QALTER DEFAULT PRIVILEGES \E
|
||||||
\QFOR ROLE regress_dump_test_role IN SCHEMA dump_test \E
|
\QFOR ROLE regress_dump_test_role IN SCHEMA dump_test \E
|
||||||
\QGRANT SELECT ON TABLES TO regress_dump_test_role;\E
|
\QGRANT SELECT ON TABLES TO regress_dump_test_role;\E
|
||||||
/xm,
|
/xm,
|
||||||
like =>
|
like =>
|
||||||
{ %full_runs, %dump_test_schema_runs, section_post_data => 1, },
|
{ %full_runs, %dump_test_schema_runs, section_post_data => 1, },
|
||||||
|
@ -582,7 +582,7 @@ my %tests = (
|
||||||
regexp => qr/^
|
regexp => qr/^
|
||||||
\QALTER DEFAULT PRIVILEGES \E
|
\QALTER DEFAULT PRIVILEGES \E
|
||||||
\QFOR ROLE regress_dump_test_role IN SCHEMA dump_test \E
|
\QFOR ROLE regress_dump_test_role IN SCHEMA dump_test \E
|
||||||
\QGRANT ALL ON FUNCTIONS TO regress_dump_test_role;\E
|
\QGRANT ALL ON FUNCTIONS TO regress_dump_test_role;\E
|
||||||
/xm,
|
/xm,
|
||||||
like =>
|
like =>
|
||||||
{ %full_runs, %dump_test_schema_runs, section_post_data => 1, },
|
{ %full_runs, %dump_test_schema_runs, section_post_data => 1, },
|
||||||
|
@ -600,7 +600,7 @@ my %tests = (
|
||||||
regexp => qr/^
|
regexp => qr/^
|
||||||
\QALTER DEFAULT PRIVILEGES \E
|
\QALTER DEFAULT PRIVILEGES \E
|
||||||
\QFOR ROLE regress_dump_test_role \E
|
\QFOR ROLE regress_dump_test_role \E
|
||||||
\QREVOKE ALL ON FUNCTIONS FROM PUBLIC;\E
|
\QREVOKE ALL ON FUNCTIONS FROM PUBLIC;\E
|
||||||
/xm,
|
/xm,
|
||||||
like => { %full_runs, section_post_data => 1, },
|
like => { %full_runs, section_post_data => 1, },
|
||||||
unlike => { no_privs => 1, },
|
unlike => { no_privs => 1, },
|
||||||
|
@ -615,10 +615,10 @@ my %tests = (
|
||||||
regexp => qr/^
|
regexp => qr/^
|
||||||
\QALTER DEFAULT PRIVILEGES \E
|
\QALTER DEFAULT PRIVILEGES \E
|
||||||
\QFOR ROLE regress_dump_test_role \E
|
\QFOR ROLE regress_dump_test_role \E
|
||||||
\QREVOKE ALL ON TABLES FROM regress_dump_test_role;\E\n
|
\QREVOKE ALL ON TABLES FROM regress_dump_test_role;\E\n
|
||||||
\QALTER DEFAULT PRIVILEGES \E
|
\QALTER DEFAULT PRIVILEGES \E
|
||||||
\QFOR ROLE regress_dump_test_role \E
|
\QFOR ROLE regress_dump_test_role \E
|
||||||
\QGRANT INSERT,REFERENCES,DELETE,TRIGGER,TRUNCATE,VACUUM,ANALYZE,UPDATE ON TABLES TO regress_dump_test_role;\E
|
\QGRANT INSERT,REFERENCES,DELETE,TRIGGER,TRUNCATE,VACUUM,ANALYZE,UPDATE ON TABLES TO regress_dump_test_role;\E
|
||||||
/xm,
|
/xm,
|
||||||
like => { %full_runs, section_post_data => 1, },
|
like => { %full_runs, section_post_data => 1, },
|
||||||
unlike => { no_privs => 1, },
|
unlike => { no_privs => 1, },
|
||||||
|
|
Loading…
Reference in New Issue