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

This commit is contained in:
Philip Warner 2000-09-18 06:47:46 +00:00
parent 565afb889d
commit 7cce011178
1 changed files with 5 additions and 2 deletions

View File

@ -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);