Index: src/bin/psql/describe.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/bin/psql/describe.c,v retrieving revision 1.185 diff -c -r1.185 describe.c *** src/bin/psql/describe.c 23 Sep 2008 09:20:38 -0000 1.185 --- src/bin/psql/describe.c 8 Oct 2008 23:28:48 -0000 *************** *** 826,831 **** --- 826,832 ---- PGresult *res = NULL; printTableOpt myopt = pset.popt.topt; printTableContent cont; + bool printTableInitialized = false; int i; char *view_def = NULL; char *headers[6]; *************** *** 887,892 **** --- 888,894 ---- tableinfo.tablespace = (pset.sversion >= 80000) ? atooid(PQgetvalue(res, 0, 6)) : 0; PQclear(res); + res = NULL; /* * This is used to get the values of a sequence and store it in an *************** *** 902,909 **** " start_value, increment_by, \n" " max_value, min_value, cache_value, \n" " log_cnt, is_cycled, is_called \n" ! "FROM \"%s\"", ! relationname); result = PSQLexec(buf.data, false); if (!result) --- 904,911 ---- " start_value, increment_by, \n" " max_value, min_value, cache_value, \n" " log_cnt, is_cycled, is_called \n" ! "FROM \"%s\".\"%s\"", ! schemaname, relationname); result = PSQLexec(buf.data, false); if (!result) *************** *** 1000,1005 **** --- 1002,1008 ---- } printTableInit(&cont, &myopt, title.data, cols, numrows); + printTableInitialized = true; for (i = 0; i < cols; i++) printTableAddHeader(&cont, headers[i], true, 'l'); *************** *** 1593,1599 **** error_return: /* clean up */ ! printTableCleanup(&cont); termPQExpBuffer(&buf); termPQExpBuffer(&title); termPQExpBuffer(&tmpbuf); --- 1596,1603 ---- error_return: /* clean up */ ! if (printTableInitialized) ! printTableCleanup(&cont); termPQExpBuffer(&buf); termPQExpBuffer(&title); termPQExpBuffer(&tmpbuf);