Re: default values for views - Mailing list pgsql-patches

From Tom Lane
Subject Re: default values for views
Date
Msg-id 6203.1018909483@sss.pgh.pa.us
Whole thread Raw
In response to default values for views  (Neil Conway <nconway@klamath.dyndns.org>)
Responses Re: default values for views
List pgsql-patches
Neil Conway <nconway@klamath.dyndns.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

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: default values for views
Next
From: Neil Conway
Date:
Subject: pg_dump code cleanup