Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ce517476
Commit
ce517476
authored
Jul 02, 2010
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove hstore % text[] operator; use slice() function instead.
David Wheeler, with one small correction by me.
parent
bb0fe9fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
39 deletions
+33
-39
contrib/hstore/expected/hstore.out
contrib/hstore/expected/hstore.out
+13
-13
contrib/hstore/hstore.sql.in
contrib/hstore/hstore.sql.in
+2
-8
contrib/hstore/sql/hstore.sql
contrib/hstore/sql/hstore.sql
+7
-7
contrib/hstore/uninstall_hstore.sql
contrib/hstore/uninstall_hstore.sql
+2
-3
doc/src/sgml/hstore.sgml
doc/src/sgml/hstore.sgml
+9
-8
No files found.
contrib/hstore/expected/hstore.out
View file @
ce517476
...
...
@@ -4,7 +4,7 @@
--
SET client_min_messages = warning;
\set ECHO none
psql:hstore.sql:2
34
: WARNING: => is deprecated as an operator name
psql:hstore.sql:2
28
: WARNING: => is deprecated as an operator name
DETAIL: This name may be disallowed altogether in future versions of PostgreSQL.
RESET client_min_messages;
set escape_string_warning=off;
...
...
@@ -759,39 +759,39 @@ select pg_column_size('a=>g, b=>c'::hstore || ('b'=>'gf'))
t
(1 row)
--
%
select
hstore 'aa=>1, b=>2, c=>3' % ARRAY['g','h','i']
;
?column?
-------
---
--
slice()
select
slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['g','h','i'])
;
slice
-------
(1 row)
select
hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b']
;
?column?
select
slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b'])
;
slice
--------------------
"b"=>"2", "c"=>"3"
(1 row)
select
hstore 'aa=>1, b=>2, c=>3' % ARRAY['aa','b']
;
?column?
select
slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['aa','b'])
;
slice
---------------------
"b"=>"2", "aa"=>"1"
(1 row)
select
hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b','aa']
;
?column?
select
slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b','aa'])
;
slice
-------------------------------
"b"=>"2", "c"=>"3", "aa"=>"1"
(1 row)
select pg_column_size(
hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b']
)
select pg_column_size(
slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b'])
)
= pg_column_size('b=>2, c=>3'::hstore);
?column?
----------
t
(1 row)
select pg_column_size(
hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b','aa']
)
select pg_column_size(
slice(hstore 'aa=>1, b=>2, c=>3', ARRAY['c','b','aa'])
)
= pg_column_size('aa=>1, b=>2, c=>3'::hstore);
?column?
----------
...
...
contrib/hstore/hstore.sql.in
View file @
ce517476
/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.1
4 2010/06/18 03:52:02
rhaas Exp $ */
/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.1
5 2010/07/02 20:36:48
rhaas Exp $ */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
...
...
@@ -61,17 +61,11 @@ CREATE OPERATOR -> (
PROCEDURE = slice_array
);
CREATE OR REPLACE FUNCTION slice
_hstore
(hstore,text[])
CREATE OR REPLACE FUNCTION slice(hstore,text[])
RETURNS hstore
AS 'MODULE_PATHNAME','hstore_slice_to_hstore'
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR % (
LEFTARG = hstore,
RIGHTARG = text[],
PROCEDURE = slice_hstore
);
CREATE OR REPLACE FUNCTION isexists(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','hstore_exists'
...
...
contrib/hstore/sql/hstore.sql
View file @
ce517476
...
...
@@ -171,14 +171,14 @@ select pg_column_size(('b'=>'gf'))
select
pg_column_size
(
'a=>g, b=>c'
::
hstore
||
(
'b'
=>
'gf'
))
=
pg_column_size
(
'a=>g, b=>gf'
::
hstore
);
--
%
select
hstore
'aa=>1, b=>2, c=>3'
%
ARRAY
[
'g'
,
'h'
,
'i'
]
;
select
hstore
'aa=>1, b=>2, c=>3'
%
ARRAY
[
'c'
,
'b'
]
;
select
hstore
'aa=>1, b=>2, c=>3'
%
ARRAY
[
'aa'
,
'b'
]
;
select
hstore
'aa=>1, b=>2, c=>3'
%
ARRAY
[
'c'
,
'b'
,
'aa'
]
;
select
pg_column_size
(
hstore
'aa=>1, b=>2, c=>3'
%
ARRAY
[
'c'
,
'b'
]
)
--
slice()
select
slice
(
hstore
'aa=>1, b=>2, c=>3'
,
ARRAY
[
'g'
,
'h'
,
'i'
])
;
select
slice
(
hstore
'aa=>1, b=>2, c=>3'
,
ARRAY
[
'c'
,
'b'
])
;
select
slice
(
hstore
'aa=>1, b=>2, c=>3'
,
ARRAY
[
'aa'
,
'b'
])
;
select
slice
(
hstore
'aa=>1, b=>2, c=>3'
,
ARRAY
[
'c'
,
'b'
,
'aa'
])
;
select
pg_column_size
(
slice
(
hstore
'aa=>1, b=>2, c=>3'
,
ARRAY
[
'c'
,
'b'
])
)
=
pg_column_size
(
'b=>2, c=>3'
::
hstore
);
select
pg_column_size
(
hstore
'aa=>1, b=>2, c=>3'
%
ARRAY
[
'c'
,
'b'
,
'aa'
]
)
select
pg_column_size
(
slice
(
hstore
'aa=>1, b=>2, c=>3'
,
ARRAY
[
'c'
,
'b'
,
'aa'
])
)
=
pg_column_size
(
'aa=>1, b=>2, c=>3'
::
hstore
);
-- array input
...
...
contrib/hstore/uninstall_hstore.sql
View file @
ce517476
/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.1
0 2010/06/18 03:52:02
rhaas Exp $ */
/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.1
1 2010/07/02 20:36:48
rhaas Exp $ */
-- Adjust this setting to control where the objects get dropped.
SET
search_path
=
public
;
...
...
@@ -22,7 +22,6 @@ DROP OPERATOR <@ ( hstore, hstore );
DROP
OPERATOR
@
(
hstore
,
hstore
);
DROP
OPERATOR
~
(
hstore
,
hstore
);
DROP
OPERATOR
=>
(
text
,
text
);
DROP
OPERATOR
%
(
hstore
,
text
[]
);
DROP
OPERATOR
#=
(
anyelement
,
hstore
);
DROP
OPERATOR
%%
(
NONE
,
hstore
);
DROP
OPERATOR
%#
(
NONE
,
hstore
);
...
...
@@ -44,7 +43,7 @@ DROP FUNCTION hstore_le(hstore,hstore);
DROP
FUNCTION
hstore_cmp
(
hstore
,
hstore
);
DROP
FUNCTION
hstore_hash
(
hstore
);
DROP
FUNCTION
slice_array
(
hstore
,
text
[]);
DROP
FUNCTION
slice
_hstore
(
hstore
,
text
[]);
DROP
FUNCTION
slice
(
hstore
,
text
[]);
DROP
FUNCTION
fetchval
(
hstore
,
text
);
DROP
FUNCTION
isexists
(
hstore
,
text
);
DROP
FUNCTION
exist
(
hstore
,
text
);
...
...
doc/src/sgml/hstore.sgml
View file @
ce517476
<!-- $PostgreSQL: pgsql/doc/src/sgml/hstore.sgml,v 1.1
1 2010/06/22 11:36:16
rhaas Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/hstore.sgml,v 1.1
2 2010/07/02 20:36:49
rhaas Exp $ -->
<sect1 id="hstore">
<title>hstore</title>
...
...
@@ -120,13 +120,6 @@
<entry><literal>"a"=>"b"</literal></entry>
</row>
<row>
<entry><type>hstore</> <literal>%</> <type>text[]</></entry>
<entry>extract a subset of an <type>hstore</></entry>
<entry><literal>'a=>1,b=>2,c=>3'::hstore % ARRAY['b','c','x']</literal></entry>
<entry><literal>"b"=>"2", "c"=>"3"</literal></entry>
</row>
<row>
<entry><type>hstore</> <literal>||</> <type>hstore</></entry>
<entry>concatenate <type>hstore</>s</entry>
...
...
@@ -338,6 +331,14 @@ b
<entry><literal>{{a,1},{b,2}}</literal></entry>
</row>
<row>
<entry><function>slice(hstore, text[])</function></entry>
<entry><type>hstore</type></entry>
<entry>extract a subset of an <type>hstore</></entry>
<entry><literal>slice('a=>1,b=>2,c=>3'::hstore, ARRAY['b','c','x'])</literal></entry>
<entry><literal>"b"=>"2", "c"=>"3"</literal></entry>
</row>
<row>
<entry><function>each(hstore)</function></entry>
<entry><type>setof(key text, value text)</type></entry>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment