File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 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
129129-----+---------+-----+---------
130130(0 rows)
131131
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+
132150-- As of 8.0, this check finds refcursor, which is borrowing
133151-- other types' I/O routines
134152SELECT 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
104104 p2 .proargtypes [1 ] = ' oid' ::regtype AND
105105 p2 .proargtypes [2 ] = ' int4' ::regtype));
106106
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+
107123-- As of 8.0, this check finds refcursor, which is borrowing
108124-- other types' I/O routines
109125SELECT p1 .oid , p1 .typname , p2 .oid , p2 .proname
You can’t perform that action at this time.
0 commit comments