Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0f9358

Browse files
committed
Fix incorrect pg_proc.proallargtypes entries for two built-in functions.
pg_sequence_parameters() and pg_identify_object() have had incorrectproallargtypes entries since 9.1 and 9.3 respectively. This was mostlymasked by the correct information in proargtypes, but a few operationssuch as pg_get_function_arguments() (and thus psql's \df display) wouldshow the wrong data types for these functions' input parameters.In HEAD, fix the wrong info, bump catversion, and add an opr_sanityregression test to catch future mistakes of this sort.In the back branches, just fix the wrong info so that installationsinitdb'd with future minor releases will have the right data. Wecan't force an initdb, and it doesn't seem like a good idea to adda regression test that will fail on existing installations.Andres Freund
1 parentf0fedfe commita0f9358

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201404231
56+
#defineCATALOG_VERSION_NO201404241
5757

5858
#endif

‎src/include/catalog/pg_proc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ DATA(insert OID = 1576 ( setvalPGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "
17751775
DESCR("set sequence value");
17761776
DATA(insertOID=1765 (setvalPGNSPPGUID121000fffftfv3020"2205 20 16"_null__null__null__null_setval3_oid_null__null__null_ ));
17771777
DESCR("set sequence value and is_called status");
1778-
DATA(insertOID=3078 (pg_sequence_parametersPGNSPPGUID121000fffftfs102249"26""{23,20,20,20,20,16}""{i,o,o,o,o,o}""{sequence_oid,start_value,minimum_value,maximum_value,increment,cycle_option}"_null_pg_sequence_parameters_null__null__null_));
1778+
DATA(insertOID=3078 (pg_sequence_parametersPGNSPPGUID121000fffftfs102249"26""{26,20,20,20,20,16}""{i,o,o,o,o,o}""{sequence_oid,start_value,minimum_value,maximum_value,increment,cycle_option}"_null_pg_sequence_parameters_null__null__null_));
17791779
DESCR("sequence parameters, for use by information schema");
17801780

17811781
DATA(insertOID=1579 (varbit_inPGNSPPGUID121000fffftfi301562"2275 26 23"_null__null__null__null_varbit_in_null__null__null_ ));
@@ -2981,7 +2981,7 @@ DESCR("view members of a multixactid");
29812981
DATA(insertOID=3537 (pg_describe_objectPGNSPPGUID121000fffftfs3025"26 26 23"_null__null__null__null_pg_describe_object_null__null__null_ ));
29822982
DESCR("get identification of SQL object");
29832983

2984-
DATA(insertOID=3839 (pg_identify_objectPGNSPPGUID121000fffftfs302249"26 26 23""{26,23,23,25,25,25,25}""{i,i,i,o,o,o,o}""{classid,objid,subobjid,type,schema,name,identity}"_null_pg_identify_object_null__null__null_ ));
2984+
DATA(insertOID=3839 (pg_identify_objectPGNSPPGUID121000fffftfs302249"26 26 23""{26,26,23,25,25,25,25}""{i,i,i,o,o,o,o}""{classid,objid,subobjid,type,schema,name,identity}"_null_pg_identify_object_null__null__null_ ));
29852985
DESCR("get machine-parseable identification of SQL object");
29862986

29872987
DATA(insertOID=2079 (pg_table_is_visiblePGNSPPGUID1210000fffftfs1016"26"_null__null__null__null_pg_table_is_visible_null__null__null_ ));

‎src/test/regress/expected/opr_sanity.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,18 @@ WHERE proargmodes IS NOT NULL AND proargnames IS NOT NULL AND
364364
-----+---------
365365
(0 rows)
366366

367+
-- Check that proallargtypes matches proargtypes
368+
SELECT p1.oid, p1.proname, p1.proargtypes, p1.proallargtypes, p1.proargmodes
369+
FROM pg_proc as p1
370+
WHERE proallargtypes IS NOT NULL AND
371+
ARRAY(SELECT unnest(proargtypes)) <>
372+
ARRAY(SELECT proallargtypes[i]
373+
FROM generate_series(1, array_length(proallargtypes, 1)) g(i)
374+
WHERE proargmodes IS NULL OR proargmodes[i] IN ('i', 'b', 'v'));
375+
oid | proname | proargtypes | proallargtypes | proargmodes
376+
-----+---------+-------------+----------------+-------------
377+
(0 rows)
378+
367379
-- Check for protransform functions with the wrong signature
368380
SELECT p1.oid, p1.proname, p2.oid, p2.proname
369381
FROM pg_proc AS p1, pg_proc AS p2

‎src/test/regress/sql/opr_sanity.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,15 @@ FROM pg_proc as p1
276276
WHERE proargmodesIS NOT NULLAND proargnamesIS NOT NULLAND
277277
array_length(proargmodes,1)<> array_length(proargnames,1);
278278

279+
-- Check that proallargtypes matches proargtypes
280+
SELECTp1.oid,p1.proname,p1.proargtypes,p1.proallargtypes,p1.proargmodes
281+
FROM pg_procas p1
282+
WHERE proallargtypesIS NOT NULLAND
283+
ARRAY(SELECT unnest(proargtypes))<>
284+
ARRAY(SELECT proallargtypes[i]
285+
FROM generate_series(1, array_length(proallargtypes,1)) g(i)
286+
WHERE proargmodes ISNULLOR proargmodes[i]IN ('i','b','v'));
287+
279288
-- Check for protransform functions with the wrong signature
280289
SELECTp1.oid,p1.proname,p2.oid,p2.proname
281290
FROM pg_procAS p1, pg_procAS p2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp