Skip to content

Commit 48fb696

Browse files
author
Neil Conway
committed
Fix a number of syntax errors in contrib modules' uninstall scripts.
Most of the changes add the mandatory USING clause to DROP OPERATOR CLASS statements. DROP TYPE is now DROP TYPE CASCADE; without CASCADE a DROP TYPE fails due to the circular dependency on the type's I/O functions. The DROP FUNCTION statements for the I/O functions have been removed, as DROP TYPE CASCADE removes them automatically. Patch from Michael Fuhr.
1 parent 4a85bf3 commit 48fb696

File tree

9 files changed

+56
-137
lines changed

9 files changed

+56
-137
lines changed

contrib/btree_gist/uninstall_btree_gist.sql

Lines changed: 27 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SET search_path = public;
22

3-
DROP OPERATOR CLASS gist_cidr_ops;
3+
DROP OPERATOR CLASS gist_cidr_ops USING gist;
44

5-
DROP OPERATOR CLASS gist_inet_ops;
5+
DROP OPERATOR CLASS gist_inet_ops USING gist;
66

77
DROP FUNCTION gbt_inet_same(internal, internal, internal);
88

@@ -12,17 +12,13 @@ DROP FUNCTION gbt_inet_picksplit(internal, internal);
1212

1313
DROP FUNCTION gbt_inet_penalty(internal,internal,internal);
1414

15-
DROP FUNCTION gbt_cidr_compress(internal);
16-
1715
DROP FUNCTION gbt_inet_compress(internal);
1816

19-
DROP FUNCTION gbt_cidr_consistent(internal,cidr,int2);
20-
2117
DROP FUNCTION gbt_inet_consistent(internal,inet,int2);
2218

23-
DROP OPERATOR CLASS gist_vbit_ops;
19+
DROP OPERATOR CLASS gist_vbit_ops USING gist;
2420

25-
DROP OPERATOR CLASS gist_bit_ops;
21+
DROP OPERATOR CLASS gist_bit_ops USING gist;
2622

2723
DROP FUNCTION gbt_bit_same(internal, internal, internal);
2824

@@ -36,7 +32,7 @@ DROP FUNCTION gbt_bit_compress(internal);
3632

3733
DROP FUNCTION gbt_bit_consistent(internal,bit,int2);
3834

39-
DROP OPERATOR CLASS gist_numeric_ops;
35+
DROP OPERATOR CLASS gist_numeric_ops USING gist;
4036

4137
DROP FUNCTION gbt_numeric_same(internal, internal, internal);
4238

@@ -50,7 +46,7 @@ DROP FUNCTION gbt_numeric_compress(internal);
5046

5147
DROP FUNCTION gbt_numeric_consistent(internal,numeric,int2);
5248

53-
DROP OPERATOR CLASS gist_bytea_ops;
49+
DROP OPERATOR CLASS gist_bytea_ops USING gist;
5450

5551
DROP FUNCTION gbt_bytea_same(internal, internal, internal);
5652

@@ -64,9 +60,9 @@ DROP FUNCTION gbt_bytea_compress(internal);
6460

6561
DROP FUNCTION gbt_bytea_consistent(internal,bytea,int2);
6662

67-
DROP OPERATOR CLASS gist_bpchar_ops;
63+
DROP OPERATOR CLASS gist_bpchar_ops USING gist;
6864

69-
DROP OPERATOR CLASS gist_text_ops;
65+
DROP OPERATOR CLASS gist_text_ops USING gist;
7066

7167
DROP FUNCTION gbt_text_same(internal, internal, internal);
7268

@@ -84,7 +80,7 @@ DROP FUNCTION gbt_bpchar_consistent(internal,bpchar,int2);
8480

8581
DROP FUNCTION gbt_text_consistent(internal,text,int2);
8682

87-
DROP OPERATOR CLASS gist_macaddr_ops;
83+
DROP OPERATOR CLASS gist_macaddr_ops USING gist;
8884

8985
DROP FUNCTION gbt_macad_same(internal, internal, internal);
9086

@@ -98,7 +94,7 @@ DROP FUNCTION gbt_macad_compress(internal);
9894

9995
DROP FUNCTION gbt_macad_consistent(internal,macaddr,int2);
10096

101-
DROP OPERATOR CLASS gist_cash_ops;
97+
DROP OPERATOR CLASS gist_cash_ops USING gist;
10298

10399
DROP FUNCTION gbt_cash_same(internal, internal, internal);
104100

@@ -112,7 +108,7 @@ DROP FUNCTION gbt_cash_compress(internal);
112108

113109
DROP FUNCTION gbt_cash_consistent(internal,money,int2);
114110

115-
DROP OPERATOR CLASS gist_interval_ops;
111+
DROP OPERATOR CLASS gist_interval_ops USING gist;
116112

117113
DROP FUNCTION gbt_intv_same(internal, internal, internal);
118114

@@ -128,7 +124,7 @@ DROP FUNCTION gbt_intv_compress(internal);
128124

129125
DROP FUNCTION gbt_intv_consistent(internal,interval,int2);
130126

131-
DROP OPERATOR CLASS gist_date_ops;
127+
DROP OPERATOR CLASS gist_date_ops USING gist;
132128

133129
DROP FUNCTION gbt_date_same(internal, internal, internal);
134130

@@ -142,9 +138,9 @@ DROP FUNCTION gbt_date_compress(internal);
142138

143139
DROP FUNCTION gbt_date_consistent(internal,date,int2);
144140

145-
DROP OPERATOR CLASS gist_timetz_ops;
141+
DROP OPERATOR CLASS gist_timetz_ops USING gist;
146142

147-
DROP OPERATOR CLASS gist_time_ops;
143+
DROP OPERATOR CLASS gist_time_ops USING gist;
148144

149145
DROP FUNCTION gbt_time_same(internal, internal, internal);
150146

@@ -162,9 +158,9 @@ DROP FUNCTION gbt_timetz_consistent(internal,timetz,int2);
162158

163159
DROP FUNCTION gbt_time_consistent(internal,time,int2);
164160

165-
DROP OPERATOR CLASS gist_timestamptz_ops;
161+
DROP OPERATOR CLASS gist_timestamptz_ops USING gist;
166162

167-
DROP OPERATOR CLASS gist_timestamp_ops;
163+
DROP OPERATOR CLASS gist_timestamp_ops USING gist;
168164

169165
DROP FUNCTION gbt_ts_same(internal, internal, internal);
170166

@@ -182,7 +178,7 @@ DROP FUNCTION gbt_tstz_consistent(internal,timestamptz,int2);
182178

183179
DROP FUNCTION gbt_ts_consistent(internal,timestamp,int2);
184180

185-
DROP OPERATOR CLASS gist_float8_ops;
181+
DROP OPERATOR CLASS gist_float8_ops USING gist;
186182

187183
DROP FUNCTION gbt_float8_same(internal, internal, internal);
188184

@@ -196,7 +192,7 @@ DROP FUNCTION gbt_float8_compress(internal);
196192

197193
DROP FUNCTION gbt_float8_consistent(internal,float8,int2);
198194

199-
DROP OPERATOR CLASS gist_float4_ops;
195+
DROP OPERATOR CLASS gist_float4_ops USING gist;
200196

201197
DROP FUNCTION gbt_float4_same(internal, internal, internal);
202198

@@ -210,7 +206,7 @@ DROP FUNCTION gbt_float4_compress(internal);
210206

211207
DROP FUNCTION gbt_float4_consistent(internal,float4,int2);
212208

213-
DROP OPERATOR CLASS gist_int8_ops;
209+
DROP OPERATOR CLASS gist_int8_ops USING gist;
214210

215211
DROP FUNCTION gbt_int8_same(internal, internal, internal);
216212

@@ -224,7 +220,7 @@ DROP FUNCTION gbt_int8_compress(internal);
224220

225221
DROP FUNCTION gbt_int8_consistent(internal,int8,int2);
226222

227-
DROP OPERATOR CLASS gist_int4_ops;
223+
DROP OPERATOR CLASS gist_int4_ops USING gist;
228224

229225
DROP FUNCTION gbt_int4_same(internal, internal, internal);
230226

@@ -238,7 +234,7 @@ DROP FUNCTION gbt_int4_compress(internal);
238234

239235
DROP FUNCTION gbt_int4_consistent(internal,int4,int2);
240236

241-
DROP OPERATOR CLASS gist_int2_ops;
237+
DROP OPERATOR CLASS gist_int2_ops USING gist;
242238

243239
DROP FUNCTION gbt_int2_same(internal, internal, internal);
244240

@@ -252,7 +248,7 @@ DROP FUNCTION gbt_int2_compress(internal);
252248

253249
DROP FUNCTION gbt_int2_consistent(internal,int2,int2);
254250

255-
DROP OPERATOR CLASS gist_oid_ops;
251+
DROP OPERATOR CLASS gist_oid_ops USING gist;
256252

257253
DROP FUNCTION gbt_oid_same(internal, internal, internal);
258254

@@ -270,32 +266,12 @@ DROP FUNCTION gbt_oid_compress(internal);
270266

271267
DROP FUNCTION gbt_oid_consistent(internal,oid,int2);
272268

273-
DROP TYPE gbtreekey_var;
274-
275-
DROP FUNCTION gbtreekey_var_out(gbtreekey_var);
276-
277-
DROP FUNCTION gbtreekey_var_in(cstring);
278-
279-
DROP TYPE gbtreekey32;
280-
281-
DROP FUNCTION gbtreekey32_out(gbtreekey32);
282-
283-
DROP FUNCTION gbtreekey32_in(cstring);
284-
285-
DROP TYPE gbtreekey16;
286-
287-
DROP FUNCTION gbtreekey16_out(gbtreekey16);
288-
289-
DROP FUNCTION gbtreekey16_in(cstring);
290-
291-
DROP TYPE gbtreekey8;
292-
293-
DROP FUNCTION gbtreekey8_out(gbtreekey8);
269+
DROP TYPE gbtreekey_var CASCADE;
294270

295-
DROP FUNCTION gbtreekey8_in(cstring);
271+
DROP TYPE gbtreekey32 CASCADE;
296272

297-
DROP TYPE gbtreekey4;
273+
DROP TYPE gbtreekey16 CASCADE;
298274

299-
DROP FUNCTION gbtreekey4_out(gbtreekey4);
275+
DROP TYPE gbtreekey8 CASCADE;
300276

301-
DROP FUNCTION gbtreekey4_in(cstring);
277+
DROP TYPE gbtreekey4 CASCADE;

contrib/chkpass/uninstall_chkpass.sql

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
SET search_path = public;
22

3-
DROP OPERATOR <>; (
4-
leftarg = chkpass,
5-
rightarg = text,
6-
negator = =,
7-
procedure = ne
8-
);
3+
DROP OPERATOR <>(chkpass, text);
94

10-
DROP OPERATOR =; (
11-
leftarg = chkpass,
12-
rightarg = text,
13-
commutator = =,
14-
-- negator = <>,
15-
procedure = eq
16-
);
5+
DROP OPERATOR =(chkpass, text);
6+
7+
DROP OPERATOR =(text, chkpass);
178

189
DROP FUNCTION ne(chkpass, text);
1910

2011
DROP FUNCTION eq(chkpass, text);
2112

2213
DROP FUNCTION raw(chkpass);
2314

24-
DROP TYPE chkpass;
25-
26-
DROP FUNCTION chkpass_out(chkpass);
27-
28-
DROP FUNCTION chkpass_in(cstring);
15+
DROP TYPE chkpass CASCADE;

contrib/cube/uninstall_cube.sql

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SET search_path = public;
22

3-
DROP OPERATOR CLASS gist_cube_ops;
3+
DROP OPERATOR CLASS gist_cube_ops USING gist;
44

5-
DROP OPERATOR CLASS cube_ops;
5+
DROP OPERATOR CLASS cube_ops USING btree;
66

77
DROP FUNCTION g_cube_same(cube, cube, internal);
88

@@ -86,8 +86,4 @@ DROP CAST (text AS cube);
8686

8787
DROP FUNCTION cube(text);
8888

89-
DROP FUNCTION cube_out(cube);
90-
91-
DROP TYPE cube;
92-
93-
DROP FUNCTION cube_in(cstring);
89+
DROP TYPE cube CASCADE;

contrib/dblink/uninstall_dblink.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DROP FUNCTION dblink_build_sql_insert (text, int2vector, int4, _text, _text);
88

99
DROP FUNCTION dblink_get_pkey (text);
1010

11-
CREATE TYPE dblink_pkey_results AS (position int4, colname text);
11+
DROP TYPE dblink_pkey_results;
1212

1313
DROP FUNCTION dblink_exec (text,bool);
1414

contrib/intarray/uninstall__int.sql

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SET search_path = public;
22

3-
DROP OPERATOR CLASS gist__intbig_ops;
3+
DROP OPERATOR CLASS gist__intbig_ops USING gist;
44

55
DROP FUNCTION g_intbig_same(internal, internal, internal);
66

@@ -16,13 +16,9 @@ DROP FUNCTION g_intbig_compress(internal);
1616

1717
DROP FUNCTION g_intbig_consistent(internal,internal,int4);
1818

19-
DROP TYPE intbig_gkey;
19+
DROP TYPE intbig_gkey CASCADE;
2020

21-
DROP FUNCTION _intbig_out(intbig_gkey);
22-
23-
DROP FUNCTION _intbig_in(cstring);
24-
25-
DROP OPERATOR CLASS gist__int_ops;
21+
DROP OPERATOR CLASS gist__int_ops USING gist;
2622

2723
DROP FUNCTION g_int_same(_int4, _int4, internal);
2824

@@ -116,8 +112,4 @@ DROP FUNCTION boolop(_int4, query_int);
116112

117113
DROP FUNCTION querytree(query_int);
118114

119-
DROP TYPE query_int;
120-
121-
DROP FUNCTION bqarr_out(query_int);
122-
123-
DROP FUNCTION bqarr_in(cstring);
115+
DROP TYPE query_int CASCADE;

contrib/isbn_issn/uninstall_isbn_issn.sql

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SET search_path = public;
22

3-
DROP OPERATOR CLASS isbn_ops;
3+
DROP OPERATOR CLASS isbn_ops USING btree;
44

55
DROP FUNCTION isbn_cmp(isbn, isbn);
66

@@ -28,13 +28,9 @@ DROP FUNCTION isbn_le(isbn, isbn);
2828

2929
DROP FUNCTION isbn_lt(isbn, isbn);
3030

31-
DROP TYPE isbn;
31+
DROP TYPE isbn CASCADE;
3232

33-
DROP FUNCTION isbn_out(isbn);
34-
35-
DROP FUNCTION isbn_in(cstring);
36-
37-
DROP OPERATOR CLASS issn_ops;
33+
DROP OPERATOR CLASS issn_ops USING btree;
3834

3935
DROP FUNCTION issn_cmp(issn, issn);
4036

@@ -62,8 +58,4 @@ DROP FUNCTION issn_le(issn, issn);
6258

6359
DROP FUNCTION issn_lt(issn, issn);
6460

65-
DROP TYPE issn;
66-
67-
DROP FUNCTION issn_out(issn);
68-
69-
DROP FUNCTION issn_in(cstring);
61+
DROP TYPE issn CASCADE;

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