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
ed8aa971
Commit
ed8aa971
authored
Apr 24, 2002
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to NAMEDATALEN and INDEX_MAX_KEYS from pg_dump. Handles
any size now.
parent
8889eb09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+22
-12
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump.h
+4
-3
No files found.
src/bin/pg_dump/pg_dump.c
View file @
ed8aa971
...
...
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.25
4 2002/04/24 02:44:19 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.25
5 2002/04/24 22:39:49 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1802,10 +1802,12 @@ clearIndInfo(IndInfo *ind, int numIndexes)
free
(
ind
[
i
].
indexdef
);
if
(
ind
[
i
].
indisprimary
)
free
(
ind
[
i
].
indisprimary
);
for
(
a
=
0
;
a
<
INDEX_MAX_KEYS
;
++
a
)
if
(
ind
[
i
].
indkey
)
{
if
(
ind
[
i
].
indkey
[
a
])
free
(
ind
[
i
].
indkey
[
a
]);
for
(
a
=
0
;
a
<
ind
[
i
].
indnkeys
;
++
a
)
if
(
ind
[
i
].
indkey
[
a
])
free
(
ind
[
i
].
indkey
[
a
]);
free
(
ind
[
i
].
indkey
);
}
}
free
(
ind
);
...
...
@@ -3020,6 +3022,7 @@ getIndexes(int *numIndexes)
int
i_indrelname
;
int
i_indexdef
;
int
i_indisprimary
;
int
i_indnkeys
;
int
i_indkey
;
/*
...
...
@@ -3033,11 +3036,14 @@ getIndexes(int *numIndexes)
appendPQExpBuffer
(
query
,
"SELECT i.indexrelid as indexreloid, "
"i.indrelid as indreloid, "
"t1.relname as indexrelname, t2.relname as indrelname, "
"t1.relname as indexrelname, t2.relname as indrelname, "
"pg_get_indexdef(i.indexrelid) as indexdef, "
"i.indisprimary, i.indkey "
"from pg_index i, pg_class t1, pg_class t2 "
"WHERE t1.oid = i.indexrelid and t2.oid = i.indrelid "
"i.indisprimary, i.indkey, "
"CASE WHEN regproctooid(i.indproc) <> 0 "
" THEN (SELECT pronargs FROM pg_proc WHERE pg_proc.oid = regproctooid(i.indproc)) "
" ELSE t1.relnatts END as indnkeys "
"FROM pg_index i, pg_class t1, pg_class t2 "
"WHERE t1.oid = i.indexrelid and t2.oid = i.indrelid "
"and i.indexrelid > '%u'::oid "
"and t2.relname !~ '^pg_' "
,
g_last_builtin_oid
);
...
...
@@ -3067,6 +3073,7 @@ getIndexes(int *numIndexes)
i_indrelname
=
PQfnumber
(
res
,
"indrelname"
);
i_indexdef
=
PQfnumber
(
res
,
"indexdef"
);
i_indisprimary
=
PQfnumber
(
res
,
"indisprimary"
);
i_indnkeys
=
PQfnumber
(
res
,
"indnkeys"
);
i_indkey
=
PQfnumber
(
res
,
"indkey"
);
for
(
i
=
0
;
i
<
ntups
;
i
++
)
...
...
@@ -3077,9 +3084,11 @@ getIndexes(int *numIndexes)
indinfo
[
i
].
indrelname
=
strdup
(
PQgetvalue
(
res
,
i
,
i_indrelname
));
indinfo
[
i
].
indexdef
=
strdup
(
PQgetvalue
(
res
,
i
,
i_indexdef
));
indinfo
[
i
].
indisprimary
=
strdup
(
PQgetvalue
(
res
,
i
,
i_indisprimary
));
indinfo
[
i
].
indnkeys
=
atoi
(
PQgetvalue
(
res
,
i
,
i_indnkeys
));
indinfo
[
i
].
indkey
=
malloc
(
indinfo
[
i
].
indnkeys
*
sizeof
(
indinfo
[
i
].
indkey
[
0
]));
parseNumericArray
(
PQgetvalue
(
res
,
i
,
i_indkey
),
indinfo
[
i
].
indkey
,
INDEX_MAX_KEYS
);
indinfo
[
i
].
indnkeys
);
}
PQclear
(
res
);
...
...
@@ -3577,7 +3586,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
PQExpBuffer
delqry
=
createPQExpBuffer
();
PQExpBuffer
fnlist
=
createPQExpBuffer
();
PQExpBuffer
asPart
=
createPQExpBuffer
();
char
func_lang
[
NAMEDATALEN
+
1
]
;
char
*
func_lang
=
NULL
;
PGresult
*
res
;
int
nlangs
;
int
j
;
...
...
@@ -3638,7 +3647,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
}
}
strcpy
(
func_lang
,
PQgetvalue
(
res
,
0
,
i_lanname
));
func_lang
=
strdup
(
PQgetvalue
(
res
,
0
,
i_lanname
));
PQclear
(
res
);
...
...
@@ -3749,6 +3758,7 @@ done:
destroyPQExpBuffer
(
delqry
);
destroyPQExpBuffer
(
fnlist
);
destroyPQExpBuffer
(
asPart
);
free
(
func_lang
);
}
/*
...
...
@@ -4515,7 +4525,7 @@ getPKconstraint(TableInfo *tblInfo, IndInfo *indInfo)
appendPQExpBuffer
(
pkBuf
,
"Constraint %s Primary Key ("
,
tblInfo
->
primary_key_name
);
for
(
k
=
0
;
k
<
INDEX_MAX_KEYS
;
k
++
)
for
(
k
=
0
;
k
<
indInfo
->
indnkeys
;
k
++
)
{
int
indkey
;
const
char
*
attname
;
...
...
src/bin/pg_dump/pg_dump.h
View file @
ed8aa971
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_dump.h,v 1.8
3 2002/04/24 02:44:19 momjian
Exp $
* $Id: pg_dump.h,v 1.8
4 2002/04/24 22:39:49 petere
Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
...
...
@@ -148,8 +148,9 @@ typedef struct _indInfo
char
*
indrelname
;
/* name of the indexed table */
char
*
indexdef
;
/* index definitional command */
char
*
indisprimary
;
/* is this a PK index? */
char
*
indkey
[
INDEX_MAX_KEYS
];
/* attribute numbers of the key
* attributes */
int
indnkeys
;
/* number of keys in index */
char
**
indkey
;
/* attribute numbers of the key
* attributes */
}
IndInfo
;
typedef
struct
_aggInfo
...
...
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