Initial support for PostgreSQL 12. Fixes #4283. Fixes #4288. Fixes #4290.

This commit is contained in:
Dave Page
2019-06-10 14:24:45 +01:00
parent 2ca11c84e8
commit 6d52f2b911
26 changed files with 900 additions and 109 deletions

View File

@@ -31,7 +31,10 @@ class TestDependenciesSql(SQLTemplateTestBase):
self.table_id = cursor.fetchone()[0]
def generate_sql(self, version):
template_file = self.get_template_file(version, "dependencies.sql")
file_path = os.path.join(os.path.dirname(__file__), "..", "templates",
"depends", "sql")
template_file = self.get_template_file(version, file_path,
"dependencies.sql")
template = file_as_template(template_file)
sql = template.render(
where_clause="WHERE dep.objid=%s::oid" % self.table_id)
@@ -47,8 +50,3 @@ class TestDependenciesSql(SQLTemplateTestBase):
self.assertEqual('n', first_row["deptype"])
self.assertEqual('public', first_row["refname"])
@staticmethod
def get_template_file(version, filename):
return os.path.join(os.path.dirname(__file__), "..", "templates",
"depends", "sql", version, filename)

View File

@@ -31,7 +31,10 @@ class TestDependentsSql(SQLTemplateTestBase):
self.table_id = cursor.fetchone()[0]
def generate_sql(self, version):
template_file = self.get_template_file(version, "dependents.sql")
file_path = os.path.join(os.path.dirname(__file__), "..", "templates",
"depends", "sql")
template_file = self.get_template_file(version, file_path,
"dependents.sql")
template = file_as_template(template_file)
sql = template.render(
where_clause="WHERE dep.objid=%s::oid" % self.table_id)
@@ -47,8 +50,3 @@ class TestDependentsSql(SQLTemplateTestBase):
self.assertEqual('n', first_row["deptype"])
self.assertEqual('test_table', first_row["refname"])
@staticmethod
def get_template_file(version, filename):
return os.path.join(os.path.dirname(__file__), "..", "templates",
"depends", "sql", version, filename)