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

src/init.c

Lines changed: 1 addition & 1 deletion
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
/*

src/pl_funcs.c

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy