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

Commit3498ea8

Browse files
author
Hiroshi Inoue
committed
Improve the following.
=# create table t (id int4 unique);NOTICE: CREATE TABLE/UNIQUE will create implicit index 't_id_key' for table 't' =# begin; query: drop table t;NOTICE: Caution: DROP TABLE cannot be rolled back, so don't abort nowNOTICE: Caution: DROP INDEX cannot be rolled back, so don't abort now =# rollback; =# drop table t;NOTICE: mdopen: couldn't open t: No such file or directoryNOTICE: RelationIdBuildRelation: smgropen(t): No such file or directoryNOTICE: mdopen: couldn't open t: No such file or directoryNOTICE: mdopen: couldn't open t: No such file or directoryNOTICE: mdopen: couldn't open t_id_key: No such file or directoryNOTICE: RelationIdBuildRelation: smgropen(t_id_key): No such file or directoryNOTICE: mdopen: couldn't open t: No such file or directoryNOTICE: RelationIdBuildRelation: smgropen(t): No such file or directoryNOTICE: mdopen: couldn't open t: No such file or directoryERROR: cannot open relation t
1 parent67cd018 commit3498ea8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.109 2000/08/06 04:39:03 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.110 2000/08/30 08:48:55 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1595,7 +1595,10 @@ RelationClearRelation(Relation relation, bool rebuildIt)
15951595
* this is kind of expensive, but I think we must do it in case
15961596
* relation has been truncated...
15971597
*/
1598-
relation->rd_nblocks=RelationGetNumberOfBlocks(relation);
1598+
if (relation->rd_unlinked)
1599+
relation->rd_nblocks=0;
1600+
else
1601+
relation->rd_nblocks=RelationGetNumberOfBlocks(relation);
15991602

16001603
if (relDescChanged&& !RelationHasReferenceCountZero(relation))
16011604
elog(ERROR,"RelationClearRelation: relation %u modified while in use",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp