Skip to content

Commit 7cce011

Browse files
committed
Only retrieve view definition if relation is a view (case statement)
1 parent 565afb8 commit 7cce011

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.167 2000/09/18 03:24:03 pjw Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.168 2000/09/18 06:47:46 pjw Exp $
2626
*
2727
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2828
*
@@ -1839,11 +1839,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
18391839
appendPQExpBuffer(query,
18401840
"SELECT pg_class.oid, relname, relkind, relacl, "
18411841
"(select usename from pg_user where relowner = usesysid) as usename, "
1842-
"relchecks, reltriggers, relhasindex, pg_get_viewdef(relname) as viewdef "
1842+
"relchecks, reltriggers, relhasindex, "
1843+
"Case When relkind = '%c' then pg_get_viewdef(relname) "
1844+
"Else NULL End as viewdef "
18431845
"from pg_class "
18441846
"where relname !~ '^pg_' "
18451847
"and relkind in ('%c', '%c', '%c') "
18461848
"order by oid",
1849+
RELKIND_VIEW,
18471850
RELKIND_RELATION, RELKIND_SEQUENCE, RELKIND_VIEW);
18481851

18491852
res = PQexec(g_conn, query->data);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy