Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f16647

Browse files
committed
Rename function 'isexists' and 'isdefined' to
'exist' and 'defined' accordingly. Old names are saved not mentioned in docs - for compatibility with old applications. Per discussion http://archives.postgresql.org/pgsql-hackers/2006-10/msg00571.php
1 parent 4e46f47 commit 3f16647

File tree

5 files changed

+43
-31
lines changed

5 files changed

+43
-31
lines changed

contrib/hstore/README.hstore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,20 @@ regression=# select * from each('a=>1,b=>2');
117117
a | 1
118118
b | 2
119119

120-
* isexists (hstore,text) - returns 'true if key is exists in hstore and
120+
* exist (hstore,text) - returns 'true if key is exists in hstore and
121121
false otherwise.
122122

123-
regression=# select isexists('a=>1','a');
124-
isexists
123+
regression=# select exist('a=>1','a');
124+
exist
125125
----------
126126
t
127127

128-
* isdefined (hstore,text) - returns true if key is exists in hstore and
128+
* defined (hstore,text) - returns true if key is exists in hstore and
129129
its value is not NULL.
130130

131-
regression=# select isdefined('a=>NULL','a');
132-
isdefined
133-
-----------
131+
regression=# select defined('a=>NULL','a');
132+
defined
133+
---------
134134
f
135135

136136
Indices

contrib/hstore/expected/hstore.out

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -273,39 +273,39 @@ select ('aa=>NULL, c=>d , b=>16'::hstore->'aa') is null;
273273
(1 row)
274274

275275
-- exists/defined
276-
select isexists('a=>NULL, b=>qq', 'a');
277-
isexists
278-
----------
276+
select exist('a=>NULL, b=>qq', 'a');
277+
exist
278+
-------
279279
t
280280
(1 row)
281281

282-
select isexists('a=>NULL, b=>qq', 'b');
283-
isexists
284-
----------
282+
select exist('a=>NULL, b=>qq', 'b');
283+
exist
284+
-------
285285
t
286286
(1 row)
287287

288-
select isexists('a=>NULL, b=>qq', 'c');
289-
isexists
290-
----------
288+
select exist('a=>NULL, b=>qq', 'c');
289+
exist
290+
-------
291291
f
292292
(1 row)
293293

294-
select isdefined('a=>NULL, b=>qq', 'a');
295-
isdefined
296-
-----------
294+
select defined('a=>NULL, b=>qq', 'a');
295+
defined
296+
---------
297297
f
298298
(1 row)
299299

300-
select isdefined('a=>NULL, b=>qq', 'b');
301-
isdefined
302-
-----------
300+
select defined('a=>NULL, b=>qq', 'b');
301+
defined
302+
---------
303303
t
304304
(1 row)
305305

306-
select isdefined('a=>NULL, b=>qq', 'c');
307-
isdefined
308-
-----------
306+
select defined('a=>NULL, b=>qq', 'c');
307+
defined
308+
---------
309309
f
310310
(1 row)
311311

contrib/hstore/hstore.sql.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,21 @@ RETURNS bool
3535
AS 'MODULE_PATHNAME','exists'
3636
LANGUAGE 'C' with (isstrict,iscachable);
3737

38+
CREATE FUNCTION exist(hstore,text)
39+
RETURNS bool
40+
AS 'MODULE_PATHNAME','exists'
41+
LANGUAGE 'C' with (isstrict,iscachable);
42+
3843
CREATE FUNCTION isdefined(hstore,text)
3944
RETURNS bool
4045
AS 'MODULE_PATHNAME','defined'
4146
LANGUAGE 'C' with (isstrict,iscachable);
4247

48+
CREATE FUNCTION defined(hstore,text)
49+
RETURNS bool
50+
AS 'MODULE_PATHNAME','defined'
51+
LANGUAGE 'C' with (isstrict,iscachable);
52+
4353
CREATE FUNCTION delete(hstore,text)
4454
RETURNS hstore
4555
AS 'MODULE_PATHNAME','delete'

contrib/hstore/sql/hstore.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ select ('aa=>NULL, c=>d , b=>16'::hstore->'aa') is null;
6666

6767
-- exists/defined
6868

69-
select isexists('a=>NULL, b=>qq', 'a');
70-
select isexists('a=>NULL, b=>qq', 'b');
71-
select isexists('a=>NULL, b=>qq', 'c');
72-
select isdefined('a=>NULL, b=>qq', 'a');
73-
select isdefined('a=>NULL, b=>qq', 'b');
74-
select isdefined('a=>NULL, b=>qq', 'c');
69+
select exist('a=>NULL, b=>qq', 'a');
70+
select exist('a=>NULL, b=>qq', 'b');
71+
select exist('a=>NULL, b=>qq', 'c');
72+
select defined('a=>NULL, b=>qq', 'a');
73+
select defined('a=>NULL, b=>qq', 'b');
74+
select defined('a=>NULL, b=>qq', 'c');
7575

7676
-- delete
7777

contrib/hstore/uninstall_hstore.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ DROP OPERATOR =>( text, text );
1313

1414
DROP FUNCTION fetchval(hstore,text);
1515
DROP FUNCTION isexists(hstore,text);
16+
DROP FUNCTION exist(hstore,text);
1617
DROP FUNCTION isdefined(hstore,text);
18+
DROP FUNCTION defined(hstore,text);
1719
DROP FUNCTION delete(hstore,text);
1820
DROP FUNCTION hs_concat(hstore,hstore);
1921
DROP FUNCTION hs_contains(hstore,hstore);

0 commit comments

Comments
 (0)