Skip to content

Commit d00a9ae

Browse files
committed
fixed build_check_constraint_name_internal() (don't use Oids)
1 parent 0a99fcb commit d00a9ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ find_inheritance_children_array(Oid parentrelId, LOCKMODE lockmode, uint32 *size
552552
char *
553553
build_check_constraint_name_internal(Oid relid, AttrNumber attno)
554554
{
555-
return psprintf("pathman_%u_%u_check", relid, attno);
555+
return psprintf("pathman_%s_%u_check", get_rel_name(relid), attno);
556556
}
557557

558558
/*

Diff for: src/pl_funcs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ build_check_constraint_name_attnum(PG_FUNCTION_ARGS)
519519

520520
result = build_check_constraint_name_internal(relid, attnum);
521521

522-
PG_RETURN_TEXT_P(cstring_to_text(result));
522+
PG_RETURN_TEXT_P(cstring_to_text(quote_identifier(result)));
523523
}
524524

525525
Datum
@@ -539,7 +539,7 @@ build_check_constraint_name_attname(PG_FUNCTION_ARGS)
539539

540540
result = build_check_constraint_name_internal(relid, attnum);
541541

542-
PG_RETURN_TEXT_P(cstring_to_text(result));
542+
PG_RETURN_TEXT_P(cstring_to_text(quote_identifier(result)));
543543
}
544544

545545
Datum

0 commit comments

Comments
 (0)