pg_dump: Omit BYPASSRLS clause for pre GPDB7 server
GPDB5/6 do not support RLS. Without the version gate
a dump and restore on these server versions will fail.
Authored-by: Brent Doil
@@ -1348,10 +1348,13 @@ dumpRoles(PGconn *conn)
else
appendPQExpBufferStr(buf, " NOREPLICATION");
+ if (server_version >= 90600)
+ {
if (strcmp(PQgetvalue(res, i, i_rolbypassrls), "t") == 0)
appendPQExpBufferStr(buf, " BYPASSRLS");
else
appendPQExpBufferStr(buf, " NOBYPASSRLS");
+ }
if (strcmp(PQgetvalue(res, i, i_rolconnlimit), "-1") != 0)
appendPQExpBuffer(buf, " CONNECTION LIMIT %s",
