You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Make the to_reg*() functions accept text not cstring.
Using cstring as the input type was a poor decision, because that's notreally a full-fledged type. In particular, it lacks implicit coercionsfrom text or varchar, meaning that usages like to_regproc('foo'||'bar')wouldn't work; basically the only case that did work without explicitcasting was a simple literal constant argument.The lack of field complaints about this suggests that hardly anyoneis using these functions, so hopefully fixing it won't cause much ofa compatibility problem. They've only been there since 9.4, anyway.Petr Korobeinikov
Copy file name to clipboardExpand all lines: src/include/catalog/pg_proc.h
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -177,9 +177,9 @@ DATA(insert OID = 44 ( regprocin PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1
177
177
DESCR("I/O");
178
178
DATA(insert OID = 45 ( regprocout PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "24" _null_ _null_ _null_ _null_ _null_ regprocout _null_ _null_ _null_ ));
179
179
DESCR("I/O");
180
-
DATA(insert OID = 3494 ( to_regprocPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 24 "2275" _null_ _null_ _null_ _null_ _null_ to_regproc _null_ _null_ _null_ ));
180
+
DATA(insert OID = 3494 ( to_regprocPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 24 "25" _null_ _null_ _null_ _null_ _null_ to_regproc _null_ _null_ _null_ ));
181
181
DESCR("convert proname to regproc");
182
-
DATA(insert OID = 3479 ( to_regprocedurePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2202 "2275" _null_ _null_ _null_ _null_ _null_ to_regprocedure _null_ _null_ _null_ ));
182
+
DATA(insert OID = 3479 ( to_regprocedurePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2202 "25" _null_ _null_ _null_ _null_ _null_ to_regprocedure _null_ _null_ _null_ ));
183
183
DESCR("convert proname to regprocedure");
184
184
DATA(insert OID = 46 ( textin PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "2275" _null_ _null_ _null_ _null_ _null_ textin _null_ _null_ _null_ ));
185
185
DESCR("I/O");
@@ -3483,9 +3483,9 @@ DATA(insert OID = 2214 ( regoperinPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0
3483
3483
DESCR("I/O");
3484
3484
DATA(insert OID = 2215 ( regoperoutPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "2203" _null_ _null_ _null_ _null_ _null_ regoperout _null_ _null_ _null_ ));
3485
3485
DESCR("I/O");
3486
-
DATA(insert OID = 3492 ( to_regoperPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2203 "2275" _null_ _null_ _null_ _null_ _null_ to_regoper _null_ _null_ _null_ ));
3486
+
DATA(insert OID = 3492 ( to_regoperPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2203 "25" _null_ _null_ _null_ _null_ _null_ to_regoper _null_ _null_ _null_ ));
3487
3487
DESCR("convert operator name to regoper");
3488
-
DATA(insert OID = 3476 ( to_regoperatorPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2204 "2275" _null_ _null_ _null_ _null_ _null_ to_regoperator _null_ _null_ _null_ ));
3488
+
DATA(insert OID = 3476 ( to_regoperatorPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2204 "25" _null_ _null_ _null_ _null_ _null_ to_regoperator _null_ _null_ _null_ ));
3489
3489
DESCR("convert operator name to regoperator");
3490
3490
DATA(insert OID = 2216 ( regoperatorinPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2204 "2275" _null_ _null_ _null_ _null_ _null_ regoperatorin _null_ _null_ _null_ ));
3491
3491
DESCR("I/O");
@@ -3495,13 +3495,13 @@ DATA(insert OID = 2218 ( regclassinPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0
3495
3495
DESCR("I/O");
3496
3496
DATA(insert OID = 2219 ( regclassoutPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "2205" _null_ _null_ _null_ _null_ _null_ regclassout _null_ _null_ _null_ ));
3497
3497
DESCR("I/O");
3498
-
DATA(insert OID = 3495 ( to_regclassPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2205 "2275" _null_ _null_ _null_ _null_ _null_ to_regclass _null_ _null_ _null_ ));
3498
+
DATA(insert OID = 3495 ( to_regclassPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2205 "25" _null_ _null_ _null_ _null_ _null_ to_regclass _null_ _null_ _null_ ));
3499
3499
DESCR("convert classname to regclass");
3500
3500
DATA(insert OID = 2220 ( regtypeinPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2206 "2275" _null_ _null_ _null_ _null_ _null_ regtypein _null_ _null_ _null_ ));
3501
3501
DESCR("I/O");
3502
3502
DATA(insert OID = 2221 ( regtypeoutPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "2206" _null_ _null_ _null_ _null_ _null_ regtypeout _null_ _null_ _null_ ));
3503
3503
DESCR("I/O");
3504
-
DATA(insert OID = 3493 ( to_regtypePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2206 "2275" _null_ _null_ _null_ _null_ _null_ to_regtype _null_ _null_ _null_ ));
3504
+
DATA(insert OID = 3493 ( to_regtypePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2206 "25" _null_ _null_ _null_ _null_ _null_ to_regtype _null_ _null_ _null_ ));
3505
3505
DESCR("convert type name to regtype");
3506
3506
DATA(insert OID = 1079 ( regclassPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2205 "25" _null_ _null_ _null_ _null_ _null_text_regclass _null_ _null_ _null_ ));
3507
3507
DESCR("convert text to regclass");
@@ -3510,14 +3510,14 @@ DATA(insert OID = 4098 ( regroleinPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0
3510
3510
DESCR("I/O");
3511
3511
DATA(insert OID = 4092 ( regroleoutPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "4096" _null_ _null_ _null_ _null_ _null_ regroleout _null_ _null_ _null_ ));
3512
3512
DESCR("I/O");
3513
-
DATA(insert OID = 4093 ( to_regrolePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 4096 "2275" _null_ _null_ _null_ _null_ _null_ to_regrole _null_ _null_ _null_ ));
3513
+
DATA(insert OID = 4093 ( to_regrolePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 4096 "25" _null_ _null_ _null_ _null_ _null_ to_regrole _null_ _null_ _null_ ));
3514
3514
DESCR("convert role name to regrole");
3515
3515
3516
3516
DATA(insert OID = 4084 ( regnamespaceinPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 4089 "2275" _null_ _null_ _null_ _null_ _null_ regnamespacein _null_ _null_ _null_ ));
3517
3517
DESCR("I/O");
3518
3518
DATA(insert OID = 4085 ( regnamespaceoutPGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "4089" _null_ _null_ _null_ _null_ _null_ regnamespaceout _null_ _null_ _null_ ));
3519
3519
DESCR("I/O");
3520
-
DATA(insert OID = 4086 ( to_regnamespacePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 4089 "2275" _null_ _null_ _null_ _null_ _null_ to_regnamespace _null_ _null_ _null_ ));
3520
+
DATA(insert OID = 4086 ( to_regnamespacePGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 4089 "25" _null_ _null_ _null_ _null_ _null_ to_regnamespace _null_ _null_ _null_ ));
3521
3521
DESCR("convert namespace name to regnamespace");
3522
3522
3523
3523
DATA(insert OID = 2246 ( fmgr_internal_validator PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2278 "26" _null_ _null_ _null_ _null_ _null_ fmgr_internal_validator _null_ _null_ _null_ ));