8000 Forbid 0 oid as partition_relid in build_range_condition. · postgrespro/pg_pathman@e251d2a · GitHub
[go: up one dir, main page]

Skip to content

Commit e251d2a

Browse files
committed
Forbid 0 oid as partition_relid in build_range_condition.
1 parent 7aa7d1c commit e251d2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pl_range_funcs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "utils.h"
1616
#include "xact_handling.h"
1717

18+
#include "access/transam.h"
1819
#include "access/xact.h"
1920
#include "catalog/heap.h"
2021
#include "catalog/namespace.h"
@@ -1072,6 +1073,9 @@ build_range_condition(PG_FUNCTION_ARGS)
10721073
}
10731074
else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10741075
errmsg("'partition_relid' should not be NULL")));
1076+
if (partition_relid < FirstNormalObjectId)
1077+
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1078+
errmsg("'partition_relid' must be normal object oid")));
10751079

10761080
if (!PG_ARGISNULL(1))
10771081
{

0 commit comments

Comments
 (0)
0