Commit 7cce0111 authored by Philip Warner's avatar Philip Warner

Only retrieve view definition if relation is a view (case statement)

parent 565afb88
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* *
* *
* IDENTIFICATION * 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 * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -1839,11 +1839,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) ...@@ -1839,11 +1839,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
appendPQExpBuffer(query, appendPQExpBuffer(query,
"SELECT pg_class.oid, relname, relkind, relacl, " "SELECT pg_class.oid, relname, relkind, relacl, "
"(select usename from pg_user where relowner = usesysid) as usename, " "(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 " "from pg_class "
"where relname !~ '^pg_' " "where relname !~ '^pg_' "
"and relkind in ('%c', '%c', '%c') " "and relkind in ('%c', '%c', '%c') "
"order by oid", "order by oid",
RELKIND_VIEW,
RELKIND_RELATION, RELKIND_SEQUENCE, RELKIND_VIEW); RELKIND_RELATION, RELKIND_SEQUENCE, RELKIND_VIEW);
res = PQexec(g_conn, query->data); res = PQexec(g_conn, query->data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment