mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Fix bug in dumping prior releases due to MV REFRESH dependency checking.
Reports and suggested patches from Fujii Masao and Andrew Dunstan. Andrew Dunstan
This commit is contained in:
parent
ed3ddf918b
commit
a18b72adcd
@ -1769,7 +1769,7 @@ makeTableDataInfo(TableInfo *tbinfo, bool oids)
|
||||
static void
|
||||
buildMatViewRefreshDependencies(Archive *fout)
|
||||
{
|
||||
PQExpBuffer query = createPQExpBuffer();
|
||||
PQExpBuffer query;
|
||||
PGresult *res;
|
||||
int ntups,
|
||||
i;
|
||||
@ -1777,11 +1777,15 @@ buildMatViewRefreshDependencies(Archive *fout)
|
||||
i_objid,
|
||||
i_refobjid;
|
||||
|
||||
/* No Mat Views before 9.3. */
|
||||
if (fout->remoteVersion < 90300)
|
||||
return;
|
||||
|
||||
/* Make sure we are in proper schema */
|
||||
selectSourceSchema(fout, "pg_catalog");
|
||||
|
||||
if (fout->remoteVersion >= 90300)
|
||||
{
|
||||
query = createPQExpBuffer();
|
||||
|
||||
appendPQExpBuffer(query, "with recursive w as "
|
||||
"( "
|
||||
"select d1.objid, d2.refobjid, c2.relkind as refrelkind "
|
||||
@ -1808,7 +1812,6 @@ buildMatViewRefreshDependencies(Archive *fout)
|
||||
"select 'pg_class'::regclass::oid as classid, objid, refobjid "
|
||||
"from w "
|
||||
"where refrelkind = 'm'");
|
||||
}
|
||||
|
||||
res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user