Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
74e33110
Commit
74e33110
authored
Aug 07, 2000
by
Philip Warner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Support for iscachable when dumping functions
parent
7f6e021c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+14
-3
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump.h
+2
-1
No files found.
src/bin/pg_dump/pg_dump.c
View file @
74e33110
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.16
2 2000/08/01 15:51:4
4 pjw Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.16
3 2000/08/07 12:32:5
4 pjw Exp $
*
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
*
...
@@ -1714,13 +1714,15 @@ getFuncs(int *numFuncs)
...
@@ -1714,13 +1714,15 @@ getFuncs(int *numFuncs)
int
i_proretset
;
int
i_proretset
;
int
i_prosrc
;
int
i_prosrc
;
int
i_probin
;
int
i_probin
;
int
i_iscachable
;
int
i_usename
;
int
i_usename
;
/* find all user-defined funcs */
/* find all user-defined funcs */
appendPQExpBuffer
(
query
,
appendPQExpBuffer
(
query
,
"SELECT pg_proc.oid, proname, prolang, pronargs, prorettype, "
"SELECT pg_proc.oid, proname, prolang, pronargs, prorettype, "
"proretset, proargtypes, prosrc, probin, usename "
"proretset, proargtypes, prosrc, probin, usename, "
"proiscachable "
"from pg_proc, pg_user "
"from pg_proc, pg_user "
"where pg_proc.oid > '%u'::oid and proowner = usesysid"
,
"where pg_proc.oid > '%u'::oid and proowner = usesysid"
,
g_last_builtin_oid
);
g_last_builtin_oid
);
...
@@ -1751,6 +1753,7 @@ getFuncs(int *numFuncs)
...
@@ -1751,6 +1753,7 @@ getFuncs(int *numFuncs)
i_proretset
=
PQfnumber
(
res
,
"proretset"
);
i_proretset
=
PQfnumber
(
res
,
"proretset"
);
i_prosrc
=
PQfnumber
(
res
,
"prosrc"
);
i_prosrc
=
PQfnumber
(
res
,
"prosrc"
);
i_probin
=
PQfnumber
(
res
,
"probin"
);
i_probin
=
PQfnumber
(
res
,
"probin"
);
i_iscachable
=
PQfnumber
(
res
,
"proiscachable"
);
i_usename
=
PQfnumber
(
res
,
"usename"
);
i_usename
=
PQfnumber
(
res
,
"usename"
);
for
(
i
=
0
;
i
<
ntups
;
i
++
)
for
(
i
=
0
;
i
<
ntups
;
i
++
)
...
@@ -1766,6 +1769,7 @@ getFuncs(int *numFuncs)
...
@@ -1766,6 +1769,7 @@ getFuncs(int *numFuncs)
finfo
[
i
].
nargs
=
atoi
(
PQgetvalue
(
res
,
i
,
i_pronargs
));
finfo
[
i
].
nargs
=
atoi
(
PQgetvalue
(
res
,
i
,
i_pronargs
));
finfo
[
i
].
lang
=
atoi
(
PQgetvalue
(
res
,
i
,
i_prolang
));
finfo
[
i
].
lang
=
atoi
(
PQgetvalue
(
res
,
i
,
i_prolang
));
finfo
[
i
].
usename
=
strdup
(
PQgetvalue
(
res
,
i
,
i_usename
));
finfo
[
i
].
usename
=
strdup
(
PQgetvalue
(
res
,
i
,
i_usename
));
finfo
[
i
].
iscachable
=
(
strcmp
(
PQgetvalue
(
res
,
i
,
i_iscachable
),
"t"
)
==
0
);
if
(
finfo
[
i
].
nargs
<
0
||
finfo
[
i
].
nargs
>
FUNC_MAX_ARGS
)
if
(
finfo
[
i
].
nargs
<
0
||
finfo
[
i
].
nargs
>
FUNC_MAX_ARGS
)
{
{
fprintf
(
stderr
,
"failed sanity check: %s has %d args
\n
"
,
fprintf
(
stderr
,
"failed sanity check: %s has %d args
\n
"
,
...
@@ -2923,11 +2927,18 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
...
@@ -2923,11 +2927,18 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
resetPQExpBuffer
(
q
);
resetPQExpBuffer
(
q
);
appendPQExpBuffer
(
q
,
"CREATE FUNCTION %s "
,
fn
->
data
);
appendPQExpBuffer
(
q
,
"CREATE FUNCTION %s "
,
fn
->
data
);
appendPQExpBuffer
(
q
,
"RETURNS %s%s %s LANGUAGE '%s'
;
\n
"
,
appendPQExpBuffer
(
q
,
"RETURNS %s%s %s LANGUAGE '%s'"
,
(
finfo
[
i
].
retset
)
?
" SETOF "
:
""
,
(
finfo
[
i
].
retset
)
?
" SETOF "
:
""
,
fmtId
(
findTypeByOid
(
tinfo
,
numTypes
,
finfo
[
i
].
prorettype
),
false
),
fmtId
(
findTypeByOid
(
tinfo
,
numTypes
,
finfo
[
i
].
prorettype
),
false
),
asPart
->
data
,
func_lang
);
asPart
->
data
,
func_lang
);
if
(
finfo
[
i
].
iscachable
)
/* OR in new attrs here */
{
appendPQExpBuffer
(
q
,
" WITH (iscachable)"
);
}
appendPQExpBuffer
(
q
,
";
\n
"
);
ArchiveEntry
(
fout
,
finfo
[
i
].
oid
,
fn
->
data
,
"FUNCTION"
,
NULL
,
q
->
data
,
delqry
->
data
,
ArchiveEntry
(
fout
,
finfo
[
i
].
oid
,
fn
->
data
,
"FUNCTION"
,
NULL
,
q
->
data
,
delqry
->
data
,
""
,
finfo
[
i
].
usename
,
NULL
,
NULL
);
""
,
finfo
[
i
].
usename
,
NULL
,
NULL
);
...
...
src/bin/pg_dump/pg_dump.h
View file @
74e33110
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: pg_dump.h,v 1.5
0 2000/07/17 03:05:20 tgl
Exp $
* $Id: pg_dump.h,v 1.5
1 2000/08/07 12:32:54 pjw
Exp $
*
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
*
...
@@ -62,6 +62,7 @@ typedef struct _funcInfo
...
@@ -62,6 +62,7 @@ typedef struct _funcInfo
char
*
prosrc
;
char
*
prosrc
;
char
*
probin
;
char
*
probin
;
char
*
usename
;
char
*
usename
;
int
iscachable
;
/* Attr */
int
dumped
;
/* 1 if already dumped */
int
dumped
;
/* 1 if already dumped */
}
FuncInfo
;
}
FuncInfo
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment