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
e69d3215
Commit
e69d3215
authored
Apr 07, 2011
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify structure of query used to gather database object information
in pg_upgrade.
parent
d8d42989
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
contrib/pg_upgrade/info.c
contrib/pg_upgrade/info.c
+14
-16
No files found.
contrib/pg_upgrade/info.c
View file @
e69d3215
...
...
@@ -255,27 +255,25 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
snprintf
(
query
,
sizeof
(
query
),
"SELECT c.oid, n.nspname, c.relname, "
" c.relfilenode, t.spclocation "
"FROM pg_catalog.pg_class c JOIN "
" pg_catalog.pg_namespace n "
" ON c.relnamespace = n.oid "
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
" ON c.reltablespace = t.oid "
"WHERE (( n.nspname NOT IN ('pg_catalog', 'information_schema', 'binary_upgrade') "
" AND c.oid >= %u "
" ) OR ( "
" n.nspname = 'pg_catalog' "
" AND relname IN "
" ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) )) "
" AND relkind IN ('r','t', 'i'%s) "
"FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n "
" ON c.relnamespace = n.oid "
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
" ON c.reltablespace = t.oid "
"WHERE relkind IN ('r','t', 'i'%s) AND "
" ((n.nspname NOT IN ('pg_catalog', 'information_schema', 'binary_upgrade') AND "
" c.oid >= %u) "
" OR (n.nspname = 'pg_catalog' AND "
" relname IN ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) )) "
/* we preserve pg_class.oid so we sort by it to match old/new */
"ORDER BY 1;"
,
/* see the comment at the top of old_8_3_create_sequence_script() */
(
GET_MAJOR_VERSION
(
old_cluster
.
major_version
)
<=
803
)
?
""
:
", 'S'"
,
/* this oid allows us to skip system toast tables */
FirstNormalObjectId
,
/* does pg_largeobject_metadata need to be migrated? */
(
GET_MAJOR_VERSION
(
old_cluster
.
major_version
)
<=
804
)
?
""
:
", 'pg_largeobject_metadata', 'pg_largeobject_metadata_oid_index'"
,
/* see the comment at the top of old_8_3_create_sequence_script() */
(
GET_MAJOR_VERSION
(
old_cluster
.
major_version
)
<=
803
)
?
""
:
", 'S'"
);
""
:
", 'pg_largeobject_metadata', 'pg_largeobject_metadata_oid_index'"
);
res
=
executeQueryOrDie
(
conn
,
query
);
...
...
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