diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-12-14 17:09:07 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-12-14 17:09:07 -0500 |
commit | 30e7c175b81d53c0f60f6ad12d1913a6d7d77008 (patch) | |
tree | daeb8373546f9261ac0f204af1bba0a7033a8910 /src/bin/pg_dump/dumputils.c | |
parent | a2ff18e89ff8f29677084bffd1e3de9ca6cd7224 (diff) | |
download | postgresql-30e7c175b81d53c0f60f6ad12d1913a6d7d77008.tar.gz postgresql-30e7c175b81d53c0f60f6ad12d1913a6d7d77008.zip |
Remove pg_dump/pg_dumpall support for dumping from pre-9.2 servers.
Per discussion, we'll limit support for old servers to those branches
that can still be built easily on modern platforms, which as of now
is 9.2 and up. Remove over a thousand lines of code dedicated to
dumping from older server versions. (As in previous changes of
this sort, we aren't removing pg_restore's ability to read older
archive files ... though it's fair to wonder how that might be
tested nowadays.) This cleans up some dead code left behind by
commit 989596152.
Discussion: https://postgr.es/m/2923349.1634942313@sss.pgh.pa.us
Diffstat (limited to 'src/bin/pg_dump/dumputils.c')
-rw-r--r-- | src/bin/pg_dump/dumputils.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c index 6e216313c6d..dfc96bc98ba 100644 --- a/src/bin/pg_dump/dumputils.c +++ b/src/bin/pg_dump/dumputils.c @@ -227,10 +227,6 @@ buildACLCommands(const char *name, const char *subname, const char *nspname, appendPQExpBuffer(firstsql, "%s FROM ", name); if (grantee->len == 0) appendPQExpBufferStr(firstsql, "PUBLIC;\n"); - else if (strncmp(grantee->data, "group ", - strlen("group ")) == 0) - appendPQExpBuffer(firstsql, "GROUP %s;\n", - fmtId(grantee->data + strlen("group "))); else appendPQExpBuffer(firstsql, "%s;\n", fmtId(grantee->data)); @@ -247,14 +243,9 @@ buildACLCommands(const char *name, const char *subname, const char *nspname, * public privileges are added in new versions: the REVOKE ALL will revoke * them, leading to behavior different from what the old version had, * which is generally not what's wanted. So add back default privs if the - * source database is too old to have had that particular priv. + * source database is too old to have had that particular priv. (As of + * right now, no such cases exist in supported versions.) */ - if (remoteVersion < 80200 && strcmp(type, "DATABASE") == 0) - { - /* database CONNECT priv didn't exist before 8.2 */ - appendPQExpBuffer(firstsql, "%sGRANT CONNECT ON %s %s TO PUBLIC;\n", - prefix, type, name); - } /* * Scan individual ACL items to be granted. @@ -306,10 +297,6 @@ buildACLCommands(const char *name, const char *subname, const char *nspname, appendPQExpBuffer(thissql, "%s TO ", name); if (grantee->len == 0) appendPQExpBufferStr(thissql, "PUBLIC;\n"); - else if (strncmp(grantee->data, "group ", - strlen("group ")) == 0) - appendPQExpBuffer(thissql, "GROUP %s;\n", - fmtId(grantee->data + strlen("group "))); else appendPQExpBuffer(thissql, "%s;\n", fmtId(grantee->data)); } @@ -322,10 +309,6 @@ buildACLCommands(const char *name, const char *subname, const char *nspname, appendPQExpBuffer(thissql, "%s TO ", name); if (grantee->len == 0) appendPQExpBufferStr(thissql, "PUBLIC"); - else if (strncmp(grantee->data, "group ", - strlen("group ")) == 0) - appendPQExpBuffer(thissql, "GROUP %s", - fmtId(grantee->data + strlen("group "))); else appendPQExpBufferStr(thissql, fmtId(grantee->data)); appendPQExpBufferStr(thissql, " WITH GRANT OPTION;\n"); @@ -420,16 +403,12 @@ buildDefaultACLCommands(const char *type, const char *nspname, /* * This will parse an aclitem string, having the general form * username=privilegecodes/grantor - * or - * group groupname=privilegecodes/grantor - * (the "group" case occurs only with servers before 8.1). * * Returns true on success, false on parse error. On success, the components * of the string are returned in the PQExpBuffer parameters. * - * The returned grantee string will be the dequoted username or groupname - * (preceded with "group " in the latter case). Note that a grant to PUBLIC - * is represented by an empty grantee string. The returned grantor is the + * The returned grantee string will be the dequoted username, or an empty + * string in the case of a grant to PUBLIC. The returned grantor is the * dequoted grantor name. Privilege characters are translated to GRANT/REVOKE * comma-separated privileges lists. If "privswgo" is non-NULL, the result is * separate lists for privileges with grant option ("privswgo") and without @@ -522,8 +501,7 @@ do { \ { CONVERT_PRIV('d', "DELETE"); CONVERT_PRIV('t', "TRIGGER"); - if (remoteVersion >= 80400) - CONVERT_PRIV('D', "TRUNCATE"); + CONVERT_PRIV('D', "TRUNCATE"); } } |