#include "catalog/genbki.h"
#include "catalog/pg_tablespace_d.h"
Go to the source code of this file.
|
| | CATALOG (pg_tablespace, 1213, TableSpaceRelationId) BKI_SHARED_RELATION |
| |
| | DECLARE_TOAST_WITH_MACRO (pg_tablespace, 4185, 4186, PgTablespaceToastTable, PgTablespaceToastIndex) |
| |
| | DECLARE_UNIQUE_INDEX_PKEY (pg_tablespace_oid_index, 2697, TablespaceOidIndexId, pg_tablespace, btree(oid oid_ops)) |
| |
| | DECLARE_UNIQUE_INDEX (pg_tablespace_spcname_index, 2698, TablespaceNameIndexId, pg_tablespace, btree(spcname name_ops)) |
| |
| | MAKE_SYSCACHE (TABLESPACEOID, pg_tablespace_oid_index, 4) |
| |
| char * | get_tablespace_location (Oid tablespaceOid) |
| |
◆ Form_pg_tablespace
◆ CATALOG()
| CATALOG |
( |
pg_tablespace |
, |
|
|
1213 |
, |
|
|
TableSpaceRelationId |
|
|
) |
| |
Definition at line 29 of file pg_tablespace.h.
30{
33
34
36
37#ifdef CATALOG_VARLEN
38 aclitem spcacl[1];
40#endif
#define BKI_LOOKUP(catalog)
#define BKI_DEFAULT(value)
References BKI_DEFAULT, and BKI_LOOKUP.
◆ DECLARE_TOAST_WITH_MACRO()
| DECLARE_TOAST_WITH_MACRO |
( |
pg_tablespace |
, |
|
|
4185 |
, |
|
|
4186 |
, |
|
|
PgTablespaceToastTable |
, |
|
|
PgTablespaceToastIndex |
|
|
) |
| |
◆ DECLARE_UNIQUE_INDEX()
| DECLARE_UNIQUE_INDEX |
( |
pg_tablespace_spcname_index |
, |
|
|
2698 |
, |
|
|
TablespaceNameIndexId |
, |
|
|
pg_tablespace |
, |
|
|
btree(spcname name_ops) |
|
|
) |
| |
◆ DECLARE_UNIQUE_INDEX_PKEY()
| DECLARE_UNIQUE_INDEX_PKEY |
( |
pg_tablespace_oid_index |
, |
|
|
2697 |
, |
|
|
TablespaceOidIndexId |
, |
|
|
pg_tablespace |
, |
|
|
btree(oid oid_ops) |
|
|
) |
| |
◆ get_tablespace_location()
| char * get_tablespace_location |
( |
Oid |
tablespaceOid | ) |
|
Definition at line 30 of file pg_tablespace.c.
31{
34 int rllen;
36
37
38
39
40
41
44
45
46
47
48 if (tablespaceOid == DEFAULTTABLESPACE_OID ||
49 tablespaceOid == GLOBALTABLESPACE_OID)
51
52
53
54
55
57
58
59
60
61
62
63
64 if (
lstat(sourcepath, &st) < 0)
67 errmsg(
"could not stat file \"%s\": %m",
68 sourcepath));
69
72
73
74
75
76 rllen =
readlink(sourcepath, targetpath,
sizeof(targetpath));
77 if (rllen < 0)
80 errmsg(
"could not read symbolic link \"%s\": %m",
81 sourcepath));
82 if (rllen >= sizeof(targetpath))
84 errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
85 errmsg(
"symbolic link \"%s\" target is too long",
86 sourcepath));
87 targetpath[rllen] = '\0';
88
90}
int errcode_for_file_access(void)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
char * pstrdup(const char *in)
#define readlink(path, buf, size)
References ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, InvalidOid, lstat, MAXPGPATH, MyDatabaseTableSpace, PG_TBLSPC_DIR, pstrdup(), readlink, S_ISLNK, snprintf, and stat::st_mode.
Referenced by pg_tablespace_location().
◆ MAKE_SYSCACHE()
| MAKE_SYSCACHE |
( |
TABLESPACEOID |
, |
|
|
pg_tablespace_oid_index |
, |
|
|
4 |
|
|
) |
| |
◆ FormData_pg_tablespace