TableInfo *tbinfo = &tblinfo[i];
/*
- * For partitioned tables, foreign keys have no triggers so they
- * must be included anyway in case some foreign keys are defined.
+ * For partitioned tables, foreign keys have no triggers so they must
+ * be included anyway in case some foreign keys are defined.
*/
if ((!tbinfo->hastriggers &&
tbinfo->relkind != RELKIND_PARTITIONED_TABLE) ||
/* Plain secondary index */
appendPQExpBuffer(q, "%s;\n", indxinfo->indexdef);
+ /*
+ * Append ALTER TABLE commands as needed to set properties that we
+ * only have ALTER TABLE syntax for. Keep this in sync with the
+ * similar code in dumpConstraint!
+ */
+
/* If the index is clustered, we need to record that. */
if (indxinfo->indisclustered)
{
appendPQExpBufferStr(q, ";\n");
}
+ /*
+ * Append ALTER TABLE commands as needed to set properties that we
+ * only have ALTER TABLE syntax for. Keep this in sync with the
+ * similar code in dumpIndex!
+ */
+
/* If the index is clustered, we need to record that. */
if (indxinfo->indisclustered)
{
fmtId(indxinfo->dobj.name));
}
+ /* If the index defines identity, we need to record that. */
+ if (indxinfo->indisreplident)
+ {
+ appendPQExpBuffer(q, "\nALTER TABLE ONLY %s REPLICA IDENTITY USING",
+ fmtQualifiedDumpable(tbinfo));
+ /* index name is not qualified in this syntax */
+ appendPQExpBuffer(q, " INDEX %s;\n",
+ fmtId(indxinfo->dobj.name));
+ }
+
appendPQExpBuffer(delq, "ALTER TABLE ONLY %s ",
fmtQualifiedDumpable(tbinfo));
appendPQExpBuffer(delq, "DROP CONSTRAINT %s;\n",