11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.35 2000/04/12 17:15:42 momjian Exp $
14
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.35.2.1 2000/09/23 22: 17:12 tgl Exp $
15
15
*
16
16
*-------------------------------------------------------------------------
17
17
*/
@@ -105,7 +105,7 @@ smgrinit()
105
105
if (smgrsw [i ].smgr_init )
106
106
{
107
107
if ((* (smgrsw [i ].smgr_init )) () == SM_FAIL )
108
- elog (FATAL , "initialization failed on %s" , smgrout (i ));
108
+ elog (FATAL , "initialization failed on %s: %m " , smgrout (i ));
109
109
}
110
110
}
111
111
@@ -125,7 +125,7 @@ smgrshutdown(int dummy)
125
125
if (smgrsw [i ].smgr_shutdown )
126
126
{
127
127
if ((* (smgrsw [i ].smgr_shutdown )) () == SM_FAIL )
128
- elog (FATAL , "shutdown failed on %s" , smgrout (i ));
128
+ elog (FATAL , "shutdown failed on %s: %m " , smgrout (i ));
129
129
}
130
130
}
131
131
}
@@ -142,7 +142,7 @@ smgrcreate(int16 which, Relation reln)
142
142
int fd ;
143
143
144
144
if ((fd = (* (smgrsw [which ].smgr_create )) (reln )) < 0 )
145
- elog (ERROR , "cannot create %s" , RelationGetRelationName (reln ));
145
+ elog (ERROR , "cannot create %s: %m " , RelationGetRelationName (reln ));
146
146
147
147
return fd ;
148
148
}
@@ -158,7 +158,7 @@ smgrunlink(int16 which, Relation reln)
158
158
int status ;
159
159
160
160
if ((status = (* (smgrsw [which ].smgr_unlink )) (reln )) == SM_FAIL )
161
- elog (ERROR , "cannot unlink %s" , RelationGetRelationName (reln ));
161
+ elog (ERROR , "cannot unlink %s: %m " , RelationGetRelationName (reln ));
162
162
163
163
return status ;
164
164
}
@@ -177,7 +177,7 @@ smgrextend(int16 which, Relation reln, char *buffer)
177
177
status = (* (smgrsw [which ].smgr_extend )) (reln , buffer );
178
178
179
179
if (status == SM_FAIL )
180
- elog (ERROR , "%s: cannot extend. Check free disk space." ,
180
+ elog (ERROR , "cannot extend %s: %m.\n\tCheck free disk space." ,
181
181
RelationGetRelationName (reln ));
182
182
183
183
return status ;
@@ -196,7 +196,7 @@ smgropen(int16 which, Relation reln)
196
196
197
197
if ((fd = (* (smgrsw [which ].smgr_open )) (reln )) < 0 &&
198
198
!reln -> rd_unlinked )
199
- elog (ERROR , "cannot open %s" , RelationGetRelationName (reln ));
199
+ elog (ERROR , "cannot open %s: %m " , RelationGetRelationName (reln ));
200
200
201
201
return fd ;
202
202
}
216
216
smgrclose (int16 which , Relation reln )
217
217
{
218
218
if ((* (smgrsw [which ].smgr_close )) (reln ) == SM_FAIL )
219
- elog (ERROR , "cannot close %s" , RelationGetRelationName (reln ));
219
+ elog (ERROR , "cannot close %s: %m " , RelationGetRelationName (reln ));
220
220
221
221
return SM_SUCCESS ;
222
222
}
@@ -239,7 +239,7 @@ smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
239
239
status = (* (smgrsw [which ].smgr_read )) (reln , blocknum , buffer );
240
240
241
241
if (status == SM_FAIL )
242
- elog (ERROR , "cannot read block %d of %s" ,
242
+ elog (ERROR , "cannot read block %d of %s: %m " ,
243
243
blocknum , RelationGetRelationName (reln ));
244
244
245
245
return status ;
@@ -261,7 +261,7 @@ smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
261
261
status = (* (smgrsw [which ].smgr_write )) (reln , blocknum , buffer );
262
262
263
263
if (status == SM_FAIL )
264
- elog (ERROR , "cannot write block %d of %s" ,
264
+ elog (ERROR , "cannot write block %d of %s: %m " ,
265
265
blocknum , RelationGetRelationName (reln ));
266
266
267
267
return status ;
@@ -278,7 +278,7 @@ smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
278
278
status = (* (smgrsw [which ].smgr_flush )) (reln , blocknum , buffer );
279
279
280
280
if (status == SM_FAIL )
281
- elog (ERROR , "cannot flush block %d of %s to stable store" ,
281
+ elog (ERROR , "cannot flush block %d of %s to stable store: %m " ,
282
282
blocknum , RelationGetRelationName (reln ));
283
283
284
284
return status ;
@@ -319,7 +319,7 @@ smgrblindwrt(int16 which,
319
319
blkno , buffer , dofsync );
320
320
321
321
if (status == SM_FAIL )
322
- elog (ERROR , "cannot write block %d of %s [%s] blind" ,
322
+ elog (ERROR , "cannot write block %d of %s [%s] blind: %m " ,
323
323
blkno , relstr , dbstr );
324
324
325
325
pfree (dbstr );
@@ -348,7 +348,7 @@ smgrmarkdirty(int16 which,
348
348
status = (* (smgrsw [which ].smgr_markdirty )) (reln , blkno );
349
349
350
350
if (status == SM_FAIL )
351
- elog (ERROR , "cannot mark block %d of %s" ,
351
+ elog (ERROR , "cannot mark block %d of %s: %m " ,
352
352
blkno , RelationGetRelationName (reln ));
353
353
354
354
return status ;
@@ -380,7 +380,7 @@ smgrblindmarkdirty(int16 which,
380
380
blkno );
381
381
382
382
if (status == SM_FAIL )
383
- elog (ERROR , "cannot mark block %d of %s [%s] blind" ,
383
+ elog (ERROR , "cannot mark block %d of %s [%s] blind: %m " ,
384
384
blkno , relstr , dbstr );
385
385
386
386
pfree (dbstr );
@@ -402,7 +402,7 @@ smgrnblocks(int16 which, Relation reln)
402
402
int nblocks ;
403
403
404
404
if ((nblocks = (* (smgrsw [which ].smgr_nblocks )) (reln )) < 0 )
405
- elog (ERROR , "cannot count blocks for %s" ,
405
+ elog (ERROR , "cannot count blocks for %s: %m " ,
406
406
RelationGetRelationName (reln ));
407
407
408
408
return nblocks ;
@@ -424,7 +424,7 @@ smgrtruncate(int16 which, Relation reln, int nblocks)
424
424
if (smgrsw [which ].smgr_truncate )
425
425
{
426
426
if ((newblks = (* (smgrsw [which ].smgr_truncate )) (reln , nblocks )) < 0 )
427
- elog (ERROR , "cannot truncate %s to %d blocks" ,
427
+ elog (ERROR , "cannot truncate %s to %d blocks: %m " ,
428
428
RelationGetRelationName (reln ), nblocks );
429
429
}
430
430
@@ -445,7 +445,7 @@ smgrcommit()
445
445
if (smgrsw [i ].smgr_commit )
446
446
{
447
447
if ((* (smgrsw [i ].smgr_commit )) () == SM_FAIL )
448
- elog (FATAL , "transaction commit failed on %s" , smgrout (i ));
448
+ elog (FATAL , "transaction commit failed on %s: %m " , smgrout (i ));
449
449
}
450
450
}
451
451
@@ -462,7 +462,7 @@ smgrabort()
462
462
if (smgrsw [i ].smgr_abort )
463
463
{
464
464
if ((* (smgrsw [i ].smgr_abort )) () == SM_FAIL )
465
- elog (FATAL , "transaction abort failed on %s" , smgrout (i ));
465
+ elog (FATAL , "transaction abort failed on %s: %m " , smgrout (i ));
466
466
}
467
467
}
468
468
0 commit comments