]> granicus.if.org Git - postgresql/commitdiff
Add pg_opfamily_is_visible.
authorRobert Haas <rhaas@postgresql.org>
Mon, 18 Jul 2011 03:23:55 +0000 (23:23 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 18 Jul 2011 03:23:55 +0000 (23:23 -0400)
We already have similar functions for many other object types, including
operator classes, so it seems like we should have this one, too.

Extracted from a larger patch by Josh Kupershmidt

doc/src/sgml/func.sgml
src/backend/catalog/namespace.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h

index e7dcaca3b01d6c017bfdbccdda55a697431b5322..4c163366b267dd7d68c1ebc330e9958a5ae1a991 100644 (file)
@@ -13109,6 +13109,12 @@ SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);
        <entry><type>boolean</type></entry>
        <entry>is operator visible in search path</entry>
       </row>
+      <row>
+       <entry><literal><function>pg_opfamily_is_visible(<parameter>opclass_oid</parameter>)</function></literal>
+       </entry>
+       <entry><type>boolean</type></entry>
+       <entry>is operator family visible in search path</entry>
+      </row>
       <row>
        <entry><literal><function>pg_table_is_visible(<parameter>table_oid</parameter>)</function></literal>
        </entry>
@@ -13164,6 +13170,9 @@ SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);
    <indexterm>
     <primary>pg_operator_is_visible</primary>
    </indexterm>
+   <indexterm>
+    <primary>pg_opfamily_is_visible</primary>
+   </indexterm>
    <indexterm>
     <primary>pg_table_is_visible</primary>
    </indexterm>
index 8d426951ba58e9b14f3303595dde7a000c4bcfb0..dec608c9076d8bf4b4f1dba370a897549497e3f5 100644 (file)
@@ -202,6 +202,7 @@ Datum               pg_type_is_visible(PG_FUNCTION_ARGS);
 Datum          pg_function_is_visible(PG_FUNCTION_ARGS);
 Datum          pg_operator_is_visible(PG_FUNCTION_ARGS);
 Datum          pg_opclass_is_visible(PG_FUNCTION_ARGS);
+Datum          pg_opfamily_is_visible(PG_FUNCTION_ARGS);
 Datum          pg_collation_is_visible(PG_FUNCTION_ARGS);
 Datum          pg_conversion_is_visible(PG_FUNCTION_ARGS);
 Datum          pg_ts_parser_is_visible(PG_FUNCTION_ARGS);
@@ -3897,6 +3898,17 @@ pg_opclass_is_visible(PG_FUNCTION_ARGS)
        PG_RETURN_BOOL(OpclassIsVisible(oid));
 }
 
+Datum
+pg_opfamily_is_visible(PG_FUNCTION_ARGS)
+{
+       Oid                     oid = PG_GETARG_OID(0);
+
+       if (!SearchSysCacheExists1(OPFAMILYOID, ObjectIdGetDatum(oid)))
+               PG_RETURN_NULL();
+
+       PG_RETURN_BOOL(OpfamilyIsVisible(oid));
+}
+
 Datum
 pg_collation_is_visible(PG_FUNCTION_ARGS)
 {
index 34e30aa1d4de3e2005ca32c41aebeedbe399f160..57becb4fe5fb3443a249faa639fbcfeca16bf287 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     201107031
+#define CATALOG_VERSION_NO     201107171
 
 #endif
index 16dc70f6fa34f711d712f32c96b79982419fb3d8..cc436e34edd57aebe76b193aac886c4e6a8a07d2 100644 (file)
@@ -2829,6 +2829,8 @@ DATA(insert OID = 2082 (  pg_operator_is_visible  PGNSP PGUID 12 1 0 0 0 f f f t
 DESCR("is operator visible in search path?");
 DATA(insert OID = 2083 (  pg_opclass_is_visible                PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_opclass_is_visible _null_ _null_ _null_ ));
 DESCR("is opclass visible in search path?");
+DATA(insert OID = 3829 (  pg_opfamily_is_visible       PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_opfamily_is_visible _null_ _null_ _null_ ));
+DESCR("is opfamily visible in search path?");
 DATA(insert OID = 2093 (  pg_conversion_is_visible     PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_conversion_is_visible _null_ _null_ _null_ ));
 DESCR("is conversion visible in search path?");
 DATA(insert OID = 3756 (  pg_ts_parser_is_visible      PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_ts_parser_is_visible _null_ _null_ _null_ ));