11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.36 2000/06/05 07:28:47 tgl Exp $
14
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.37 2000/06/19 23:37:08 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" ,
108
+ elog (FATAL ,"initialization failed on %s: %m " ,
109
109
DatumGetCString (DirectFunctionCall1 (smgrout ,
110
110
Int16GetDatum (i ))));
111
111
}
@@ -127,7 +127,7 @@ smgrshutdown(int dummy)
127
127
if (smgrsw [i ].smgr_shutdown )
128
128
{
129
129
if ((* (smgrsw [i ].smgr_shutdown )) ()== SM_FAIL )
130
- elog (FATAL ,"shutdown failed on %s" ,
130
+ elog (FATAL ,"shutdown failed on %s: %m " ,
131
131
DatumGetCString (DirectFunctionCall1 (smgrout ,
132
132
Int16GetDatum (i ))));
133
133
}
@@ -146,7 +146,7 @@ smgrcreate(int16 which, Relation reln)
146
146
int fd ;
147
147
148
148
if ((fd = (* (smgrsw [which ].smgr_create )) (reln ))< 0 )
149
- elog (ERROR ,"cannot create %s" ,RelationGetRelationName (reln ));
149
+ elog (ERROR ,"cannot create %s: %m " ,RelationGetRelationName (reln ));
150
150
151
151
return fd ;
152
152
}
@@ -162,7 +162,7 @@ smgrunlink(int16 which, Relation reln)
162
162
int status ;
163
163
164
164
if ((status = (* (smgrsw [which ].smgr_unlink )) (reln ))== SM_FAIL )
165
- elog (ERROR ,"cannot unlink %s" ,RelationGetRelationName (reln ));
165
+ elog (ERROR ,"cannot unlink %s: %m " ,RelationGetRelationName (reln ));
166
166
167
167
return status ;
168
168
}
@@ -181,7 +181,7 @@ smgrextend(int16 which, Relation reln, char *buffer)
181
181
status = (* (smgrsw [which ].smgr_extend )) (reln ,buffer );
182
182
183
183
if (status == SM_FAIL )
184
- elog (ERROR ,"%s: cannot extend. Check free disk space." ,
184
+ elog (ERROR ,"cannot extend %s: %m.\n\tCheck free disk space." ,
185
185
RelationGetRelationName (reln ));
186
186
187
187
return status ;
@@ -200,7 +200,7 @@ smgropen(int16 which, Relation reln)
200
200
201
201
if ((fd = (* (smgrsw [which ].smgr_open )) (reln ))< 0 &&
202
202
!reln -> rd_unlinked )
203
- elog (ERROR ,"cannot open %s" ,RelationGetRelationName (reln ));
203
+ elog (ERROR ,"cannot open %s: %m " ,RelationGetRelationName (reln ));
204
204
205
205
return fd ;
206
206
}
220
220
smgrclose (int16 which ,Relation reln )
221
221
{
222
222
if ((* (smgrsw [which ].smgr_close )) (reln )== SM_FAIL )
223
- elog (ERROR ,"cannot close %s" ,RelationGetRelationName (reln ));
223
+ elog (ERROR ,"cannot close %s: %m " ,RelationGetRelationName (reln ));
224
224
225
225
return SM_SUCCESS ;
226
226
}
@@ -243,7 +243,7 @@ smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
243
243
status = (* (smgrsw [which ].smgr_read )) (reln ,blocknum ,buffer );
244
244
245
245
if (status == SM_FAIL )
246
- elog (ERROR ,"cannot read block %d of %s" ,
246
+ elog (ERROR ,"cannot read block %d of %s: %m " ,
247
247
blocknum ,RelationGetRelationName (reln ));
248
248
249
249
return status ;
@@ -265,7 +265,7 @@ smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
265
265
status = (* (smgrsw [which ].smgr_write )) (reln ,blocknum ,buffer );
266
266
267
267
if (status == SM_FAIL )
268
- elog (ERROR ,"cannot write block %d of %s" ,
268
+ elog (ERROR ,"cannot write block %d of %s: %m " ,
269
269
blocknum ,RelationGetRelationName (reln ));
270
270
271
271
return status ;
@@ -282,7 +282,7 @@ smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
282
282
status = (* (smgrsw [which ].smgr_flush )) (reln ,blocknum ,buffer );
283
283
284
284
if (status == SM_FAIL )
285
- elog (ERROR ,"cannot flush block %d of %s to stable store" ,
285
+ elog (ERROR ,"cannot flush block %d of %s to stable store: %m " ,
286
286
blocknum ,RelationGetRelationName (reln ));
287
287
288
288
return status ;
@@ -323,7 +323,7 @@ smgrblindwrt(int16 which,
323
323
blkno ,buffer ,dofsync );
324
324
325
325
if (status == SM_FAIL )
326
- elog (ERROR ,"cannot write block %d of %s [%s] blind" ,
326
+ elog (ERROR ,"cannot write block %d of %s [%s] blind: %m " ,
327
327
blkno ,relstr ,dbstr );
328
328
329
329
pfree (dbstr );
@@ -352,7 +352,7 @@ smgrmarkdirty(int16 which,
352
352
status = (* (smgrsw [which ].smgr_markdirty )) (reln ,blkno );
353
353
354
354
if (status == SM_FAIL )
355
- elog (ERROR ,"cannot mark block %d of %s" ,
355
+ elog (ERROR ,"cannot mark block %d of %s: %m " ,
356
356
blkno ,RelationGetRelationName (reln ));
357
357
358
358
return status ;
@@ -384,7 +384,7 @@ smgrblindmarkdirty(int16 which,
384
384
blkno );
385
385
386
386
if (status == SM_FAIL )
387
- elog (ERROR ,"cannot mark block %d of %s [%s] blind" ,
387
+ elog (ERROR ,"cannot mark block %d of %s [%s] blind: %m " ,
388
388
blkno ,relstr ,dbstr );
389
389
390
390
pfree (dbstr );
@@ -406,7 +406,7 @@ smgrnblocks(int16 which, Relation reln)
406
406
int nblocks ;
407
407
408
408
if ((nblocks = (* (smgrsw [which ].smgr_nblocks )) (reln ))< 0 )
409
- elog (ERROR ,"cannot count blocks for %s" ,
409
+ elog (ERROR ,"cannot count blocks for %s: %m " ,
410
410
RelationGetRelationName (reln ));
411
411
412
412
return nblocks ;
@@ -428,7 +428,7 @@ smgrtruncate(int16 which, Relation reln, int nblocks)
428
428
if (smgrsw [which ].smgr_truncate )
429
429
{
430
430
if ((newblks = (* (smgrsw [which ].smgr_truncate )) (reln ,nblocks ))< 0 )
431
- elog (ERROR ,"cannot truncate %s to %d blocks" ,
431
+ elog (ERROR ,"cannot truncate %s to %d blocks: %m " ,
432
432
RelationGetRelationName (reln ),nblocks );
433
433
}
434
434
@@ -449,7 +449,7 @@ smgrcommit()
449
449
if (smgrsw [i ].smgr_commit )
450
450
{
451
451
if ((* (smgrsw [i ].smgr_commit )) ()== SM_FAIL )
452
- elog (FATAL ,"transaction commit failed on %s" ,
452
+ elog (FATAL ,"transaction commit failed on %s: %m " ,
453
453
DatumGetCString (DirectFunctionCall1 (smgrout ,
454
454
Int16GetDatum (i ))));
455
455
}
@@ -468,7 +468,7 @@ smgrabort()
468
468
if (smgrsw [i ].smgr_abort )
469
469
{
470
470
if ((* (smgrsw [i ].smgr_abort )) ()== SM_FAIL )
471
- elog (FATAL ,"transaction abort failed on %s" ,
471
+ elog (FATAL ,"transaction abort failed on %s: %m " ,
472
472
DatumGetCString (DirectFunctionCall1 (smgrout ,
473
473
Int16GetDatum (i ))));
474
474
}