From 31c47e53aa4b951bdd54eb6b47590e6c9124e427 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 18 Jun 2010 03:52:03 +0000 Subject: [PATCH] Rename hstore => text[] operator to % This is not yet in any released version, so we still have the option to change the name. We may want to reserve the token => in a future release. --- contrib/hstore/expected/hstore.out | 14 +++++++------- contrib/hstore/hstore.sql.in | 4 ++-- contrib/hstore/sql/hstore.sql | 14 +++++++------- contrib/hstore/uninstall_hstore.sql | 5 ++--- doc/src/sgml/hstore.sgml | 6 +++--- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/contrib/hstore/expected/hstore.out b/contrib/hstore/expected/hstore.out index 6a26bc1874..793318e185 100644 --- a/contrib/hstore/expected/hstore.out +++ b/contrib/hstore/expected/hstore.out @@ -757,39 +757,39 @@ select pg_column_size('a=>g, b=>c'::hstore || ('b'=>'gf')) t (1 row) --- => arrays -select hstore 'aa=>1, b=>2, c=>3' => ARRAY['g','h','i']; +-- % +select hstore 'aa=>1, b=>2, c=>3' % ARRAY['g','h','i']; ?column? ---------- (1 row) -select hstore 'aa=>1, b=>2, c=>3' => ARRAY['c','b']; +select hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b']; ?column? -------------------- "b"=>"2", "c"=>"3" (1 row) -select hstore 'aa=>1, b=>2, c=>3' => ARRAY['aa','b']; +select hstore 'aa=>1, b=>2, c=>3' % ARRAY['aa','b']; ?column? --------------------- "b"=>"2", "aa"=>"1" (1 row) -select hstore 'aa=>1, b=>2, c=>3' => ARRAY['c','b','aa']; +select hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b','aa']; ?column? ------------------------------- "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(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(hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b','aa']) = pg_column_size('aa=>1, b=>2, c=>3'::hstore); ?column? ---------- diff --git a/contrib/hstore/hstore.sql.in b/contrib/hstore/hstore.sql.in index b04d32a22d..3cf4178afb 100644 --- a/contrib/hstore/hstore.sql.in +++ b/contrib/hstore/hstore.sql.in @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.13 2010/06/15 19:48:30 rhaas Exp $ */ +/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.14 2010/06/18 03:52:02 rhaas Exp $ */ -- Adjust this setting to control where the objects get created. SET search_path = public; @@ -66,7 +66,7 @@ RETURNS hstore AS 'MODULE_PATHNAME','hstore_slice_to_hstore' LANGUAGE C STRICT IMMUTABLE; -CREATE OPERATOR => ( +CREATE OPERATOR % ( LEFTARG = hstore, RIGHTARG = text[], PROCEDURE = slice_hstore diff --git a/contrib/hstore/sql/hstore.sql b/contrib/hstore/sql/hstore.sql index 190d7a2afa..a066f11b2b 100644 --- a/contrib/hstore/sql/hstore.sql +++ b/contrib/hstore/sql/hstore.sql @@ -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); --- => arrays -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']) +-- % +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']) = 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(hstore 'aa=>1, b=>2, c=>3' % ARRAY['c','b','aa']) = pg_column_size('aa=>1, b=>2, c=>3'::hstore); -- array input diff --git a/contrib/hstore/uninstall_hstore.sql b/contrib/hstore/uninstall_hstore.sql index 9162475ad1..468bfb3c96 100644 --- a/contrib/hstore/uninstall_hstore.sql +++ b/contrib/hstore/uninstall_hstore.sql @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.9 2009/09/30 19:50:22 tgl Exp $ */ +/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.10 2010/06/18 03:52:02 rhaas Exp $ */ -- Adjust this setting to control where the objects get dropped. SET search_path = public; @@ -22,8 +22,7 @@ DROP OPERATOR <@ ( hstore, hstore ); DROP OPERATOR @ ( hstore, hstore ); DROP OPERATOR ~ ( hstore, hstore ); DROP OPERATOR => ( text, text ); -DROP OPERATOR => ( text[], text[] ); -DROP OPERATOR => ( hstore, text[] ); +DROP OPERATOR % ( hstore, text[] ); DROP OPERATOR #= ( anyelement, hstore ); DROP OPERATOR %% ( NONE, hstore ); DROP OPERATOR %# ( NONE, hstore ); diff --git a/doc/src/sgml/hstore.sgml b/doc/src/sgml/hstore.sgml index 9dac2b3ec4..d5d320adf9 100644 --- a/doc/src/sgml/hstore.sgml +++ b/doc/src/sgml/hstore.sgml @@ -1,4 +1,4 @@ - + hstore @@ -121,9 +121,9 @@ - hstore => text[] + hstore % text[] extract a subset of an hstore - 'a=>1,b=>2,c=>3'::hstore => ARRAY['b','c','x'] + 'a=>1,b=>2,c=>3'::hstore % ARRAY['b','c','x'] "b"=>"2", "c"=>"3"