]> granicus.if.org Git - postgresql/commitdiff
Deprecate the use of => as an operator name.
authorRobert Haas <rhaas@postgresql.org>
Tue, 22 Jun 2010 11:36:36 +0000 (11:36 +0000)
committerRobert Haas <rhaas@postgresql.org>
Tue, 22 Jun 2010 11:36:36 +0000 (11:36 +0000)
In HEAD, emit a warning when an operator named => is defined.
In both HEAD and the backbranches (except in 8.2, where contrib
modules do not have documentation), document that hstore's text =>
text operator may be removed in a future release, and encourage the
use of the hstore(text, text) function instead.  This function only
exists in HEAD (previously, it was called tconvert), so backpatch
it back to 8.2, when hstore was added.  Per discussion.

contrib/hstore/hstore.sql.in
contrib/hstore/uninstall_hstore.sql
doc/src/sgml/hstore.sgml

index fb39967866c6f794ad174c495b402b89b8b57568..3fa3af3ee200c7bb848ce2fbbb08b5b8b7bf64e2 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.8 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.8.2.1 2010/06/22 11:36:36 rhaas Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -129,6 +129,12 @@ RETURNS hstore
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
+-- For forward compatibility with PostgreSQL >= 9.0
+CREATE OR REPLACE FUNCTION hstore(text,text)
+RETURNS hstore
+AS 'MODULE_PATHNAME', 'tconvert'
+LANGUAGE C IMMUTABLE; -- not STRICT
+
 CREATE OPERATOR => (
        LEFTARG = text,
        RIGHTARG = text,
index d9e08927a5ef81eedc0f1a19d4d9d62b0814df6a..ae2676a1b057f0c381a85eee80eac9d961381d8d 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.6 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.6.2.1 2010/06/22 11:36:36 rhaas Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -26,6 +26,7 @@ DROP FUNCTION hs_concat(hstore,hstore);
 DROP FUNCTION hs_contains(hstore,hstore);
 DROP FUNCTION hs_contained(hstore,hstore);
 DROP FUNCTION tconvert(text,text);
+DROP FUNCTION hstore(text,text);
 DROP FUNCTION akeys(hstore);
 DROP FUNCTION avals(hstore);
 DROP FUNCTION skeys(hstore);
index a3d82c970c6f11ef5e8e6e1b40c840034a1a065d..911e46f2743089baa90dd07f424459223f574116 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/hstore.sgml,v 1.2.2.1 2009/03/15 22:05:25 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/hstore.sgml,v 1.2.2.2 2010/06/22 11:36:36 rhaas Exp $ -->
 
 <sect1 id="hstore">
  <title>hstore</title>
    datatypes!)
   </para>
 
+  <note>
+  <para>
+   The <literal>=&gt;</> operator is deprecated and may be removed in a
+   future release.  Use the <literal>hstore(text, text)</literal> function
+   instead.
+   </para>
+  </note>
+
   <table id="hstore-func-table">
    <title><type>hstore</> Functions</title>
 
     </thead>
 
     <tbody>
+     <row>
+      <entry><function>hstore(text, text)</function></entry>
+      <entry><type>hstore</type></entry>
+      <entry>make single-item <type>hstore</></entry>
+      <entry><literal>hstore('a', 'b')</literal></entry>
+      <entry><literal>"a"=&gt;"b"</literal></entry>
+     </row>
+
      <row>
       <entry><function>akeys(hstore)</function></entry>
       <entry><type>text[]</type></entry>