From: Philip Warner Date: Mon, 18 Sep 2000 06:47:46 +0000 (+0000) Subject: Only retrieve view definition if relation is a view (case statement) X-Git-Tag: REL9_0_0~22597 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7cce011178f9bccd2cc8700440e252d96cc4622b;p=pg-rex%2Fsyncrep.git Only retrieve view definition if relation is a view (case statement) --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index a196e17a0c..99358b3570 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -22,7 +22,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.167 2000/09/18 03:24:03 pjw Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.168 2000/09/18 06:47:46 pjw Exp $ * * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * @@ -1839,11 +1839,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) appendPQExpBuffer(query, "SELECT pg_class.oid, relname, relkind, relacl, " "(select usename from pg_user where relowner = usesysid) as usename, " - "relchecks, reltriggers, relhasindex, pg_get_viewdef(relname) as viewdef " + "relchecks, reltriggers, relhasindex, " + "Case When relkind = '%c' then pg_get_viewdef(relname) " + "Else NULL End as viewdef " "from pg_class " "where relname !~ '^pg_' " "and relkind in ('%c', '%c', '%c') " "order by oid", + RELKIND_VIEW, RELKIND_RELATION, RELKIND_SEQUENCE, RELKIND_VIEW); res = PQexec(g_conn, query->data);