res = NULL;
}
- /* Get column info */
+ /*
+ * Get column info
+ *
+ * You need to modify value of "firstvcol" which willbe defined below if
+ * you are adding column(s) preceding to verbose-only columns.
+ */
printfPQExpBuffer(&buf, "SELECT a.attname,");
appendPQExpBuffer(&buf, "\n pg_catalog.format_type(a.atttypid, a.atttypmod),"
"\n (SELECT substring(pg_catalog.pg_get_expr(d.adbin, d.adrelid) for 128)"
appendPQExpBuffer(&buf, "\n NULL AS attcollation");
if (tableinfo.relkind == 'i')
appendPQExpBuffer(&buf, ",\n pg_catalog.pg_get_indexdef(a.attrelid, a.attnum, TRUE) AS indexdef");
+ else
+ appendPQExpBuffer(&buf, ",\n NULL AS indexdef");
if (verbose)
appendPQExpBuffer(&buf, ",\n a.attstorage, pg_catalog.col_description(a.attrelid, a.attnum)");
appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_attribute a");
/* Storage and Description */
if (verbose)
{
- int firstvcol = (tableinfo.relkind == 'i' ? 7 : 6);
+ int firstvcol = 7;
char *storage = PQgetvalue(res, i, firstvcol);
/* these strings are literal in our syntax, so not translated. */