#include "postgres.h"#include "storage/smgr.h"
Go to the source code of this file.
Data Structures | |
| struct | smgrid |
Typedefs | |
| typedef struct smgrid | smgrid |
Functions | |
| Datum | smgrin (PG_FUNCTION_ARGS) |
| Datum | smgrout (PG_FUNCTION_ARGS) |
| Datum | smgreq (PG_FUNCTION_ARGS) |
| Datum | smgrne (PG_FUNCTION_ARGS) |
Variables | |
| static const smgrid | StorageManager [] |
| static const int | NStorageManagers = lengthof(StorageManager) |
| Datum smgreq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 64 of file smgrtype.c.
References PG_GETARG_INT16, and PG_RETURN_BOOL.
{
int16 a = PG_GETARG_INT16(0);
int16 b = PG_GETARG_INT16(1);
PG_RETURN_BOOL(a == b);
}
| Datum smgrin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 36 of file smgrtype.c.
References elog, ERROR, i, NStorageManagers, PG_GETARG_CSTRING, and PG_RETURN_INT16.
{
char *s = PG_GETARG_CSTRING(0);
int16 i;
for (i = 0; i < NStorageManagers; i++)
{
if (strcmp(s, StorageManager[i].smgr_name) == 0)
PG_RETURN_INT16(i);
}
elog(ERROR, "unrecognized storage manager name \"%s\"", s);
PG_RETURN_INT16(0);
}
| Datum smgrne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 73 of file smgrtype.c.
References PG_GETARG_INT16, and PG_RETURN_BOOL.
{
int16 a = PG_GETARG_INT16(0);
int16 b = PG_GETARG_INT16(1);
PG_RETURN_BOOL(a != b);
}
| Datum smgrout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 51 of file smgrtype.c.
References elog, ERROR, i, NStorageManagers, PG_GETARG_INT16, PG_RETURN_CSTRING, and pstrdup().
{
int16 i = PG_GETARG_INT16(0);
char *s;
if (i >= NStorageManagers || i < 0)
elog(ERROR, "invalid storage manager ID: %d", i);
s = pstrdup(StorageManager[i].smgr_name);
PG_RETURN_CSTRING(s);
}
const int NStorageManagers = lengthof(StorageManager) [static] |
Definition at line 32 of file smgrtype.c.
const smgrid StorageManager[] [static] |
{
{"magnetic disk"}
}
Definition at line 28 of file smgrtype.c.
1.7.1