30 .
name =
"test resource",
62 elog(
ERROR,
"nkinds must be greater than zero");
64 elog(
ERROR,
"nresources must be greater than zero");
70 for (
int i = 0;
i < nkinds;
i++)
72 before_desc[
i].
name =
psprintf(
"test resource before locks %d",
i);
79 for (
int i = 0;
i < nkinds;
i++)
89 for (
int i = 0;
i < nresources;
i++)
98 for (
int i = 0;
i < nresources;
i++)
109 for (
int i = 0;
i < nresources;
i++)
118 for (
int i = 0;
i < nresources;
i++)
128 elog(
NOTICE,
"releasing resources before locks");
132 elog(
NOTICE,
"releasing resources after locks");
181 elog(
ERROR,
"ResourceOwnerEnlarge should have errored out");
208 elog(
ERROR,
"ResourceOwnerForget should have errored out");
static void PGresult * res
#define PG_GETARG_INT32(n)
static Pointer DatumGetPointer(Datum X)
static Datum CStringGetDatum(const char *X)
char * psprintf(const char *fmt,...)
ResourceOwner ResourceOwnerCreate(ResourceOwner parent, const char *name)
ResourceOwner CurrentResourceOwner
void ResourceOwnerRelease(ResourceOwner owner, ResourceReleasePhase phase, bool isCommit, bool isTopLevel)
void ResourceOwnerForget(ResourceOwner owner, Datum value, const ResourceOwnerDesc *kind)
void ResourceOwnerDelete(ResourceOwner owner)
void ResourceOwnerRemember(ResourceOwner owner, Datum value, const ResourceOwnerDesc *kind)
void ResourceOwnerEnlarge(ResourceOwner owner)
@ RESOURCE_RELEASE_BEFORE_LOCKS
@ RESOURCE_RELEASE_AFTER_LOCKS
#define RELEASE_PRIO_FIRST
char *(* DebugPrint)(Datum res)
ResourceReleasePhase release_phase
void(* ReleaseResource)(Datum res)
ResourceReleasePriority release_priority
static void ReleaseString(Datum res)
Datum test_resowner_forget_between_phases(PG_FUNCTION_ARGS)
static const ResourceOwnerDesc string_desc
Datum test_resowner_remember_between_phases(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(test_resowner_priorities)
Datum test_resowner_leak(PG_FUNCTION_ARGS)
static char * PrintString(Datum res)
Datum test_resowner_priorities(PG_FUNCTION_ARGS)