Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita60b32b

Browse files
committed
In pg_upgrade, remove unnecessary separate handling of toast tables now
that we restore by oid; they can be handled like regular tables whencreating the file mapping structure.
1 parentaf84bee commita60b32b

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

‎contrib/pg_upgrade/info.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,50 +50,13 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
5050
RelInfo*old_rel=&old_db->rel_arr.rels[relnum];
5151
RelInfo*new_rel;
5252

53-
/* toast tables are handled by their parents */
54-
if (strcmp(old_rel->nspname,"pg_toast")==0)
55-
continue;
56-
5753
/* old/new relation names always match */
5854
new_rel=relarr_lookup_rel_name(&new_cluster,&new_db->rel_arr,
5955
old_rel->nspname,old_rel->relname);
6056

6157
create_rel_filename_map(old_pgdata,new_pgdata,old_db,new_db,
6258
old_rel,new_rel,maps+num_maps);
6359
num_maps++;
64-
65-
/*
66-
* So much for mapping this relation; now we need a mapping
67-
* for its corresponding toast relation and toast index, if any.
68-
*/
69-
if (old_rel->toastrelid>0)
70-
{
71-
charold_name[MAXPGPATH],new_name[MAXPGPATH];
72-
RelInfo*old_toast,*new_toast;
73-
74-
/* use the toast relids from the rel_arr for lookups */
75-
old_toast=relarr_lookup_rel_oid(&old_cluster,&old_db->rel_arr,
76-
old_rel->toastrelid);
77-
new_toast=relarr_lookup_rel_oid(&new_cluster,&new_db->rel_arr,
78-
new_rel->toastrelid);
79-
80-
create_rel_filename_map(old_pgdata,new_pgdata,old_db,new_db,
81-
old_toast,new_toast,maps+num_maps);
82-
num_maps++;
83-
84-
/* toast indexes are the same, except with an "_index" suffix */
85-
snprintf(old_name,sizeof(old_name),"%s_index",old_toast->relname);
86-
snprintf(new_name,sizeof(new_name),"%s_index",new_toast->relname);
87-
88-
old_toast=relarr_lookup_rel_name(&old_cluster,&old_db->rel_arr,
89-
"pg_toast",old_name);
90-
new_toast=relarr_lookup_rel_name(&new_cluster,&new_db->rel_arr,
91-
"pg_toast",new_name);
92-
93-
create_rel_filename_map(old_pgdata,new_pgdata,old_db,
94-
new_db,old_toast,new_toast,maps+num_maps);
95-
num_maps++;
96-
}
9760
}
9861

9962
*nmaps=num_maps;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp