Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> writes:
+ if (tblinfo[i].adef_expr[j] != NULL && tblinfo[i].inhAttrDef[j] == 0)
+ appendPQExpBuffer(q, "ALTER TABLE %s ALTER COLUMN %s SET DEFAULT %s;\n",
+ tblinfo[i].relname, tblinfo[i].attnames[j],
+ tblinfo[i].adef_expr[j]);
I think you need some fmtId calls here, else it will fail on mixed-case
names and suchlike.
regards, tom lane