File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,24 @@ WHERE p1.typinput = p2.oid AND NOT
129
129
-----+---------+-----+---------
130
130
(0 rows)
131
131
132
+ -- Check for type of the variadic array parameter's elements.
133
+ -- provariadic should be ANYOID if the type of the last element is ANYOID,
134
+ -- ANYELEMENTOID if the type of the last element is ANYARRAYOID, and otherwise
135
+ -- the element type corresponding to the array type.
136
+ SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
137
+ FROM pg_proc
138
+ WHERE provariadic != 0
139
+ AND case proargtypes[array_length(proargtypes, 1)-1]
140
+ WHEN 2276 THEN 2276 -- any -> any
141
+ WHEN 2277 THEN 2283 -- anyarray -> anyelement
142
+ ELSE (SELECT t.oid
143
+ FROM pg_type t
144
+ WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
145
+ END != provariadic;
146
+ oid | provariadic | proargtypes
147
+ -----+-------------+-------------
148
+ (0 rows)
149
+
132
150
-- As of 8.0, this check finds refcursor, which is borrowing
133
151
-- other types' I/O routines
134
152
SELECT p1.oid, p1.typname, p2.oid, p2.proname
Original file line number Diff line number Diff line change @@ -104,6 +104,22 @@ WHERE p1.typinput = p2.oid AND NOT
104
104
p2 .proargtypes [1 ] = ' oid' ::regtype AND
105
105
p2 .proargtypes [2 ] = ' int4' ::regtype));
106
106
107
+ -- Check for type of the variadic array parameter's elements.
108
+ -- provariadic should be ANYOID if the type of the last element is ANYOID,
109
+ -- ANYELEMENTOID if the type of the last element is ANYARRAYOID, and otherwise
110
+ -- the element type corresponding to the array type.
111
+
112
+ SELECT oid ::regprocedure, provariadic::regtype, proargtypes::regtype[]
113
+ FROM pg_proc
114
+ WHERE provariadic != 0
115
+ AND case proargtypes[array_length(proargtypes, 1 )- 1 ]
116
+ WHEN 2276 THEN 2276 -- any -> any
117
+ WHEN 2277 THEN 2283 -- anyarray -> anyelement
118
+ ELSE (SELECT t .oid
119
+ FROM pg_type t
120
+ WHERE t .typarray = proargtypes[array_length(proargtypes, 1 )- 1 ])
121
+ END != provariadic;
122
+
107
123
-- As of 8.0, this check finds refcursor, which is borrowing
108
124
-- other types' I/O routines
109
125
SELECT p1 .oid , p1 .typname , p2 .oid , p2 .proname
You can’t perform that action at this time.
0 commit comments