#include "postgres.h"#include "catalog/namespace.h"#include "catalog/pg_type.h"#include "commands/extension.h"#include "miscadmin.h"#include "utils/array.h"#include "utils/builtins.h"
Go to the source code of this file.
| Datum create_empty_extension | ( | PG_FUNCTION_ARGS | ) |
Definition at line 145 of file pg_upgrade_support.c.
References DatumGetTextPP, deconstruct_array(), get_extension_oid(), get_namespace_oid(), GetUserId(), i, InsertExtensionTuple(), lappend_oid(), NULL, PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PointerGetDatum, text_to_cstring(), and TEXTOID.
{
text *extName = PG_GETARG_TEXT_PP(0);
text *schemaName = PG_GETARG_TEXT_PP(1);
bool relocatable = PG_GETARG_BOOL(2);
text *extVersion = PG_GETARG_TEXT_PP(3);
Datum extConfig;
Datum extCondition;
List *requiredExtensions;
if (PG_ARGISNULL(4))
extConfig = PointerGetDatum(NULL);
else
extConfig = PG_GETARG_DATUM(4);
if (PG_ARGISNULL(5))
extCondition = PointerGetDatum(NULL);
else
extCondition = PG_GETARG_DATUM(5);
requiredExtensions = NIL;
if (!PG_ARGISNULL(6))
{
ArrayType *textArray = PG_GETARG_ARRAYTYPE_P(6);
Datum *textDatums;
int ndatums;
int i;
deconstruct_array(textArray,
TEXTOID, -1, false, 'i',
&textDatums, NULL, &ndatums);
for (i = 0; i < ndatums; i++)
{
text *txtname = DatumGetTextPP(textDatums[i]);
char *extName = text_to_cstring(txtname);
Oid extOid = get_extension_oid(extName, false);
requiredExtensions = lappend_oid(requiredExtensions, extOid);
}
}
InsertExtensionTuple(text_to_cstring(extName),
GetUserId(),
get_namespace_oid(text_to_cstring(schemaName), false),
relocatable,
text_to_cstring(extVersion),
extConfig,
extCondition,
requiredExtensions);
PG_RETURN_VOID();
}
| PG_FUNCTION_INFO_V1 | ( | set_next_pg_type_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_pg_enum_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_pg_authid_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_toast_pg_class_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | create_empty_extension | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_array_pg_type_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_toast_pg_type_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_heap_pg_class_oid | ) |
| PG_FUNCTION_INFO_V1 | ( | set_next_index_pg_class_oid | ) |
| Datum set_next_array_pg_type_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 76 of file pg_upgrade_support.c.
References binary_upgrade_next_array_pg_type_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid typoid = PG_GETARG_OID(0);
binary_upgrade_next_array_pg_type_oid = typoid;
PG_RETURN_VOID();
}
| Datum set_next_heap_pg_class_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 96 of file pg_upgrade_support.c.
References binary_upgrade_next_heap_pg_class_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid reloid = PG_GETARG_OID(0);
binary_upgrade_next_heap_pg_class_oid = reloid;
PG_RETURN_VOID();
}
| Datum set_next_index_pg_class_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 106 of file pg_upgrade_support.c.
References binary_upgrade_next_index_pg_class_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid reloid = PG_GETARG_OID(0);
binary_upgrade_next_index_pg_class_oid = reloid;
PG_RETURN_VOID();
}
| Datum set_next_pg_authid_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 136 of file pg_upgrade_support.c.
References binary_upgrade_next_pg_authid_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid authoid = PG_GETARG_OID(0);
binary_upgrade_next_pg_authid_oid = authoid;
PG_RETURN_VOID();
}
| Datum set_next_pg_enum_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 126 of file pg_upgrade_support.c.
References binary_upgrade_next_pg_enum_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid enumoid = PG_GETARG_OID(0);
binary_upgrade_next_pg_enum_oid = enumoid;
PG_RETURN_VOID();
}
| Datum set_next_pg_type_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 66 of file pg_upgrade_support.c.
References binary_upgrade_next_pg_type_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid typoid = PG_GETARG_OID(0);
binary_upgrade_next_pg_type_oid = typoid;
PG_RETURN_VOID();
}
| Datum set_next_toast_pg_class_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 116 of file pg_upgrade_support.c.
References binary_upgrade_next_toast_pg_class_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid reloid = PG_GETARG_OID(0);
binary_upgrade_next_toast_pg_class_oid = reloid;
PG_RETURN_VOID();
}
| Datum set_next_toast_pg_type_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 86 of file pg_upgrade_support.c.
References binary_upgrade_next_toast_pg_type_oid, PG_GETARG_OID, and PG_RETURN_VOID.
{
Oid typoid = PG_GETARG_OID(0);
binary_upgrade_next_toast_pg_type_oid = typoid;
PG_RETURN_VOID();
}
| PGDLLIMPORT Oid binary_upgrade_next_array_pg_type_oid |
Definition at line 88 of file typecmds.c.
Referenced by AssignTypeArrayOid(), and set_next_array_pg_type_oid().
| PGDLLIMPORT Oid binary_upgrade_next_heap_pg_class_oid |
Definition at line 77 of file heap.c.
Referenced by heap_create_with_catalog(), and set_next_heap_pg_class_oid().
| PGDLLIMPORT Oid binary_upgrade_next_index_pg_class_oid |
Definition at line 72 of file index.c.
Referenced by index_create(), and set_next_index_pg_class_oid().
| PGDLLIMPORT Oid binary_upgrade_next_pg_authid_oid |
Definition at line 41 of file user.c.
Referenced by CreateRole(), and set_next_pg_authid_oid().
| PGDLLIMPORT Oid binary_upgrade_next_pg_enum_oid |
Definition at line 34 of file pg_enum.c.
Referenced by AddEnumLabel(), and set_next_pg_enum_oid().
| PGDLLIMPORT Oid binary_upgrade_next_pg_type_oid |
Definition at line 39 of file pg_type.c.
Referenced by set_next_pg_type_oid(), TypeCreate(), and TypeShellMake().
| PGDLLIMPORT Oid binary_upgrade_next_toast_pg_class_oid |
Definition at line 78 of file heap.c.
Referenced by create_toast_table(), heap_create_with_catalog(), and set_next_toast_pg_class_oid().
| PGDLLIMPORT Oid binary_upgrade_next_toast_pg_type_oid |
Definition at line 36 of file toasting.c.
Referenced by create_toast_table(), and set_next_toast_pg_type_oid().
1.7.1