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

Commitc2b75c8

Browse files
committed
All works on linux now by my tests and regression(with patch below).
ALTER TABLE RENAME with extents.Ole Gjerde
1 parent19c4e86 commitc2b75c8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎src/backend/commands/rename.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.23 1999/05/10 00:44:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.24 1999/05/17 18:24:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -201,10 +201,13 @@ renameatt(char *relname,
201201
void
202202
renamerel(char*oldrelname,char*newrelname)
203203
{
204+
inti;
204205
Relationrelrelation;/* for RELATION relation */
205206
HeapTupleoldreltup;
206207
charoldpath[MAXPGPATH],
207-
newpath[MAXPGPATH];
208+
newpath[MAXPGPATH],
209+
toldpath[MAXPGPATH+10],
210+
tnewpath[MAXPGPATH+10];
208211
Relationirelations[Num_pg_class_indices];
209212

210213
if (!allowSystemTableMods&&IsSystemRelationName(oldrelname))
@@ -230,6 +233,14 @@ renamerel(char *oldrelname, char *newrelname)
230233
if (rename(oldpath,newpath)<0)
231234
elog(ERROR,"renamerel: unable to rename file: %s",oldpath);
232235

236+
for (i=1;;i++)
237+
{
238+
sprintf(toldpath,"%s.%d",oldpath,i);
239+
sprintf(tnewpath,"%s.%d",newpath,i);
240+
if(rename(toldpath,tnewpath)<0)
241+
break;
242+
}
243+
233244
StrNCpy((((Form_pg_class)GETSTRUCT(oldreltup))->relname.data),
234245
newrelname,NAMEDATALEN);
235246

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp